Matrix Lecture Sheet 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

https://slideplayer.

com/slide/2804957/

(VVVVVVVVVVVVVVVVV IMPT APPLICATION)

Diagonalization of a Matrix:
 1 0 0  0
0  0  0 
 2
D  P 1 AP   0 0 3  0 
 
    
 0 0 0 0  n 
Where,
D is a diagonalized matrix consisting of Eigen values.
P is a matrix consisting of Eigen vectors
P 1 is a inverse matrix of P
A is given Matrix
 1 ,  2 ,  3 ,.....................,  n are eigen values of A.

1  3 3
Example 49: Diagonalize the matrix  3  5 3
6  6 4 
Solution:
1  3 3
Let, A   3  5 3
6  6 4
 1  3 3  1 0 0 
 A   I   3  5 3    0 1
  0 
6  6 4  0 0 1 
 1  3 3   0 0 
 
 A   I   3  5 3   0  0 
6  6 4   0 0  
1   3 3 
 A  I   3  5 3 
 6 6 4   
1  3 3
A  I  3 5 3
6 6 4
 (1   )[( 5   )(4   )  ( 6)( 3)]  ( 3)[3(4   )  3  6]  3[3( 6)  6( 5   )]
 (1   )[( 20  5  4  2 )  18]  3[12  3  18]  3[18  30  6 ]
 (1   )[  2  2]  3[3  6]  3[12  6 ]
   2  2  2  3  2  9  18  36  18
 3  12  16
Now,
A  I  0
  3  12  16  0
 3  12  16  0
 3  22  22  4  8  16  0
 2 (  2)  2 (  2)  8(  2)  0
 (  2)(2  2  8)  0
 (  2)(2  4  2  8)  0
 (  2)(  4)(  2)  0
    2, 4,  2
x
 
Let, v 1   y 
z
 
We have, Av 1   v 1
1  3 3 x  x
 3  5 3 y    y 
     
6  6 4   z   z 

1  3 3 x  x
  3  5 3 y   4  y  [   4]
   
6  6 4   z   z 

1  3 3 x   4x 
  3  5 3 y    4y 
   
6  6 4   z   4z 

 x  3y  3z   4x 
  3x  5y  3z  =  4y
  

 6x  6y  4z   4z 
 x  3y  3 z  4x
3 x  5y  3 z  4y
6x  6 y  4 z  4z
 - 3x  3y  3z  0

80 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


3 x  9y  3z  0
6 x  6y  0
 xyz  0
x  3y  z  0
xy  0
 xyz  0
x  3y  z  0
x  y  0 .z  0

We have,
L i   a i1L 1  a 11L i
i  2, L 2   a 21 L 1  a 11L 2
 1( x  y  z)  1( x  3y  z)
  4y  2 z
i  3, L 3   a 31 L 1  a 11 L 3
L 3   1( x  y  z)  1( x  y  0.z)

  2y  z
Thus we obtain following system
xyz  0
 4 y  2z  0
 2y  z  0
 xyz  0
2y  z  0 [Dividing by -2 on both sides]
2y  z  0 [Multiplying by -1 on both sides]
Since the 2nd and 3rd equations are identical. We can disregard one of them
 xyz  0
2y  z  0

In echelon form, there are only two equations in three unknowns, then the system has a
non-zero solution and in particular (3-2) =1 free variable, which is z.
[Note Here total variables are three, i.e x, y, z and blocked variable is x and y, hence free
variable is z]

Let, z = 2

 y = 1 and x = 1

81 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


1
 
 v1   1 
 2
 
x
 
Let, v 2   y 
z
 
We have,
Av 2  v 2
1  3 3 x  x
 3  5 3 y    y 
     
6  6 4   z   z 

1  3 3 x  x 
  3  5 3 y   2  y  [    2]
   
6  6 4   z   z 

1  3 3 x   - 2x 
  3  5 3 y    - 2y 
   
6  6 4   z   - 2z 

 x  3y  3z   - 2x 
  3x  5 y  3 z  =  - 2y 
   
 6x  6y  4z   - 2z 
 x  3y  3 z   2 x
3 x  5y  3 z   2 y
6x  6 y  4 z   2 z
 3x  3y  3z  0
3x  3y  3z  0
6x  6 y  6 z  0
 xyz  0
xyz  0
xyz  0

Since the 1st, 2nd and 3rd equations are identical. We can disregard two of them

 xyz  0

In echelon form, there are only one equation in three unknowns, then the system has a
non-zero solution and in particular (3-1) =2 free variable, which is y and z.

82 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Let, y = 1 and z =0
 x=1
 x  1
   
 v2   y   1
 z   0
   
x
 
Let, v 3   y 
z
 
We have,

Av 3  v 3
1  3 3 x  x 
 3  5 3 y    y 
     
6  6 4   z   z 

1  3 3 x  x 
  3  5 3 y   2  y  [    2]
   
6  6 4   z   z 

1  3 3 x   - 2x 
  3  5 3 y    - 2y 
   
6  6 4   z   - 2z 

 x  3y  3z   - 2x 
  3x  5 y  3 z  =  - 2y 
   
 6x  6y  4z   - 2z 
 x  3y  3 z   2 x
3 x  5y  3 z   2 y
6x  6 y  4 z   2 z
 3x  3y  3z  0
3x  3y  3z  0
6x  6 y  6 z  0
 xyz  0 [Dividing by 3 on both sides]
xyz  0 [Dividing by 3 on both sides]
xyz  0 [Dividing by 6 on both sides]

83 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Since the 1st, 2nd and 3rd equations are identical. We can disregard two of them

 xyz  0
In echelon form, there are only one equation in three unknowns, then the system has a
non-zero solution and in particular (3-1) =2 free variable, which is y and z.

Let, y = 0 and z =1
 x=-1
 x    1
   
 v3   y   0 
z  1 
   
P  v 1 v2 v3 

1 1  1
P  1 1 0 
 2 0 1 

We know that, D  P 1 AP

Now,

1 1  1
P  1 1 0 
 2 0 1 
1 0
 Co-factor of a 11 (1)  c 11   1
0 1
1 0
 Co-factor of a 12 (1)  c 12    1
2 1
1 1
 Co-factor of a 13 ( 1)  c 13    2
2 0
1 1
 Co-factor of a 21 (1)  c 21    1
0 1
1 1
 Co-factor of a 22 (1)  c 22   3
2 1
1 1
 Co-factor of a 23 (0)  c 23   2
2 0
1 1
 Co-factor of a 31 ( 2)  c 31   1
1 0

84 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


1 1
 Co-factor of a 32 (0)  c 32    1
1 0
1 1
 Co-factor of a 33 (1)  c 33   0
1 1

 1  1  2
Co-factor Matrix: P    1 3
C
2 
 1  1 0 

 1 1 1 
Adjoint of P = (P )    1 3  1
C T

 2 2 0 

1 1  1
Given, P  1 1 0 
 2 0 1 

1 1 1
P  1 1 0  1(1  1  0)  1(1  0)  ( 1)(0  2)  1  1  2  2
2 0 1

 1 1 1 
Adjo int of P 1 
 P 1     1 3  1
P 2
  2 2 0 

 1  1 1  1  3 3 1 1  1
1 
D  P AP    1 3  1  3  5 3
1 1 1 0 
 
2
  2 2 0  6  6 4   2 0 1 

 1  1 1  1  1  3  1  3  2 1  1  3  1  3  0 1( 1)  ( 3)(0)  3  1
1 
   1 3  1  3  1  5  1  3  2 3  1  5  1  3  0 3( 1)  5(0)  3  1 
2
  2 2 0   6  1  6  1  4  2 6  1  6  1  4  0 6( 1)  6  0  4  1 

 1  1 1  1  3  6 1  3  0  1  0  3 
1 
   1 3  1  3  5  6 3  5  0  3  0  3
2
  2 2 0  6  6  8 6  6  0  6  0  4 

85 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 1  1 1  4  2 2 
1 
   1 3  1 4  2 0 
2
  2 2 0  8 0  2

 1 4  1 4  1 8 1( 2)  ( 1)( 2)  1  0 1  2  1  0  1( 2) 


1 
   1  4  3  4  ( 1)  8 ( 1)( 2)  3( 2)  ( 1)  0 ( 1)  2  3  0  ( 1)( 2)
2
  2  4  2  4  0  8 ( 2)( 2)  2( 2)  0  0  2  2  2  0  0( 2) 

 448 22 22 


1 
   4  12  8 2  6  2  2
2
  8  8  0 44  4) 

8 0 0 
1 
 0  4 0 
2
0 0  4

4 0 0 
D  0  2 0 

0 0  2
4 1
Example 50: Diagonalize the matrix:  
1 4 
Solution:
4 1
Let, A   
1 4 
4 1 1 0
A  I      0 1
 1 4  
 4 1   0 
A  I    
1 4  0  
4   1 
A  I  
 1 4   
4 1
A  I 
1 4
A   I  (4   )(4   )  1
A   I  16  4  4  2  1
A   I  2  8  15

Now,

86 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


A  I  0
 A   I  2  8  15  0
 A   I  2  3  5  15  0
 A   I  2  3  5  15  0
 A   I  (  3)(  5)  0
 (  3)(  5)  0
   3,   5

We have, Av 1   v 1

 x 
Let, v 1   
 y 

Av 1   v 1

4 1  x   x
1 4   y     y 
    

4 1  x  x
1 4  y   3  y  [When,   3 ]
    

4 1  x   3x 
1 4   y    3 y 
    

4  x  1  y   3x 
1  x  4  y    3y 
   

4x  y   3x 
 x  4 y    3y 
   

 4x  y  3 x
x  4y  3 y

 xy  0
xy  0

Since the 1stand 2nd equations are identical. We can disregard one of them

 xy  0

87 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.
Let y = 1, x = -1
 -1 
 v 1   
 1 
We have, Av 2  v 2

 x
Let, v 2   
 y

4 1  x   x
1 4   y     y 
    

4 1  x   x
1 4  y   5  y  [When,   5 ]
    

4 1  x   5x 
1 4   y    5 y 
    

4  x  1  y   5x 
1  x  4  y   5y 
   

4x  y   5x 
 x  4 y    5y 
   

 4x  y  5x
x  4 y  5y

 xy  0
xy  0

 xy  0 [Multiplying by -1 on both sides]


xy  0
Since the 1stand 2nd equations are identical. We can disregard one of them

 xy  0

In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.
Let, y = 1 x = 1

88 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 1
v 2   
 1
P  [ v1v2 ]
 1 1
P   
 1 1
P  ( 1)  1  1  2
We know that, D  P 1 AP
Now,
  1 1
P   
 1 1
 Co-factor of a 11 ( 1)  c 11  1
 Co-factor of a 12 (1)  c 12  1
 Co-factor of a 21 (1)  c 21  1
 Co-factor of a 22 (1)  c 22   ( 1)  1
 1  1
Co-factor Matrix: P C   
  1  1
 1  1
Adjoint of P = (P C )T   
 1  1
Adjo int of P 1  1  1
 P 1  
P  2  1  1
1  1  1 4 1   1 1
D  P 1 AP 
 2   1  1 1 4  1 1
1  1  1 4( 1)  1  1 4  1  1  1
D  P 1 AP 
 2   1  1 1( 1)  4  1 1  1  4  1
1  1  1   4  1 4  1
D  P 1 AP 
 2   1  1   1  4 1  4
1  1  1   3 5
D  P 1 AP 
 2   1  1  3 5
1  1( 3)  ( 1)  3 1  5  ( 1)  5 
D  P 1 AP 
 2 ( 1)( 3)  ( 1)  3 ( 1)  5  ( 1)  5

1  3  3 5  5 
D  P 1 AP 
 2  3  3  5  5
1  6 0 
D  P 1 AP 
 2  0  10

89 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 3 0
D  P 1 AP   
 0 5
 3 0
 D  P 1 AP    Answer
 0 5
 5 1 2
Example 51: Diagonalize the matrix: 0 3 0 
 2 1 5 
Solution:
 5 1 2
Given, A  0 3 0
 2 1 5
For Eigen values,
5 1 2  1 0 0 
 A   I  0 3 0    0 1 0 
 2 1 5  0 0 1 
5 1 2   0 0 
 
 A   I  0 3 0   0  0 
 2 1 5  0 0  
5   1 2 

 A  I   0 3 0 
 2 1 5   
5 1 2
 A  I  0 3 0
2 1 5
 (5   )[( 3   )(5   )  0]  1[0(5   )  2  0]  2[0  1  2( 3   )]
 (5   )[15  3  5  2 ]  1[0  0]  2[0  6  2 ]
 (5   )[15  8  2 ]  2[6  2 ]
 (5   )[15  8  2 ]  12  4
 75  40  52  15  82  3  12  4
 63  51  132  3
  3  132  51  63
 A  I  0

  3  132  51  63  0
 3  132  51  63  0

90 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 3  32  102  30  21  63  0
 2 (  3)  10 (  3)  21(  3)  0

 (  3)(2  10  21)  0

 (  3)(2  7  3  21)  0
 (  3)[ (  7 )  3(  7 )]  0
 (  3)(  7 )(  3)  0
   3,   7 ,   3
   3,   3,   7
x 
Let a nonzero vector v 1   y 

 z 
We have, Av 1   v 1

5 1 2 x x
 0 3 0   y    y 
   
 2 1 5   z   z 
5 1 2 x x
 0 3 0   y   3  y  [When,   3 ]
   
 2 1 5   z   z 
5 1 2  x   3x 
 0 3 0   y    3y 
 2 1 5   z   3z 
 5x  y  2z   3x 
 0  x  3y  0  z    3y 
 2x  y  5z   3z 
5x  y  2z   3x 
  3y    3y 
  
 2x  y  5z   3z 
 5 x  y  2z  3x
3 y  3y
2x  y  5z  3z
 2x  y  2 z  0
3y  3y  0
2x  y  2z  0

91 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 2x  y  2 z  0
00
2x  y  2z  0
 2x  y  2z  0
2x  y  2z  0
Since the 1stand 2nd equations are identical. We can disregard one of them

 2x  y  2z  0
In echelon form, there are only one equation in three unknowns, then the system has a
non-zero solution and in particular (3-1) =2 free variable, which is y and z.

Let,
z=1
y=2
 2x + 2 + 2 = 0
 x = -2

x  2
 v 1   y    2  For  = 3
  
 z   1 

x
Let, v 2   y 
 z 
We have, Av 2  v 2
 5 1 2  x  x
 0 3 0   y     y 
 2 1 5   z   z 
 5 1 2  x  x
 
 0 3 0   y   3  y  [When,   3 ]
 
 2 1 5   z   z 
5 1 2  x   3x 
 0 3 0   y    3y 
 2 1 5   z   3z 
 5x  y  2z   3x 
 0  x  3y  0  z    3y 
 2x  y  5z   3z 

92 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


5x  y  2z   3x 
  3y    3y 
  
 2x  y  5z   3z 

 5 x  y  2z  3x
3 y  3y
2x  y  5z  3z

 2x  y  2 z  0
3y  3y  0
2x  y  2z  0

 2x  y  2 z  0
00
2x  y  2z  0

 2x  y  2z  0
2x  y  2z  0
Since the 1stand 2nd equations are identical. We can disregard one of them

 2x  y  2z  0
In echelon form, there are only one equation in three unknowns, then the system has a
non-zero solution and in particular (3-1) =2 free variable, which is y and z.
Let,
z=1
y=0
 2x + 0 + 2 = 0
 x = -1
x   1 
 v 2   y  0 
  
 z   1 
x
Let, v 3   y 
 z 
We have, Av 3  v 3
 5 1 2  x  x 
   
 0 3 0   y     y 

 2 1 5   z   z 

93 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 5 1 2  x  x
 
 0 3 0   y   7  y  [When,   7 ]
 
 2 1 5   z   z 
 5 1 2  x   7 x 
 0 3 0   y    7 y 
 2 1 5   z   7 z 
 5x  y  2z   7 x 
 0  x  3y  0  z    7 y 
 2x  y  5z   7 z 
5x  y  2z   7 x 
  3y    7y
 


 2x  y  5z   7 z 

 5x  y  2 z  7 x
3y  7 y
2x  y  5z  7 z

  2x  y  2z  0
 4y  0
2x  y  2z  0
  2x  y  2z  0
4y  0
2x  y  2z  0

 2x  y  2 z  0 [Multiplying by -1 on both sides]


y0
2x  y  2z  0
We get, y  0
 2x  y  2 z  0
2x  y  2z  0

We have,
L i   a i1L 1  a 11L i
i  2, L 2   a 21 L 1  a 11L 2
 2( 2x  y  2z )  2( 2x  y  2z )
 4x  2 y  4 z  4 x  2y  4 z
 4y
Thus we obtain following system
 2x  y  2 z  0

94 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


4y  0

 2x  y  2 z  0
y0

 2x  0  2z  0

 2x  2z  0
In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is z.

Let,
z=1
 y = 0 [obtained]
 2x - 2 = 0
 x=1
x  1 
 v 3   y    0  [For   7 ]
 z   1 
Let P be a matrix whose columns are the above Eigen vectors.
P  v 1 v2 v3 

 2  1 1
P   2 0 0
 1 1 1 

P  ( 2)(0  0)  ( 1)( 2  0)  1( 2  0)
P  22  4

Then, D  P 1 AP is the diagonalized matrix whose leading diagonal are the respective
Eigen values.
Now
 2  1 1
P   2 0 0
 1 1 1 
0 0
 Co-factor of a 11 ( 2)  c 11   0
1 1
2 0
 Co-factor of a 12 ( 1)  c 12    2
1 1

95 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


2 0
 Co-factor of a 13 (1)  c 13   2
1 1
1 1
 Co-factor of a 21 ( 2)  c 21   2
1 1
2 1
 Co-factor of a 22 (0)  c 22    3
1 1
 2 1
 Co-factor of a 23 (0)  c 23   1
1 1
1 1
 Co-factor of a 31 (1)  c 31   0
0 0
2 1
 Co-factor of a 32 (1)  c 32   2
2 0
 2 1
 Co-factor of a 33 (1)  c 33   2
2 0
 0  2 2
Co-factor Matrix: P C   2  3 1 
0 2 2
0 2 0
Adjoint of P = (P )   2  3 2
C T 
 2 1 2
 0 2 0
Adjo int of P 1 
P 1
   2  3 2
P 4
 2 1 2
 0 2 0  5 1 2   2  1 1
1
D  P AP    2  3 2 0 3 0   2
1
0 0
4
 2 1 2  2 1 5   1 1 1
 0 2 0  5( 2)  1  2  2  1 5( 1)  1  0  2  1 5  1  1  0  2  1
1
   2  3 2 0( 2)  3  2  0  1 0( 1)  3  0  0  1 0  1  3  0  0  1
4
 2 1 2  2( 2)  1  2  5  1 2( 1)  1  0  5  1 2  1  1  0  5  1
 0 2 0   10  2  2  5  0  2 5  0  2
1
   2  3 2  0  6  0 0  0  0 0  0  0 
4
 2 1 2   4  2  5  2  0  5 2  0  5
 0 2 0   6  3 7 
1
   2  3 2  6 0 0
4
 2 1 2  3 3 7 

96 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 0( 6)  2  6  0  3 0( 3)  2  0  0  3 0 7  2 0  0 7 
1
 ( 2)( 6)  ( 3)(6)  2  3 ( 2)( 3)  ( 3)  0  2  3 ( 2)  7  ( 3)  0  2  7 
4
 2( 6)  1  6  2  3 2( 3)  1  0  2  3 2  7  1  0  2  7 
 0  12  0 000 000 
1
  12  18  6 66  14  0  14
4
  12  6  6  6  0  6 14  0  14 
12 0 0
1
 0 12 0 
4
 0 0 28
3 0 0
D  0 3 0
0 0 7 
3 0 0
 D  P AP   0 3 0  Answer
1

 0 0 7 
Home Task:
Diagonalize the matrix
1  1 2  5 0 0  1 0 0   1 0 1 
 2  1  3 4 
i.   ii . 0 2  1 iii . 1 0 3  iv . 0 1 1  v . 0 1 0 vi . 
  

 3 4           4  3
 0 0 3   0 0  2   0 1 1   0 0 1 
1 1
Solve the diagonalization problem for  
0 1
Hints:
  1,1
We cannot obtain two linearly independent eigenvectors for the given matrix. Thus the matrix is
not diagonalizable.

Example 52: Use Elementary row operations to transform the row-reduced matrix
to the identity matrix:

1 2 1  1 2 1
0 1 3  0 1 0 (By adding to the second row –3 times the third row)
   
0 0 1  0 0 1

 1 2 0
 0 1 0 (By adding to the first row –1 times the third row)
0 0 1

97 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


1 0 0
 0 1 0 (By adding to the first row –2 times the second row)
0 0 1 

Thus, a square matrix A has an inverse if and only if A can be transformed into an
identity matrix with elementary row operations.

Finding Inverse making Linear Equations:


 1 2
Example 53: Find A 1 where A   
3 1
Answer:
 1 2  x1  d1 
Given, A    , Let X    and B   
3 1  x2  d 2 
 AX  B
1  x1  2  x 2   d 1 
 3  x  1  x   d 
 1 2  2

The matrix can be written as


x 1  2x 2  d 1 (say ) -----------------(i)
3x 1  x 2  d 2 (say ) -----------------(ii)

( ii )  2  ( i ) :
5x 1  2d 2  d 1
1 2
x1  d 1  d 2 ----------------(iii)
5 5
( i )  3  ( ii ) :
5x 2  3d 1  d 2
3 1
x 2  d 1  d 2 ---------------------(iv)
5 5

FROM (iii) and (iv) we get,


 1 2 
1  5 5 
A  
3 1
  
 5 5

98 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Question: Define Augmented Matrix with example:
Answer: The augmented matrix for AX=b is the partitioned matrix [A b] .
All the scalars contained in the system of equations AX=b appear in the coefficient
matrix A and the column matrix b. These scalars can be combined into the single
partitioned matrix [A b] , known as the augmented matrix for the system of equations.
Example 54: x 1  x 2  2x 3  3
2x 1  5x 2  3x 3  11
 x 1  3x 2  x 3  5
can be written as the matrix equation
 1 1  2  x1    3
 
Let, A   2 5 3  ; X  x 2  ; b   11 
  1 3 1   x 3   5 
AX= b

 1 1  2  x 1    3
 2 5 3   x    11 
  2   
  1 3 1   x 3   5 

Which has as its augmented matrix?


 1 1  2  3
 
[A b]   2 5 3 11 
 1 3 1 5 

Elementary Row and Column Operations


The matrix operations of
1. Interchanging two rows or columns,
2. Adding a multiple of one row or column to another,
3. Multiplying any row or column by a nonzero element.

Calculating Inverses by the elementary row operation method


Step1: Create an augment matrix [A I] , where A is the nn matrix to be inverted
and I is the nn identity matrix.

Step 2: Use elementary row operations on [A I] to transform the left partition A to row-
reduced form, applying each operation to the full augmented matrix.
Step 3: If the left partition of the row-reduced matrix has zero elements on its main
diagonal, stop-A does not have an inverse-otherwise, continue.

99 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Step 4: Use elementary row operations on the row-reduced augmented matrix to
transform the left partition to the nn identity matrix, applying each operation to the full
augmented matrix.
Step 5: The right partition of the final augmented matrix is the inverse of A.

[Note: It is easy to show that if any diagonal element in a diagonal matrix is (zero) 0,
then that matrix is singular.]
 1 2
Example 55: Find the inverse of A   
 3 4
1 2 1 0
Solution: [A I]   
3 4 0 1
'
r2  r2  ( 3)r1
 1 2 1 0 
 
 3  ( 3).1 4  ( 3).2 0  ( 3).1 1  ( 3).0
 1 2 1 0 
 
 3  3 4  6  3 1  0
 1 2 1 0
 
 0  2  3 1
' 1
r2  r2  (  )
2
 1 2 1 0 
 1 1 1 1 
 0  (  2 )  2  (  2 )  3  (  2 ) 1  (  2 )
 
1 2 1 0 
 3 1
0 1 2  2 
 
'
r1  r1  ( 2)r2
 3 1 
1  ( 2).0 2  ( 2).1 1  ( 2) 2 0  ( 2)(  )
2 

0 1 3 1
  
 2 2 
1  0 2  2 1  3 0  1
 3 1
 0 1  
 2 2
1 0  2 1 
 3 1
0 1 2  2 
 

100 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 2 1 
Thus A 1   3  1
 2 2 
5 8 1 
Example 56: Find the inverse of A  0 2 1 
4 3 - 1
5 8 1 1 0 0
 
Solution: 0 2 1 0 1 0
4 3  1 0 0 1 
 
 1 1 .6 0 .2 0 .2 0 0 
 
 0 2 1 0 1 0 (By multiplying the first row by 0.2)
4 3  1 0 0 1 
 
 1 1 .6 0 .2 0 .2 0 0 
 
 0 2 1 0 1 0 (By adding to the third row –4 times the first
 0  3 .4  1 .8  0 .8 0 1 
 
row)

 1 1 .6 0 .2 0 .2 0 0
  1
 0 1 0 .5 0 0 .5 0 (By multiplying the second row by )
2
 0  3 .4  1 .8  0 .8 0 1 

 1 1 .6 0 .2 0 .2 0 0
 
 0 1 0 .5 0 0 .5 0 (By adding to the third row 3.4 times the
0 0  0 .1  0 .8 1 .7 1

second row)
 1 1 .6 0 .2 0 .2 0 0 
 
 0 1 0 .5 0 0 .5 0  (by multiplying the third row by –10)
0 0 1 8  17  10

A has been transformed into row-reduced form with a main diagonal of only ones; A has
an inverse. Continuing with the transformation process, we get:
 1 1 .6 0 .2 0 .2 0 0 
 
 0 1 0 4 9 5  (By adding to the second row –0.5 times the
0 0 1 8  17  10

third row)

101 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 1 1 .6 0  1 .4 3 .4 2 
 
 0 1 0  4 9 5  (by adding to the first row –0.2 times the
0 0 1 8  17  10

third row)

1 0 0 5  11  6 
 
 0 1 0  4 9 5  (by adding to the first row –1.6 times the
0 0 1 8  17  10
 
second row)

 5  11  6 
Thus, A    4
-1
9 5 
 8  17  10

Question: State Cayely Hamilton Theorem with example:


Answer:
Statement: Every Square matrix satisfies its characteristic equation or if
n n n 1 n2
A   I  ( 1) [  a 1   a 2           a n ] be the characteristic
polynomial of nn matrix A  [a ij ] , then the matrix equation
n 1
X  a1 X
n
         a n I  0 is satisfied by X=A
n 1
i.e A  a 1 A
n
             a n I  0

1 4
Example 57: Show that the matrix A=   satisfies Caley-Hamilton Theorem
 2 3
and hence compute A 1
Answer: Hence we have,
1 4 1 0
A  I      
 2 3 0 1
1 4   0 
A  I    
 2 3  0  
1   4  0 
A  I   
2  0 3   
1   4 
A  I  
 2 3   
1  4
A  I 
2 3

102 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


A   I  (1   )( 3   )  8
A   I  ( 3    3   2 )  8
A   I  3  4   2  8
A   I  2  4  5
 Characteristic equation of A is A   I  0
2  4  5  0 -------------------------------(i)
Replace  by A in L.H.S of (i)
Now A 2  4 A  5I
1 4  1 4 1 4 1 0
=     4   5 
2 3  2 3  2 3 0 1
1  8 4  12 4 16 5 0
=    
 2  6 8  9  8 12 0 5
9 16 4 16 5 0
=    
8 17  8 12 0 5
0 0 
=    0  NULL MATRIX
0 0 
That is A 2  4 A  5 I  0 ------------------------------(ii)
Hence the given matrix A satisfies its characteristic equation (i) i.e satisfy Caley
Hamilton Theorem.
Again, from (ii)
A 2  4 A  5I =0 gives
A 2  4 A  5I ------------------------------(iii)
1
Multiplying (iii) by A on both sides:
A 2 . A 1  4 AA 1  5 A 1 I
A  4I  5 A  1
[ AA 1  I & A 1 I  A 1 ]

Example:
 1 0 0  x
   
Let, I   0 1 0  , X   y 
 0 0 1 z
   
 1 0 0  x   1  x  0  y  0  z 
    
 IX   0 1 0  y    0  x  1  y  0  z 
 0 0 1  z   0  x  0  y  1  z 
    
 x
 
 y
z
 

103 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


X
 IX  X

A  4I  5 A  1
1
 A  1  ( A  4I ) ------------------------------(iv)
5
Putting the value of A and I in (iv), we get
1
 A  1  ( A  4I )
5
1 1 4 1 0 
 A 1  {    4 }
5  2 3 0 1
1  1 4   4 0
 A 1  { 
5  2 3 0 4
1 1  4 4  0 
 A 1  {
5  2  0 3  4
1  3 4 
 
5  2  1
Perfection Test:
1  1 4   3 4 
AA 1  
5  2 3  2  1
1 1  ( 3)  4  2 1  4  4  ( 1) 
AA 1 
5  2  ( 3)  3  2 2  4  3  ( 1)
1  3  8 4  4
AA 1 
5   6  6 8  3
1  5 0
AA 1  
5 0 5
1 0
AA 1   
0 1
AA 1  I

Home Task
 2 0 1
Show that the matrix  2 3 4 satisfies Caley-Hamilton Theorem and hence
  5 5 6
compute A 1

104 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Geometrical Applications of Matrices

A matrix is a rectangular array of numbers, which can be used to give information. The
coordinates in two dimensions of a point can be represented by a matrix, so that the
 2
coordinates (2,3) of a point can be represented by a matrix (2,3) or by a matrix   .
 3
The components of a vector can be represented by a matrix
Example:
Y
P (3,4)

O X
Figure no 26
  
3  
OP     ( 3 i  4 j )
 4
We can even write the coordinates of several points in a single matrix, so that the points
coordinates O(0,0), P(1,0), Q(1,1) and R(0,1), the vertices of the unit square, can be
 0 1 1 0
displayed in the matrix   (Fig:1) and the points O(0,0), P(2,0), Q(2,1) and
 0 0 1 1
 0 2 2 0
R(0,1) can be displayed in the matrix   (Fig:2). Since these points are the
 0 0 1 1
vertices of a rectangle, call this matrix R.

.
R (0,1) . Q (1,1) R(0,1) Q(2,1)

O(0,0) P(1,0) O(0,0) P(2,0)

Figure no 27 Figure no 28
When the matrix R is multiplied by 2 2-unit matrixes, it is unaltered.
 1 0  0 2 2 0   0 2 2 0 
     
 0 1  0 0 1 1   0 0 1 1 

Reflection:
1 0 
When R is multiplied by   ,
 0  1 

105 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 1 0  0 2 2 0   0 2 2 0 
      .
 0  1  0 0 1 1   0 0  1  1 

.
R(0,1) Q(2,1)

O(0,0) P(2,0)
R(0,-1) . Q(2,-1)

Figure no 29
The rectangle OPQR has been reflected in the x-axis. The rectangle OPQR is called the
1 0 
image of OPQR under the transformation described by the matrix   or more
 0  1 
1 0 
simply, the image under the transformation  
 0  1 
Rotation:
 0 1  0 2 2 0   0 0 1 1
Similarly       showing that OPQR has been
  1 0  0 0 1 1   0  2  2 0 
rotated about the origin through 90 0 in a clockwise sense, and we see that the matrix
 0 1
  describes a rotation through 90 0 in a clockwise sense. The matrix
  1 0
 0  1
  describes a rotation about the origin through 90 0 in an anticlockwise sense.
1 0 

.
R (0,1) Q (2,1)

O(1,0) P (2,0)

( 0, -1)

(0,-2) (1,-2)

Figure no 30

106 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 3 0
Enlargement: If we consider the effect of the matrix   on the unit square,
 0 3
 3 0  0 1 1 0   0 3 3 0 
     
 0 3  0 0 1 1   0 0 3 3 
y
(3,3)

(0,1) (1,1)

(0,0)S (1,0) X

Figure no 31
We see that each side has been enlarged by a factor 3 and the area has been increased by
9, the figure remaining a square. Thus we see that matrices can describe some of the
simplest geometrical operations, reflection, rotation and enlargement. We should, of
course, show that these matrices would make the appropriate transformation on any
figure, not just on the unit square and rectangle.

 0  1
Example 58: Given that A   , find A 2 , A 3 and A 4 . Investigate the
1 0 
transformations described by these matrices.
 0  1  0  1    1 0 
Answer: A 2       
 1 0  1 0   0  1 
 0  1   1 0   0 1
A 3  A.A 2       
 1 0  0  1    1 0 
 0  1  0 1   1 0 
A 4  A.A 3       
 1 0   1 0   0 1 
 x
The coordinates of any point P (x,y) can be written as a matrix   , denoted by X and
y
we see that:
 0  1  x    y 
A.X       
 1 0  y   x 
  1 0  x    x 
A 2 .X       
 0  1  y    y 
 0 1  x   y 
A 3 .X       
  1 0  y    x 

107 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


and A 4 . X  X , Since A 4 is the 22 unit matrix.
The matrix A has rotated OP through 90 0 in the anticlockwise sense, A 2 has rotated OP
through 180 0 , A 3 has rotated OP through 270 0 and A 4 has rotated OP through 360 0 ,
mapping OP onto itself.
Another Example:
 1 k  0 1 1 0   0 1 1  k k 
     
 0 1  0 0 1 1   0 0 1 1 

(k,1) (k+1,1)

Figure no 32
 1 k 
The matrix   has mapped the unit square into a parallelogram as the above figure.
0 1
Interpret the meaning of a determinant:
There are many ways to interpret the meaning of a determinant. One simple
interpretation concerns 2D parallelograms and 3D parallelepipeds. In the 2D case,
 
Example 59: Consider the vectors u  (u 1 , u 2 ) and v  ( v 1 , v 2 ) . Then the area of the
parallelogram
formed by u and v,

Figure no 33
u1 v1
Area   u1 v 2  u 2 v 1
u2 v2
Similarly, with three 3D vectors (u 1 , u 2 , u 3 ) ( v 1 , v 2 , v 3 ) and ( w 1 , w 2 , w 3 ) we can define
a parallelepiped, whose volume is

u1 v1 w1
Volume  u 2 v2 w2
u3 v3 w 3
Determinants have many uses, but we will primarily use them to define and evaluate the

108 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


cross product of two 3D vectors

Example 60: Find the area of the parallelogram defined by the column matrices
  4 6
u    and v   
4  2
  4 6
Answer: det er min ant     32  32 square units.
 4 2

Figure no 34

Example 61: Find the area of the parallelogram defined by the column matrices
  3 6
u    and v   
  1  2
  3 6
Answer: det er min ant    0  0 square units.
  1 2

(-3,-1) (6,2)

Figure no 35

109 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Some Important Properties:
01) The determinant of an upper or lower triangular matrix is the product of the
elements on the main diagonal.
2 6  4 1 
 0 5 7  4
Example 62: det    2(5)( 5)( 3)  150
0 0  5 8 
 
0 0 0 3
02) The determinant of a diagonal matrix is the product of the elements on its main
diagonal
03) If a square matrix has a zero row or a zero column, then its determinant is 0.
04) If two rows of a square matrix are identical, then its determinant is 0.
05) A square matrix has an inverse if and only if its determinant is nonzero.
06) The sum of the eigenvalues of a matrix equals the trace of the matrix

Example 63: Determine whether  1  12 and  2  4 are eigen values for


 11 3 
A 
  5  5
Solution: Here tr(A)=11+(-5)=6 8 =  1   2 , So these numbers are not the eigen
values of A.

07) The eigenvalues of an upper or lower triangular matrix are the elements on the
main diagonal
1 0 0 
Example 64: The matrix  2 1 0  is lower triangular, so its eigenvalues are
 3 4  1
 1   2  1 and  3  1
08) A matrix is singular if and only if it has a zero eigenvalue
09) The product of all the eigenvalues of a matrix equals to the determinant of the
matrix
 11 3 
Example 65: The eigenvalues of A =   are  1  10 and  2  4
  5  5
Here det(A)=-55+15=-40=  1  2
10) If  is an eigenvalue of A, then  also an eigenvalue of A T
11) An nn matrix is diagonalizable if and only if the matrix possesses n linearly
independent eigenvectors

110 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Representing Graphs Using Adjacency Matrix:
Adjacency Matrix Representation

Example 66:

1
a

d
2 4
b Figure no 36 c

3
A 1 2 3 4

1 1 1 1 0

2 0 0 1 0

3 0 0 0 0

4 0 0 1 0

An adjacency matrix represents the graph as a n x n matrix A:


A [i, j] = 1 if edge (i, j) E (or weight of edge)
= 0 if edge (i, j) E
Node:

 Nodes contain data and/or links to other nodes. Links between nodes are often
implemented by pointers or references.

111 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 Multiple computers are connected with a network in a distributed processing
system (or a parallel processing system). Each computer of such a system is called
a `node'.
 Any device that is directly connected to the network, usually through Ethernet
cable. Nodes include file servers and shared peripherals.
 A node is a device that is connected as part of a computer network. Nodes can be
computers, personal digital assistants (PDAs), cell phones, or various other
network appliances.
 The place on a stem where the leaves or branches are attached.
 A single machine on a network.
 The point on a plant stem where a leaf or leaves are attached; the point on a stem
from which new leaves or stems will grow.
 A device attached to a network. A node uses the network as a means of
communication and has an address on the network
 End point of a network connection. Nodes include any device attached to a
network such as file servers, printers, or workstations.
 The part of the stem from which one or more leaves arise.
 The point on a stem where a leaf or bud is attached.
 This is any point of connection in a network.
 The point of intersection of a planet's orbit and the ecliptic.
 A linked list is a linear collection of data elements (called nodes), where the linear
order is given by means of pointers.
 When two or more devices connected for the purpose of sharing data or resources
can form a network. Devices referred to as nodes.
 A linked list is one of the fundamental data structures used in computer
programming
Different of linked list: Doubly linked list, singly linked list, linked list, double linked
list, circularly linked list, unrolled linked list
Each node is divided into 2 parts in linked list:
i) 1st part contains the information of the element
ii) 2nd part is called the link field or next pointer field, which contains the address
of the next node in the list.
(In link list)

Struct node { 5 7 3
int value;
struct node *next;
}

112 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Undirected Graph:
A graph G = (V, E)
V: vertices
E : edges, unordered pairs of vertices from V  V
(u,v) is same as (v,u)

Figure no 37
Directed Graph:
A graph G = (V, E)
V: vertices
E: edges, ordered pairs of vertices from VV
F(u,v) is different from (v,u)

Figure no 38

113 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Strongly Connected Components:
 Every pair of vertices are reachable from each other
 Graph G is strongly connected if, for every u and v in V, there is some path from
u to v and some path from v to u.

Figure no 39: Strongly Connected Figure no 40: Not Strongly Connected

Graphically Representation of Transpose of a Matrix:

The graph GT is the transpose of G, which is visualized by reversing the arrows on the
digraph.

b
c
Graph (G)
Figure no 42

114 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


a

b
c

Graph (GT)

Figure no 43

a b c a b c
a 0 0 1 a 0 1 0
b 1 0 0 b 0 0 1
c 0 1 0 c 1 0 0

Matrix of Graph G Matrix of Graph GT

Matrix Decomposition Theorem

Matrix decomposition is a factorization of a matrix into some canonical form (Standard


form/Normal form). There are many different matrix decompositions; each finds use
among a particular class of problems.

Decompositions related to solving systems of linear equations

o LU decomposition
o Cholesky decomposition
o QR decomposition

Decompositions based on eigenvalues and related concepts

o Eigen decomposition (also called spectral/diagonal decomposition)


o Singular value decomposition

115 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


A. Eigen/diagonal Decomposition or spectral decomposition Theorem:
In linear algebra, eigendecomposition or sometimes spectral decomposition is the
factorization of a matrix into a canonical form, whereby the matrix is represented in
terms of its eigenvalues and eigenvectors. Only diagonalizable matrices can be factorized
in this way.
Let A be the given Matrix, D is a diagonal matrix with the corresponding eigen values of
Matrix A and P be a matrix of eigenvectors of a given Matrix A, Then A can be written
as an eigen decomposition A  PDP 1
 4 1
Example 67: Examine the eigen decomposition for the matrix A   
 1 4
 4 1
Let A   
 1 4
 4 1  1 0  4 1   0   4   1 
 A   I               
 1 4  0 1  1 4  0    1 4   
4 1
A  I   (4   )(4   )  1
1 4
 A  I  0
4 1
  (4   )(4   )  1 =0
1 4
 (16  4  4  2 )  1  0
 2  8  16  1  0
 2  8  15  0
 2  5  3  15  0
 (  5)  3(  5)  0
 (  5)(  3)  0
   5,   3

 3 0
D   
 0 5

Now to find out the eigenvector of the matrix A,

x
Let a non-zero vector v =  
y
We have, Av   v
 4 1  x  x
        
 1 4  y  y

116 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 4x  y   x
    3  [For   3]
 x  4y  y
 4x  y   3 x 
     
 x  4 y   3y 
 4x  y  3x
x  4y  3y
 xy  0
xy  0

x  y  0
In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.
Let y = 1 then x = -1
  1
 Eigenvector v    for   3
 1 
Again for   5
x
Let a non-zero vector v =  
y
We have, Av   v
 4 1  x  x
      5 
 1 4  y  y
 4x  y   x
    5  [For   5]
 x  4y   y
 4x  y   5x 
     
 x  4y   5 y 
 4 x  y  5x
x  4y  5y

 xy  0
xy  0

 xy  0
xy  0

 xy  0

In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.
Let y =1 , then x =1

117 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 1
 Eigenvector v    for   5
 1
P be a matrix of eigenvectors of a given Matrix A.
  1 1
 P   
 1 1
Now to find out p 1
c11  1, c12  1, c 21  1, c 22  1
 1  1
pc   
  1  1
 1  1
Adj P  ( P C )T   
  1  1
1 1
P    1  1  2
1 1
AdjP 1  1  1
 P 1     
P 2   1  1 
Then A can be written as an eigen decomposition A  PDP 1

Justification:
 4 1 1   1 1  3 0   1  1
       
 1 4 2  1 1   0 5    1  1 
1   1 1  3  3 
    
2  1 1    5  5 
1  3  5 3  5 
   
2  3  5  3  5 
1   8  2
   
2   2  8 
 4 1
    A (Proved)
 1 4

A  PDP 1 (Proved)

7 3   1 2
Home task: Find eigen decomposition of the matrix    and   
 3  1  4 3

Q-01: What is the difference between Eigen decomposition and SVD?

118 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


The SVD always exists for any sort of rectangular or square matrix, whereas the eigen
decomposition can only exists for square matrices, and even among square matrices
sometimes it doesn't exist.

What is singular value of a Matrix?


The singular values of a m  n matrix A are the square roots of the eigenvalues of the
symmetric n  n matrix A T A . The Eigen values of A T A are
 1   2 ................   r   r 1 ...................   n .
Since large eigenvalues carry significant representation of the matrix, we arrange
the values of the Eigen Values from the largest to the smallest and drop/ignore the
values towards the last since small eigenvalues are less indicator.
 i   i are called the singular value of A where i = 1, 2,……………, n.
It is customary to denote the singular values by 1,  2,  3, ............... n and to list them in
decreasing order:
1,   2   3  ...............   n

Singular Value Decomposition:

In linear algebra, the singular value decomposition (SVD) is an important factorization


of a rectangular real or complex matrix, with several applications in signal processing ,
image processing and compression, gene expression analysis and statistics.
Applications which employ the SVD include computing the pseudo-inverse, matrix
approximation, and determining the rank, range and null space of a matrix.

The spectral theorem says that normal matrices, which by definition must be square, can
be unitarily diagonalized using a basis of eigenvectors. The SVD can be seen as a
generalization of the spectral theorem to arbitrary, not necessarily square, matrices .

The singular value decomposition (SVD) is a generalization of the eigen-decomposition,


which can be used to analyze rectangular matrices (the eigen- decomposition is defined
only for squared matrices). By analogy with the eigen-decomposition, which decomposes
a matrix into two simple matrices, the main idea of the SVD is to decompose a
rectangular matrix into three simple matrices: Two orthogonal matrices and one diagonal
matrix.

Matrix A is decomposed using SVD to acquire an orthogonal base in the


multidimensional feature space:

* * * * * * 
* *  * * *  * * *
      * *
* * * * *    

A U S VT

119 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


A  USV T
Here,
A  Given Matrix
U  Matrix of Eigen Vectors of the Matrix AA T
V  Matrix of Eigen Vectors of the Matrix A T A
S  Roots of Eigen Values of the Matrix AA T or A T A
V T  Transpose of the Matrix V

Example 68: Compute Singular Value Decomposition (SVD) for the given matrix
 2  2
 
1 1 
 2  2
Answer: Let, A   
1 1 
In order to find U, Now we need to find the eigenvectors for AA T
 2  2
Given, A   
1 1 
 2 1
 A T   
  2 1
 2  2   2 1
So, AA T     
 1 1    2 1
 4  4 2  2
  
2  2 1  1
 8 0
   --------------------------------(i)
 0 2
Now we need to find the eigenvalues of AA T
 8 0  1 0
AA T   I       
 0 2  0 1
 8 0   0 
     
 0 2  0  
8   0 
  
 0 2   
AA T   I  0
8 0
 0
0 2
 8   2     0
   8  2  0
   8, 2

120 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Therefore eigenvalues are 8 and 2. We construct matrix D by placing eigenvalues along
the main diagonal in decreasing order.
 8 0
D   
 0 2
Therefore, taking the square root of matrix D gives,
 8 0 
The matrix of singular values S  D   

 0 2 
2 2 0 
S    ---------------------------(ii)

 0 2 
Now we need to find the eigenvector of AA T
We have, Au 1   u 1 [ AV   V ]
 x
Let u 1   
y
T
 AA u 1   u 1
 8 0  x   x
    8  [For   8 & from (i) putting the value of AAT ]
 0 2  y  y

 8x   8x 
     
 2y   8y 
 8x  8 x
2 y  8y
 8 x  8x  0
2y  8y  0
 8 x  8x
 6y  0

 8x  8x
y0
y  0
Let x  1
 x    1
 u1       It is a unit vector or normal vector. Since the length of u 1
 y  0 
is u 1  ( 1) 2  (0) 2  1  1

121 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 x
Again, Let u 2   
y
Here,
 AA T u 2  u 2
 8 0  x   x
    2  [For   2 & from (i) putting the value of AAT ]
 0 2  y  y
 8x   2 x 
     
 2y   2y 
 8x  2x
2y  2y
 8x  2x  0
2y  2y

 6x  0
2 y  2y
x0
2y  2y
Let y  1
 x   0
 u2       It is a unit vector or normal vector. Since the length of u 1
 y   1
is u 2  (0) 2  (1) 2  1  1
  1 0
 U  u1 u2     ---------------------------------(iii)
 0 1

Now we need to find the eigenvectors for A T A


 2  2
Given, A   
1 1 
 2 1
 A T   
  2 1
 2 1  2  2 
 A T A    
  2 1  1 1 
 5  3
   -----------------------------------(iv)
  3 5 
Now we need to find the eigenvalues of AT A

122 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 5  3  1 0
 A T A   I       
 3 5   0 1
 5  3   0 
     
 3 5   0 
5    3 
  
  3 5  
 A T A  I  0

5 3
 0
3 5

5   5     9  0
 25  10  2  9  0
 2  10  16  0
   8  2   0
   8, 2
Therefore eigenvalues are 8 and 2. We construct matrix D by placing eigenvalues along
the main diagonal in decreasing order.
 8 0
D   
 0 2
Therefore, taking the square root of matrix D gives,
 8 0 
The matrix of singular values S   
 0 2 
2 2 0 
S    ---------------------------(v)
 0 2 
Now we need find the eigenvectors of AT A which are the columns of V.

We have, Av 1   v 1 [ AV   V ]
 x
Let v 1   
y
 A T Av 1   v 1
 5  3  x   x
       
 3 5  y y
 5  3  x   x
     8  [For   8 & from (iv) putting the value of AT A ]
 3 5  y y

123 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 5  3   x   8x 
      
  3 5   y   8y 
 5 x  3y   8 x 
    
  3 x  5y   8y 
 5x  3 y  8x
 3 x  5 y  8y
 3x  3y  0
 3x  3y  0
 xy  0
xy  0
 xy  0

In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.
Let y = 1 x  1
 x    1
 v 1       ; It is not unit vector or normal vector. Since the length of v 1
 y  1 
is v 1  ( 1) 2  (1) 2  2 ; this vector v 1 has to be converted into unit vector by
dividing its magnitude or its length.
  1
We have, v 1   
 1 
 1
 
 v1   2  [Dividing by its magnitude or its length 2 ]
 1 
 
 2
 2
 
v1   2  [Multiplying by 2 on numerator and denominator]
 2 
 
 2 

Similarly,
We have, Av 2   v 2 [ AV   V ]
 x
Let v 2   
y
T
 A Av 2   v 2

124 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 5  3  x   x
       
 3 5  y y
 5  3  x   x
     2  [For   2 & from (iv) putting the value of AT A ]
 3 5  y y
 5  3   x   2x 
      
  3 5   y   2y 
 5x  3y   2 x 
    
  3x  5 y   2y 
 3x  3y  0
 3x  3y  0

 xy 0
xy  0
 xy 0
In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.
Let y = 1 x  1
 x   1
 v 2       It is not unit vector or normal vector. Since the length of v 2
 y   1
is v 2  (1) 2  (1) 2  2 ; this vector v 2 has to be converted into unit vector by
dividing its magnitude or its length.
We have,
 1
v 2   
 1
 1 
 
Thus, v 2   2  [Dividing by its magnitude or its length 2 ]
 1 
 
 2
 2
 
 v2   2  [Multiplying by 2 on numerator and denominator]
 2
 
 2 
Now we need to construct the augmented orthogonal matrix V,
 2 2 

V  v 1 v2    2 2 
 2 2
 
 2 2 

125 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 2 
 2
V T   2 2  ------------------------------------(vi)
 2 2
 
 2 2 
From (ii), (iii) & (vi), Putting the values of U , S ,V T in the relation A  USV T
Therefore A  USV T
 2 2 

  1 0  2 2 0   2 2  Answer
A    
 0 1  0 2  2 2
 
 2 2 
Justification Test:
A  USV T
 2 2 

  1 0  2 2 0   2 2  [Putting the value of U , V T , S ]
A    
 0 1  0 2  2 2
 
 2 2 
A  USV T
 
  2 2  2  0 2 2  2  0
  1 0  2 2 
A   
 0 1 
 0 2 2 2 
 0 2 
 2 2 
  1 0   2 2 
A    
 0 1  1 1 
  1  ( 2)  0 ( 1)  2  0 
A   
 01 0  1 
 2  2
A    [Given Matrix] Proved
1 1 

Example 69: Compute Singular Value Decomposition (SVD) for the given matrix
 3 1 1
A 
  1 3 1
In order to find U, In order to find U, Now we need to find the eigenvectors for AA T
Given,
 3 1 1
A 
  1 3 1
 3  1
 A  1 3 
T

1 1 
 

126 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 3  1
So, AA  
T 3 1 1 
1 3   11 1  ------------------------------(i)
    
  1 3 1 1 1   1 11
 
Now we need find the eigenvalues of AA T
AA T   I  0
 11 1   1 0
       0
 1 11   0 1
 11 1    0 
      0
 1 11   0  
11   1  0
Therefore, 0
1  0 11  
11   11     1  0
 121  11  11  2  1  0
 2  22  121  1  0
 2  22  120  0
 2  10  12  120  0
   10   12   0
   10,12
Therefore eigenvalues are 10 and 12. We construct matrix D by placing eigenvalues
along the main diagonal in decreasing order.
 12 0 
D   
 0 10 
Therefore, taking the square root of matrix D gives,
 12 0 
The matrix of singular values S  D   
 ---------------------------(ii)
 0 10 
Now we need to find the eigenvector of AA T
We have, Au 1   u 1 [ AV   V ]
 x
Let u 1   
y
 AA T u 1   u 1

 11 1   x   x
       
 1 11   y  y
 11 1   x   x
     12  [For   12 & from (i) putting the value of AAT ]
 1 11   y  y

127 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 11 1   x   12x 
      
 1 11   y   12y 
 11x  y   12x 
    
 x  11y   12y 
 11x  y  12x
x  11y  12y
 x  y  0
xy 0
 xy  0
xy  0
 xy  0

Let y = 1 x  1
 x   1
 u1       It is not unit vector or normal vector. Since the length of u 1
 y   1
is u 1  (1) 2  (1) 2  2 ; this vector u 1 has to be converted into unit vector by
dividing its magnitude or its length.
Since U has an orthonormal basis, u1 needs to be of length one. We divide uby its
magnitude to accomplish this,
 1 
 
Thus,  u 1   2  [Dividing by its magnitude or its length 2 ]
 1 
 
 2
Again,
We have, Au2   u2 [ AV   V ]
 AAT u2   u2
 x
Let u 2   
y
For   10
 11 1  x   x
    10 
 1 11  y  y
 11 1   x   x
     10  [For   10 & from (i) putting the value of AAT ]
 1 11   y  y
 11 1   x   10x 
      
 1 11   y   10y 

128 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 11x  y   10x 
    
 x  11y   10y 
 11x  y  10x
x  11y  10y
 xy  0
xy  0
 xy  0
xy  0
 xy  0
Let y = -1 x  1
 x  1 
 u2       It is not unit vector or normal vector. Since the length of u 2
 y    1
is u 2  (1) 2  ( 1) 2  2 ; this vector u 2 has to be converted into unit vector by
dividing its magnitude or its length.

Since U has an orthonormal basis, u2 needs to be of length one. We divide u2 by its


magnitude to accomplish this,
 1 
 
Thus,  u 2   2  [Dividing by its magnitude or its length 2 ]
 1
 
 2
Since u 2 is already of length one, dividing by the magnitude we get the same vector
back,
Setting up the augmented matrix U
 1 1 
 
U  (u 1 u 2 )   2 2 ------------------------------------(iii)
 1  1
 2 2 
Now we need to find the eigenvectors of A T A which are the columns of V.
Start with the matrix
 3 1 1
A 
  1 3 1
In order to find V, we have to start with A T A the transpose of A is
3  1
A T  1 3
1 1 

129 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 3  1  3 1 1
 A T A  1 3    1 3 1
1 1   
 
3 3  1 3  3 3  1
 
= 3  3 1  9 1  3
 31 1  3 1  1 

 10 0 2 
 
=  0 10 4  -----------------------------------------(iv)
 2 4 2
 
Now we need to find the eigenvalue of A T A
A T A  I  0
 10 0 2   1 0 0
   
 0 10 4     0 1 0   0
 2 4 2  0 0 1
   
 10 0 2    0 0 
   
 0 10 4    0  0   0
 2 4 2  0 0  
   
 10   0 2 
 
Therefore,  0 10   4  0
 2 4 2   

10   0 2
0 10   4 0
2 4 2
10   {10   ( 2   )  16}  2{0  2(10   )}  0
 (10   )( 20  10  2  2  16)  4(10   )  0
 (10   )( 20  10  2  2  16  4)  0
 (10   )(2  12 )  0
  (10   )(  12)  0
   0,10,12
Therefore eigenvalues are 0, 10 and 12. We construct matrix D by placing eigenvalues
along the main diagonal in decreasing order.
 12 0 0 
 
D   0 10 0 
 0 0 0
 
Therefore, taking the square root of matrix D gives,

130 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 12 0 0 

The matrix of singular values S  D   0 10 0  -------------------------------(v)
 
 0 0 0 
Now we need to find the eigenvector of A TA which, are the columns of V.
We have, Av 1   v 1 [ AV   V ]
 AT Av 1  v 1
 x
 
Let v 1   y 
z
 
A T Av 1   v 1
 10 0 2   x   x
    
 0 10 4   y  =12  y  [For   12 & from (iv) putting the value of AT A ]
 2 4 2  z  z
    
 10x  0  2z   12x 
   
 0  10y  4z    12y 
 2x  4y  2z   12z 
   
 10x  2z  12x
10y  4z  12y
2x  4y  2z  12z
 2 x  4 y  2 z  12 z
10 x  2 z  12 x
10 y  4 z  12 y
 2 x  4 y  10 z  0
 2 x  2z  0
 2 y  4z  0
 2 x  4 y  10 z  0
 2 x  0. y  2 z  0
 2 y  4z  0
We have,
L i   a i1 L 1  a 11 L i
i = 2,
L 2   a 21 L 1  a 11 L 2
 -(-2)(2x + 4y-10z)+2(-2x + 0.y + 2z)
 4x + 8y - 20z - 4x + 0 + 4z
 8y -16z

131 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Thus we obtain a new system,
2 x  4 y  10 z  0
8 y  16 z  0
 2 y  4z  0
 2 x  4 y  10 z  0
y  2z  0
y  2z  0
st
Since the 1 and 2nd equations are identical. We can disregard one of them

2x  4y  10z  0
y  2z  0

In echelon form, there are only two equations in three unknowns, then the system has a
non-zero solution and in particular (3-2) =1 free variable, which is z.
Here free variable is z, Let z = 1,  y  2, then 2x  4  2  10  1  0
x1
 x   1
   
 v1   y    2 
 z   1
   
v 1  (1) 2  ( 2) 2  (1) 2  6
Since V has an orthonormal basis, 1 needs to be of length one. We divide by it’s
 1 
 
 6
 2 
magnitude to accomplish this, Thus,  v 1   
 6
 1 
 
 6

Again,
We have, Av 2   v 2 [ AV   V ]
 A Av 2   v 2
T

 x
 
Let v 2   y 
z
 
A T Av 2   v 2

132 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 10 0 2   x   x
    
 0 10 4   y  =10  y  [For   10 & from (iv) putting the value of AT A ]
 2 4 2  z  z
    
 10 x  0  2 z   10 x 
   
 0  10y  4z    10y 
 2x  4y  2z   10z 
   
 10x  2z  10x
10y  4z  10y
2x  4y  2z  10z
 2x  4y  2z  10z
10x  2z  10x
10y  4z  10y

 2 x  4 y  8z  0
2z  0
4z  0
 2 x  4 y  8z  0
2z  0
2z  0
 2 x  4 y  8z  0
2z  0
 2 x  4 y  8z  0
z0

z 0
Then  2x  4y  8  0  0

 2x  4y  0

In echelon form, there are only one equation in two unknowns, then the system has a non-
zero solution and in particular (2-1) =1 free variable, which is y.

Here free variable is y, Let y = -1, then x = 2


 x  2 
   
 v 2   y     1
z  0 
   
v 2  ( 2) 2  ( 1) 2  (0) 2  5

133 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


Since V has an orthonormal basis,  needs to be of length one. We divide by it’s
 2 
 
 5
 1
magnitude to accomplish this, Thus,  v 2   
 5
 0 
 
 
Again,
We have, Av 3   v 3 [ AV   V ]
We have, A T Av 3   v 3
 x
 
Let v 3   y 
z
 
A T Av 3   v 3
 10 0 2   x   x 
    
 0 10 4   y  =0  y  [For   0 & from (iv) putting the value of AT A ]
 2 4 2  z   z 
    
 10x  0  2z   0x 
   
 0  10y  4z    0y 
 2 x  4 y  2z   0 z 
   
 10x  2z  0
10y  4z  0
2x  4y  2 z  0
 2x  4 y  2z  0
10x  2z  0
10y  4z  0
 2x  4y  2z  0
10x  0.y  2z  0
10y  4z  0

L i   a i1 L 1  a 11 L i
i = 2,
L 2   a 21 L 1  a 11 L 2
 -10(2x + 4y+2z)+2(10x + 0.y + 2z)
 -20x - 40y - 20z +20x + 0 + 4z
 -40y -16z
Thus we obtain the following system:

134 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 2 x  4 y  2z  0
 40 y  16 z  0
10 y  4 z  0
 2 x  4 y  2z  0
10 y  4 z  0
10 y  4 z  0
 2x  4y  2z  0
10y  4z  0

In echelon form, there are only two equations in three unknowns, then the system has a
non-zero solution and in particular (3-2) =1 free variable, which is z

Here free variable is z, Let z = -5, then y = 2, then x =1


 x  1 
   
 v3   y    2 
 z    5
   
v 3  (1) 2  ( 2) 2  ( 5) 2  30

Since V has an orthonormal basis,  needs to be of length one. We divide by it’s
 1 
 
 30 
 2 
magnitude to accomplish this, Thus,  v 3   
 30 
 5 
 
 30 
Now we need to construct the augmented orthogonal matrix V,
V  (v1 v2 v3 )
All this to give us
 1 2 1 
 
 6 5 30 
2 1 2 
V
 6 5 30 
 1 5 
 0 
 6 30 
when we really want its transpose

135 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 1 2 1 
 
 6 6 6 
2 1
V 
T
0 
 5 5 
 1 2 5 
 
 30 30 30 

For S we take the square roots of the non-zero eigenvalues and populate the diagonal
with them, putting the largest in s11, the next largest in s22 and so on until the smallest
value ends up in smn. The non-zero eigenvalues of U and V are always the same, so that’s
why it doesn’t matter which one we take them from. Because we are doing full SVD,
instead of reduced SVD (next section), we have to add a zero column vector to S so that
it is of the proper dimensions to allow multiplication between U and V. The diagonal
entries in S are the singular values of A, the columns in U are called left singular vectors,
and the columns in V are called right singular vectors.
 12 0 0
 
S 0 10 0
 0 0 0

 12 0 0 
S  [Ignoring third row of the matrix as all elements are zero in the
 0 10 0
last row]

Now we have all the pieces of the puzzle


A  USV T

Putting the value of U , V T , S in A  USV T


A  USV T
 1 2 1 
 1 1   6 6 6 
 
  2 2   12 0 0  2 1
0 
 1  1 0 
10 0   5 5 

 2 2   1 2 5 
 
 30 30 30 
 1 2 1 
 12 10   
 0  6 6 6 
2 1
 2 2  0 
 12  10  5 5 
 0  1 2  5 
 2 2  
 30 30 30 

136 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 3 1 1
  [Proved]
  1 3 1
.

Home Task:
Find the singular value decomposition of the matrix
1 1
i. A  0 1 ii. A  2 1  2
1 0
2 4
1 3
iii. A  
0 0
 
0 0
Hints:
0.82  0.58 0 0
0.58 0.82 0 0
U 
 0 0 1 0
 
 0 0 0 1
0.40  0.91
V  
 0.91 0.40 

5.47 0 
 0 0.37 
S 
 0 0 
 
 0 0 

Singular Value Decomposition:

The Singular Value Decomposition is an important factorization of a real or complex


matrix, with several applications in signal processing and statistics. Applications, which
employ the SVD, include computing the pseudo-inverse, matrix approximation, and
determining the rank, range and null space of a matrix.

The spectral theorem says that normal matrices, which by definition must be square, can
be unitarily diagonalized using a basis of Eigen vectors. The SVD can be seen as a
generalization of the spectral theorem to arbitrary, not necessarily square, matrices.
Algorithm of Singular Value Decomposition:
To find the Singular Value Decomposition of the matrix:

137 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


1. Find the eigenvalues of the matrix A T A and arrange them in descending
order
2. Find the number of nonzero eigenvalues of the matrix A T A
3. Find the orthogonal eigenvectors of the matrix A T A corresponding to the
obtained eigenvalues, and arrange them in the same order to form the
column-vectors of the matrix V
4. Form a diagonal matrix S     placing on the leading diagonal of it
the square roots  i   i of p  min{m , n} first eigenvalues of the
matrix A T A got in I in descending order
1
5. Find the first column-vectors of the matrix U, u i   i Av i (i  1 : r )
6. Add to the matrix U the rest of m-r vectors using the Gram-Schmidt
Orthogonalization process
Image Processing with SVD
We want to approximate the m  n matrix A by using far fewer entries than in the
original matrix.
T
A  USV T  SUV
 A  1u1 v1T   2u 2 v 2T  .......................  r ur vr T  0.ur 1 vr 1T  .........
Since the singular values are always greater than zero. Adding on the dependent terms
where the singular values are equal to zero does not effect the image. The terms at the
end of the equation zero out leaving us with:
 A  1u1 v1T   2u 2 v 2T  .......................  r ur vr T
Conclusion: We can further approximate the matrix (original image) by leaving off more
singular terms of the matrix A. Since the singular values are arranged in descending
order, the last terms will have the least effect on the overall image.
Doing this (leaving more singular values) reduces the amount of space required to store
the image on a computer.
Justification using above example:
 2  2
The original image is: A   
1 1 
2 2 0 
S    i .e. 1  2 2 ,  2  2
 0 2 
  1 0
U = (u1 u2) =  
 0 1 
 2 2 

V = (v1 v2)   2 2 
 2 2
 
 2 2 

138 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 A  1u1 v1T   2u 2 v 2T
  1   2 2   0  2 2 
 2 2    2  
 0  2 2  
 1  2 2 
 2 2   2 2   0  2 2 
    
 

 2   2  2 2 
 0  2
 2  2  0 0
=     
 0 0   1 1
 2  2
=   = A (Original Image can be obtained)
1 1 
We can get approximate image by using less singular values. Say number of singular
values are 10 i.e. 1 ,  2 ,........................10.
Then,
 A  1u1 v1T   2u 2 v 2T  .......................  10u10 v10T
If we use 5 singular values then

 A  1u1 v1T   2u 2 v 2T  .......................  5u 5 v 5T

In this result we can get apprximate image of the original image (A)

Since large eigenvalues carry significant representation of the matrix, we arrange


the values of the Eigen Values from the largest to the smallest and drop/ignore the
values towards the last since small eigenvalues are less indicator.

What is the use of SVD?

01. SVD can be used to compute optimal low-rank approximations of arbitrary


matrices.
02. Face recognition: represent the face images as eigenfaces and compute distance
between the query face image in the principal component space.

B. LU Decomposition

A procedure for decomposing a N  N matrix A into a product of a lower triangular


matrix L and an upper triangular matrix U,

A  LU
 a 11 a 12 a 13   l 11 0 0   1 u 12 u 13 
    
 a 21 a 22 a 23    l 21 l 22 0  0 l u 23 
a a 32 a 33   l 31 l 32 l 33   0 0 1 
 31

139 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


LU decomposition is implemented in Mathematica as LU Decomposition[m].

Example 70
Solve the linear system of equations using LU decomposition

u1  2u2  3u3  5
2u1  4u2  6u3  18
3u1  9u2  3u3  6

Solution:
Given the linear system of equations
u1  2u2  3u 3  5
2u1  4u2  6u3  18
3u1  9u2  3u3  6

This can be written as


Au  b ------------------------------(i)
Where,

1 2 3   u1  5
     
A  2  4 6  u   u 2  , b   18 
 3  9  3 u  6
   3  
Again, According to LU decomposition,
A  LU ------------------------------(ii)
Where,
 l 11 0 0   1 u 12 u 13 
   
L   l 21 l 22 0  and U  0 l u 23 
l l 32 l 33  0 0 1 
 31 
From (ii), A  LU
 LU  A

 l 11 0 0   1 u 12 u 13   1 2 3 
     
 l 21 l 22 0  0 l u 23    2  4 6 
l l 32 l 33  0 0 1   3  9  3 
 31 

140 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 l11  0  0 l11u12  0  0 l11u13  0  0  1 2 3 
   
 l 21  0  0 l 21u12  l 22  0 l 21u13  l 22u 23  0   2  4 6 
l  0 0 l u  l  0 l u  l u  l   3  9  3
 31 31 12 32 31 13 32 23 33   
Now,
We can write
l11  1 -------------------------------------(iii)
l11u12  2 -------------------------------------(iv)
l11u13  3 -------------------------------------(v)

l 21  2 -------------------------------------(vi)
l 21u12  l 22  4 -------------------------------------(vii)
l 21u13  l 22u 23  6 -------------------------------------(viii)

l 31  3 -------------------------------------(ix)

l 31u12  l 32  9 -------------------------------------(x)

l 31u13  l 32u 23  l 33  3 -------------------------------------(xi)


From (iii) & (iv)
l11  1
l11u12  2
1. u12  2
u12  2 -------------------------------------(xii)
From (iii) & (v)
l11u13  3

1. u13  3

u13  3 -------------------------------------(xiii)
From (vii),
l 21u12  l 22  4
2.2  l 22  4 [ u12  2 ; l 21  2 ]
4  l 22  4
 l 22  8 -------------------------------------(xiv)

141 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


From (viii),
l 21u13  l 22u 23  6

2.3  8u 23  6 [ l 21  2 ; u13  3 ; l 22  8 ]

 8u 23  6  6

u 23  0 -------------------------------------(xv)
From (x),
l 31u12  l 32  9

3. 2  l 32  9 [ l 31  3 ; u12  2 ]

l 32  9  6

l 32  15 -------------------------------------(xvi)
From (xi)
l 31u13  l 32u 23  l 33  3

3. 3  15.0  l 33  3 [ l 31  3 ; u13  3 ; l 32  15 ; u 23  0 ]

l 33  3  9

l 33  12 -------------------------------------(xvii)

 l11 0 0
 
 L   l 21 l 22 0
l l 32 l 33 
 31

1 0 0 
 
 L  2  8 0 
 3  15  12 
 

And
 1 u 12 u 13 
 
U  0 l u 23 
0 0 1 

 1 2 3
 
U   0 l 0
0 0 1
 

142 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


From (i),
Au  b
LUu  b [from (ii), A = LU]
LUu  b -------------------------------------(xviii)
Let,
Uu  v -------------------------------------(xix)
Where,
 v1 
 
Where, v   v 2 
v 
 3
From (xviii),
LUu  b
Lv  b
1 0 0   v1   5 
    
 2  8 0   v 2    18 
 3  15  12   v   6 
   3  
 1  v1  0  v 2  0  v 3   5 
   
  2  v1  8  v 2  0  v 3    18 
 3  v  15  v  12  v   6 
 1 2 3  
 v1  5
   
 2 v1  8 v 2    18 
 3 v  15 v  12 v   6 
 1 2 3  

v1  5 -------------------------------------(xx)
2 v1  8 v 2  18 -------------------------------------(xxi)
3 v1  15 v 2  12 v 3  6 -------------------------------------(xxii)

From (xxi),
2 v1  8 v 2  18
2.5  8 v 2  18 [ v1  5 ]
10  8 v 2  18
 8 v 2  18  10

143 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


 8v 2  8
 v 2  1 -------------------------------------(xxiii)
From (xxii),
3 v1  15 v 2  12 v 3  6

3.5  15( 1)  12 v 3  6 [ v 1  5 ; v 2  1 ]

15  15  12 v 3  6

30  12 v 3  6

 12 v 3  6  30

 12 v 3  24

 v3  2 -------------------------------------(xxiv)
From (xix),
Uu  v
 1 2 3   u1   v 1 
    
 0 l 0   u2    v 2 
 0 0 1 u   v 
   3  3

 1 2 3   u1   5 
    
 0 l 0   u2     1
 0 0 1 u   2 
   3  

 1  u1  2  u 2  3  u 3   5 
   
  0  u1  1  u 2  0  u 3     1 
 0  u  0  u  1 u   2 
 1 2 3  

 u1  2u 2  3u 3   5 
   
 u2     1
 u3   2 
   
u1  2u 2  3u 3  5 -------------------------------------(xxv)

u 2  1 -------------------------------------(xxvi)
u3  2 -------------------------------------(xxvii)
From (xxv),

144 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC


u1  2u 2  3u 3  5

u1  2( 1)  3.2  5
u1  2  6  5
u1  5  4
u1  1

u1  1 , u 2  1 , u 3  2 Answer
Example 71: Given the following system of linear equations, determine the value of each
of the variables using the LU decomposition method.
6x1 - 2x2 = 14
9x1 - x2 + x3= 21
3x1 - 7x2 + 5x3= 9

145 Prof. Dr. A.N.M. Rezaul Karim/CSE/IIUC

You might also like