## Tuesday, February 5, 2013

### Matrix types: Diagonal matrix

The term diagonal matrx refers to the topic of linear algebra which is a branch of mathematics. In general a matrx would look like as follows:
[a11 a12 a13 a1m]
[a21 a22 a23 a2m]
[a31 a32 a33 a3m]
[… …    ]
[… …    ]
[an1 an2 an3 anm]

The above matrx has n rows and m columns. The diagonal of such a matrx consists of all the entries where in the row number = column number. Therefore if r = row number and j = column number. Then the entries of the type a(ij) where i=j are the diagonal entries. Therefore in the above matrx the diagonal would be the highlighted entries as shown below:

[a11 a12 a13 a1m]
[a21 a22 a23 a2m]
[a31 a32 a33 a3m]
[… …    ]
[… …    ]
[an1 an2 an3 anm]

Now if we have a matrx where in all the entries except the diagonal entries are zero, then such a matrx would be called a diagonal matrix. In general a diagonal-matrx would look like this:

[a11 0 0 0]
[0 a22 0 0]
[0 0 a33 0]
[0 0 0 0]
[… .. 0]
[0 0 0 ann]

Note that a diagonal-matrx has to essentially be a square matrx. An example of a 3x3 diagonal-matrx is shown below:

[2 0 0]
[0 -1 0]
[0 0 5]

Scalar matrix:

A diagonal-matrx in which all the entries of the diagonal are equal is called a scalar-matrx. The general form of a scalar matrx would be like this:
[a 0 0 0]
[0 a 0 0]
[0 0 a 0]
[0 0 0 0]
[… .. 0]
[0 0 0 a]

Determinant of diagonal matrix:
Let us try to understand how to calculate the determinant of a diagonal matrix using an example.

Example: Calculate the determinant of the following diagonal-matrx:
[2 0 0]
[0 -1 0]
[0 0 5]
Solution:
D = 2*(-1*5 – 0*0) – 0*(5*0-0*0) + 0*(0*0-(-1)*0))
= 2*(-1)*(5) – 0 + 0
= 2*(-1)*5 = -10
So we see that the value of determinant of a diagonal-matrx is the product of the terms on the diagonal (also called the principal diagonal)