Chapter - 4 Matrices
Chapter - 4 Matrices
.......
an ,1 an ,2 ....... an ,m
2
The Identity Matrix Of Order n: In
1 0 0 0
0 1 0 0
I4
0 0 1 0
0 0 0 1
Unit Vector Lower Triangula Matrix
1 0 0 1 0 0
0 , 1 or 0 L 4 6 0
0 0 1 2 1 4
Transpose Of A
3 1 4 3 0 1
A 0 2 3 AT 1 2 1
1 1 2 4 3 2
4
The Determinant Of Square Matrix
5 3
A Det ( A) (5).(2) (3).(7)
7 2
5
Ex: Calculate determinant of given matrix.
3 0 1 2
4
1 3 2
A
0 2 1 3
1 0 1 4
1 3 2 4 3 2
Det ( A) (1)11 (3) 2 1 3 ( 1)1 2 (0) 0 1 3
0 1 4 1 1 4
4 1 2 4 1 3
(1)13 (1) 0 2 3 ( 1)1 4 (2) 0 2 1
1 1 4 1 0 1
6
Ex: Calculate determinant of given matrix. 3 0 1 2
4 1 3 2
A
0 2 1 3
1 0 1 4
11 1 3 1 2 2 3 1 3 2 1
Det ( A) 3 (1) (1) (1) (3) (1) (2)
1 4 0 4 0 1
11 2 3 1 2 0 3 1 3 0 2
1 (1) (4) (1) (1) (1) ( 2)
1 4 1 4 1 0
11 2 1 1 2 0 1 1 3 0 2
2 (1) (4) (1) (1) (1) (3)
0 1 1 1 1 0
=-146 7
Calculate determinant of given matrix.
2 1 3 0 2 1 3
4 2 7 0
A Det ( A) (1)3 4 (5) 4 2 7
3 4 1 5
6 6 8
6 6 8 0
11 2 7 1 2 4 7 1 3 4 2
5 (1) (2) (1) (1) (1) (3)
6 8 6 8 6 6
8
Summation Of Two Matrices
C=A+B
9
Multiplication of Two Matrices
m
cij aik bkj
k 0
10
a1,1 a1,m b1,1 b1,r
A(n, m) xB(m, r )
a an,m bm,1 bm,r
n,1
1 3 5 2 1 6 1 2 3 3 5 3 11 3 2 5 7 1 6 3 4 5 1 26 42 23
2 4 5 3 2 4 2 2 4 3 5 3 2 1 4 2 5 7 2 6 4 4 5 1 31 49 33
2 3 6 3 7 1 2 2 3 3 6 3 2 1 3 2 6 7 2 6 3 4 6 1 31 50 30
11
Consider Sets of Linear Equations
a1,1 x1 a1,2 x2 a1, n xn b1
a2,1 x1 a2,2 x2 a2, n xn b2
an ,1 x1 an ,2 x2 an , n xn bn
12
Methods of Solution of System of
Linear Equations
• There are two classes of methods for solving
system of linear, algebraic equations:
• 1) direct methods
• 2) iterative methods.
• direct methods are that they transform the
original equation into equivalent equations
(equations that have the same solution) that
can be solved more easily.
13
• Iterative or indirect methods, start with a
guess of the solution x, and then repeatedly
refine the solution until a certain convergence
criterion is reached.
• Direct Methods:
– Gauss Elimination Method
– Gauss-Jordan Method
– Matrix Inverse Method
– Crout’s Method
14
• Indirect or Iterative Methods:
– Jacobi’s Iteration Method
– Gauss-Seidal Iteration Method
– SOR Method
15
Gauss Method:
Ex: Solve the given sets of equations by applying Gauss Method.
4 x1 2 x2 x3 15 4 2 1 x1 15
3 x1 x2 4 x3 8 3 1 4 x
2 8
1 1 3 x 13
x1 x2 3 x3 13 3
Augmented Matrix
1) We may multiply any row of
4 2 1
augmented matrix by a constant.
15
2) We can add one row to a multiple of
3 1 4 8 any other row.
1 1 3 13
3) We can interchange the order of two
rows.
16
Augmented Matrix
4 2 1 15 4 2 1 15
3 1 4 8 3R1 4 R2 0 10 19 77
1 1 3
13 R1 4 R3 0 2 11 37
4 2 1 15
0 10 19 77
2 R2 10 R3 0 0 72 216
72 x3 216 x3 3
10 x2 19 x3 77 x2 2
4 x1 2 x2 x3 15 x1 2
17
Ex:
Solve the given sets of equations by applying Gauss method with pivoting
2 x2 x4 0
2 x1 2 x2 3 x3 2 x4 2
0 2 0 1 0
4 x1 3 x2 x4 7 2 2 3 2 2
6 x1 x2 6 x3 5 x4 6 4 3 0 1 7
6 1 6 5 6
6 1 6 5 6
2 2 3 2 2
4 3 0 1 7
0 2 0 1 0
18
Ex:
Solve the given sets of equations by applying Gauss method with pivoting
6 1 6 5 6
(1/ 3) R1 R2 0 1.6667 5 3.667 4
(4 / 6) R1 R3 0 3.6667 0 4.333 11
0 2 0 1 0
6 1 6 5 6
0 3.6667 4 4.3333 11
( R2 1.6667) / 3.6667 R3 0 0 6.8182 5.6364 9.0001
( R2 2) / 3.6667 R4 0 0 2.1818 3.3638 5.9999
20
6 1 6 5 6
0 3.6667 4 4.3333 11
0 0 6.8182 5.6364 9.0001
0 0 2.1818 3.3638 5.9999
6 1 6 5 6
0 3.6667 4 4.3333 11
0 0 6.9182 5.6362 9.001
( R3 2.1818) / 6.8182 R4 0 0 0 1.56 3.1199
21
• Gauss-Jordan method is an extension of the
Gauss elimination method. The set of
equations Ax = b is reduced to a diagonal set
Ix = b', where I is a unit matrix. This is
equivalent to x = b'. The solution vector is
therefore obtained directly from b'.
22
GAUSS-JORDAN METHOD 3x1 0.1x2 0.2 x3 7.85
Ex: Use the Gauss-Jordan to solve
0.1x1 7 x2 0.3x3 19.3
0.3x1 0.2 x2 10 x3 71.4
24
1 0.0333 0.0666 2.61667
R2
R2 0 1 0.0418843 2.7932
7.00333
0 0.19 10.02 70.616
25
1 0 0.0680 2.5236
0 1 0.0418 2.7932
R3 R3 /10.012 0 0 1 7.0003
R1 0.0680 R3 R1 1 0 0 3
R2 0.0418R3 R2 0 1 0 2.50001
0 0 1 7.00003
then x1 3; x2 -2,50001; x3 7, 00003
26
• MATRIX INVERSION METHOD
• The requirements for obtaining a unique inverse
of a matrix are:
• 1. The matrix is a square matrix
• 2. The determinant of the matrix is not zero (the
matrix is non-singular)
• The inverse of a matrix is also defined by the
relationship:
•
• Linear set of equations can be expressed in the
matrix form Ax=b
• Premultiplying by the inverse we obtain the
solution of x as
27
MATRIX INVERSION METHOD
Ax b
A1 Ax A1b
A / I I / A 1
x A1b
Example: Find numerical solution of the system of linear equations by
applying matrix inversion method.
2x y 7
x 2 y z 1
y 2z 1
2 1 0 x 7 2 1 0 1 0 0
1 2 1 y 1 1 2 1 0 1 0
0 1 2 z 1 0 1 2 0 0 1
28
R1 R2 1 2 1 0 1 0
2 1 0 1 0 0
0 1 2 0 0 1
R1 R1 1 2 1 0 1 0
2 1 0 1 0 0
0 1 2 0 0 1
1 2 1 0 1 0
R2 2 R1 R2 0 3 2 1 2 0
0 1 2 0 0 1
29
1 2 1 0 1 0
R2 R3 0 1 2 0 0 1
0 3 2 1 2 0
1 2 1 0 1 0
0 1 2 0 0 1
R3 3R2 R3 0 0 4 1 2 3
1 2 1 0 1 0
0 1 2 0 0 1
R3 R3 / 4 0 0 1 0.25 0.5 0.75
30
R1 R3 R1 1 2 0 0.25 1.5 0.75
R2 2 R3 R2 0 1 0 0.5 0 0.5
0 0 1 0.25 0.5 0.75
31
0.75 0.5 0.25
1 Ax b
A 0.5 1 0.5 1 1
0.25 0.5 0.75 A Ax A b
x A1b
32
• L-U DECOMPOSITION METHOD
• This method is based on the fact that every
square matrix A can be expressed as the
product of a lower triangular matrix and an
upper triangular matrix.
• We factorise the given matrix as A = LU, where
L is a lower triangular matrix and U is an upper
triangular matrix with unit diagonal elements.
33
L-U DECOMPOSITION METHOD
Ax=b; A=LxU
Ax b
LUx b; Let Ux t Lt b
35
Ex: Consider the matrix A find lower triangular
(L) and upper triangular (U) matrices.
3 1 2
A 1 2 3
2 2 1
l11 0 0 1 u12 u13 3 1 2
l21 l22 0 0 1 u23 1 2 3
l l32 l33 0 0 1 2 2 1
31
36
• In the following calculations:
(1r ,1c) l11 1 3 l11 3
37
(1r ,1c) l11 1 3 l11 3
1
(1r , 2c) l11 u12 1 u13
3
2
(1r ,3c) l11 u13 2 u13
3
3 0 0 1 1/ 3 2 / 3
L 1 7 / 3 0 U 0 1 1
2 4 / 3 1 0
0 1
39
Ex: Find the solution of the systems of equations
by using L-U decomposition method.
3x y 4 z 6; y z 2; 2x y z 3
3 1 4 x 6
0 1 1 y 2
2 1 1 3
z
l11 0 0 1 u12 u13 3 1 4
l
21 l22 0 0 1 u23 0 1 1
l l32 l33 2 1 1
31 0 0 1
40
(1r ,1c) l11 1 3 l11 3
1
(1r , 2c) l11 u12 1 u13
3
4
(1r ,3c) l11 u13 4 u13
3
41
(3r ,1c) l31 1 2 l31 2
(3r , 2c) l31 u12 l32 1 1
1
2 (1/ 3) l32 1 l32
3
(3r ,3c) l31 u13 l32 u23 l33 1 1
2 (4 / 3) (1/ 3) (1) l33 1 l33 4
42
3 0 0 1 1/ 3 4 / 3
AX b L 0 1 0 U 0 1 1
2 1/ 3 4 0 0
1
Ax b
LUx b; Let Ux t Lt b
Ux t
1 0.3333 1.3333 x 2
0 1 1 y 2
0 z 0.4167
0 1
z 0.4167, y 1.3833, x 0.9167
44
ILL CONDITONED MATRICES
• When there are many equations, the effects of
round-off (the term is applied to the error due to
chopping as well as when rounding is used) may
cause large effects. In certain cases, the
coefficients are such that the results are
particularly sensitive to round off, such systems
are called ill-conditioned.
• When a system is ill-conditioned, the solution is
very sensitive to changes in the right-hand vector.
It is also sensitive to small changes in the
coefficients.
45
ILL CONDITONED MATRICES
det( A)
if 1, then the matriceis ill conditioned matrice
n n
ij
a 2
i 1 j 1
Ax R
Ax ' R '
A( x x ') R R '
x x' E
R R' r
then, A E r
E=A 1 r
x x ' =E
x E x'
46
Example: Examine if the following linear equation system is ill
conditioned. If it is, solve it to overcome the ill conditioning.
det( A)
if 1, then the matrice is ill conditioned matrice
n n
ij
a 2
i 1 j 1
47
The system of equations is ill conditioned.
If we write a2,2=1.343 instead of a2,2=1.344.
49