Matrix Lecture Sheet 2
Matrix Lecture Sheet 2
Matrix Lecture Sheet 2
com/slide/2804957/
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 22 22 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
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
xyz 0
4 y 2z 0
2y z 0
xyz 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
xyz 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
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
xyz 0
xyz 0
xyz 0
Since the 1st, 2nd and 3rd equations are identical. We can disregard two of them
xyz 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.
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
xyz 0 [Dividing by 3 on both sides]
xyz 0 [Dividing by 3 on both sides]
xyz 0 [Dividing by 6 on both sides]
xyz 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
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
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,
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
xy 0
xy 0
Since the 1stand 2nd equations are identical. We can disregard one of them
xy 0
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
xy 0
xy 0
xy 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
1 3 3 5 5
D P 1 AP
2 3 3 5 5
1 6 0
D P 1 AP
2 0 10
3 132 51 63 0
3 132 51 63 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
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
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
00
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
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
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
2x y 2 z 0
y0
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 22 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
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
Thus, a square matrix A has an inverse if and only if A can be transformed into an
identity matrix with elementary row operations.
( 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
1 1 2 x 1 3
2 5 3 x 11
2
1 3 1 x 3 5
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.
[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
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)
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
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
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
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
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)
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
.
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 OPQR 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
(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
(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
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
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 nn matrix is diagonalizable if and only if the matrix possesses n linearly
independent eigenvectors
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
Nodes contain data and/or links to other nodes. Links between nodes are often
implemented by pointers or references.
Struct node { 5 7 3
int value;
struct node *next;
}
Figure no 37
Directed Graph:
A graph G = (V, E)
V: vertices
E: edges, ordered pairs of vertices from VV
F(u,v) is different from (v,u)
Figure no 38
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
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
o LU decomposition
o Cholesky decomposition
o QR decomposition
3 0
D
0 5
x
Let a non-zero vector v =
y
We have, Av v
4 1 x x
1 4 y y
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
xy 0
xy 0
xy 0
xy 0
xy 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
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
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 .
* * * * * *
* * * * * * * *
* *
* * * * *
A U S VT
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
8x 8x
2y 8y
8x 8 x
2 y 8y
8 x 8x 0
2y 8y 0
8 x 8x
6y 0
8x 8x
y0
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
6x 0
2 y 2y
x0
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
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
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
xy 0
xy 0
xy 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
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
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
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 uby 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
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
x1
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
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
z0
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.
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:
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
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
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]
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
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:
In this result we can get apprximate image of the original image (A)
B. LU Decomposition
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
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
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
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)
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)
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
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
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
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),
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