0% found this document useful (0 votes)
287 views32 pages

Introduction to Matrix Inversion Techniques

The document introduces concepts of linear algebra including inverse matrices. It provides examples of finding the inverse of matrices using partitioning methods. Key steps include partitioning a matrix into submatrices A, B, C, and D and calculating the inverse based on the inverses of A, D and expressions involving A, B, C, and D. Special cases for different matrix structures are also discussed.

Uploaded by

Ahmed Alaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
287 views32 pages

Introduction to Matrix Inversion Techniques

The document introduces concepts of linear algebra including inverse matrices. It provides examples of finding the inverse of matrices using partitioning methods. Key steps include partitioning a matrix into submatrices A, B, C, and D and calculating the inverse based on the inverses of A, D and expressions involving A, B, C, and D. Special cases for different matrix structures are also discussed.

Uploaded by

Ahmed Alaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

‫الباب الثالث‬

Chapter (3)
‫مقذمة في الجبر الخطي‬
Introduction to Linear
Algebra
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

3.1 Inverse of Matrix ‫معكوس المصفوفة‬


1
The inverse E of square matrix E n*n may shown in the following relations.

E 1 E n*n = E n*n E 1 = I n

Where, I n is a unit matrix of dimension n . For instant,

If E 1 does not exist the matrix E n*n is called singular or non-invertible.


2 1  2  1
For instant, E2*2    and E 1   
3 2  3 2 
2 1   2  1 1 0
E n*n E 1 =     I2
3 2  3 2  0 1

3.1.1 Inverse Matrix Using Partitioning ‫معكوس المصفوفة بالتجزئ‬

If a matrix is partitioned into four matrices, it can be inverted


blockwise as follows:

where A, B, C and D are matrices arbitrary size, but A and D must be square.
Furthermore, A and D − CA−1B must be invertible.
In other form,

Here, D and A − BD−1C must be invertible.


There is special cases in the following forms:
-1
A O  A -1 O 
1-   
O D  O D 1 
-1
A B  A -1 - A -1B D-1 
2-   
O D O D 1 
-1
A O  A -1 O 
3-    -1 -1 -1 
C D  - D C A D 1 

82
Chapter 3 Introduction to Linear Algebra

a a 
Note. Inverse of 2-dimensional square matrix A 22   11 12  may be
a21 a22 

obtained, simply, as
a11 a12
A 22   a11a22  a12 a21
a21 a22
,
 a22  a12   a22  a12 
 a a11   a21 a11 
1
A   21

a11 a12 a11a22  a12 a21
a21 a22 .
 a22  a12  3  2
 a a11  1 1 
 1 2 1  21
For instant, if A    , then, A   ,
  1 3 a11 a12 1 2
a21 a22 1 3

1 3  2 0.6  0.4
A 1  
5 1 1  0.2 0.2 
.
 1 2 0.6  0.4 1 0
In other, words, A A 1      .
 1 3 0.2 0.2  0 1

Example
Find the inverse of the following matrices using partitioning method:
1 2 0
0 1 2 74
 1 3 0 0   1 3 2 6 
i) E   ii) F  
0 0 3 2 0 0 3 2
   
0 0 7/2  1 0 0 7/2  1

1 2 00
2 4 0   1 0 
iii) G  0 3 2 
3 0
iv) H  
4 7 3 2
0 1 0   
2 6 7/2  1

Solution

83
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

 1 2  3 2
where, A    and D   
  1 3 7/2  1

1 3  2 1   1  2
Then, A 1  and D 1 
5 1 1   10  7/2 3 

0.6  0.4 0 0 
0.2 0.2 0 0 
E 1   
0 0 0.1 0.2 
 
0 0 0.35  0.3

See the following MATLAB code


>>format bank % for two decimal places ‫ٍ فقػ‬ٛٚ‫ٍ ػشش‬ًٛ‫إلظٓاس سق‬
E(1:2,1:2)=[1 2;-1 3];E(3:4,3:4)=[3 2;7/2 -1] % ‫ح‬ٚ‫ش انصفش‬ٛ‫ادخال انؼُاصش غ‬
E=
1.00 2.00 0 0
-1.00 3.00 0 0
0 0 3.00 2.00
0 0 3.50 -1.00
>> E_inv=inv(E) % ‫أيش دغاب انًؼكٕط‬
E_inv =
0.60 -0.40 0 0
0.20 0.20 0 0
0 0 0.10 0.20
0 0 0.35 -0.30

1 2 47
 1 3 2 6  A B
-1
 A -1 - A -1 B D -1 
ii) F     
0 0 3 2 O D O D 1  , where,
 
0 0 7/2  1

 1 2 4 7  3 2
A  ,B    D
7/2  1
.
  1 3 2 6
and 

1 3  2 1   1  2
A 1  D 1 
5 1 1   10  7/2 3 
.
Then, and

84
Chapter 3 Introduction to Linear Algebra

 1 3  2  4 7 1  1  2   79/100 11/50 
- A -1B D-1 = 
5 1 1  2 6  10  7/2 3   103/100
  27/50 
*

0.6  0.4  0.79 0.22 


- A B D  0.2 0.2  1.03 0.54 
-1
A B A -1 -1 -1

F 1    
D
.
O O D 1  0 0 0.1 0.2 
 
0 0 0.35  0.3

See the following MATLAB code


>> format rat % for rational form ‫ح‬ٛ‫إلظٓاس أػذاد َغث‬
>> F(1:2,1:2)=[1 2;-1 3];F(1:2,3:4)=[4 7;2 6];F(3:4,3:4)=[3 2;7/2 -1]
F=
1 2 4 7
-1 3 2 6
0 0 3 2
0 0 7/2 -1
>> F_inv=inv(F)
F_inv =
3/5 -2/5 -79/100 11/50
1/5 1/5 -103/100 27/50
0 0 1/10 1/5
0 0 7/20 -3/10
>> format short % for four decimal places ‫ح فقػ‬ٚ‫إلظٓاس أستؼح أسقاو ػشش‬
>> F_inv=inv(F)
F_inv =
0.6000 -0.4000 -0.7900 0.2200
0.2000 0.2000 -1.0300 0.5400
0 0 0.1000 0.2000
0 0 0.3500 -0.3000

85
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

2 4 0  -1
A B  A -1 - A -1 B D -1 
iii) G  0 3 2     
O D O D 1 .
0 1 0 

where,
3 2
A  2, B  4 0 and D  
1 0
.
1 1  0  2
Then, A 1  and D 1 
2  2  1 3 

1 1  0  2
4 0 *  0 - 2
 2  1 3 
- A -1B D-1 =
2

-1 0.5 0 2 
A B  A -1 - A -1B D -1  
1 
1
G    0
D
0
O O D 1   0
 0.5  1.5  .

See the following MATLAB code


>> format bank
>> G=[2 4 0;0 3 2;0 1 0]
G=
2.00 4.00 0
0 3.00 2.00
0 1.00 0
>> G_inv=inv(G)
G_inv =
0.50 0 -2.00
0 0 1.00
0 0.50 -1.50

Notes
i) The inverse of a diagonal matrix is diagonal.
ii) The inverse of an upper triangular matrix is upper triangular.

86
Chapter 3 Introduction to Linear Algebra

3.1.2 Inverse Matrix Using Using Pivoting ‫معكوس المصفوفة باستخذام التمركز‬

 Reduced Row Echelon Form ‫طريقة الصف المختصر‬


‫اخ‬ٛ‫جشٖ رنك تاعرخذاو ػًه‬ٚ ٔ .ٗ‫ا أٔ عفه‬ٛ‫ح ػه‬ٛ‫م انًصفٕفح انًشتؼح إنٗ يصهص‬ٕٚ‫قح ذذ‬ٚ‫ انطش‬ٙ‫رى ف‬ٚ
.‫ح ػهٗ انصفٕف‬ٛ‫أعاع‬
Transforms the square matrix E to an upper triangular matrix is one of Row
echelon form. The method uses operations on rows of the matrix to make
leading entries (first nonzero entry encountered in a row starting from the left)
must move to the right as you go down the rows.
Note. All entries below leading entries are zero and any all-zero rows are at
the bottom. Thus the following transformation occurs.
u11 u12 u13 ..... u1n 
0 u 22 u 23 ..... u 2 n 
EU
      
 
0 0 0 ..... u nn 

Any matrix can be put into row echelon form via a sequence of elementary
row operations (called elimination or Gaussian elimination).

.‫قٓا ػهٗ انًصفٕفح‬ٛ‫ُُصخ ترطث‬ٚ ٙ‫ح ػهٗ انصفٕف ٔ انر‬ٛ‫اخ األعاع‬ٛ‫ انؼًه‬ٙ‫ه‬ٚ ‫ًا‬ٛ‫َغشد ف‬
 The following Elementary row operations should be applied on the
matrix:
1- Interchange two rows ٍٛ‫م صف‬ٚ‫ذثذ‬
2- Multiply a row by a nonzero constant ٘‫ش صفش‬ٛ‫ شاتد غ‬ٙ‫ظشب صف ف‬
3- Add/Subtract a multiple of one row from a multiple of another.
.‫جًغ أٔ غشح صف يعشٔب إنٗ أٔ يٍ صف آخش يعشٔب‬
Example
1 2 1 
A   3 2 1 
 4  4 1 

Step 1: .ً‫ أصفاسا‬ٙ‫غ‬ٛ‫انًطهٕب أٔالً جؼم انؼُاصش ذذد انقطش انشئ‬


We want to get a matrix that has all zeros under the diagonal.

87
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

‫ يٍ انصف انصانس ٔ رنك تعشب ػُاصش‬4 ‫ ٔ َذزف‬َٙ‫ يٍ انصف انصا‬3- ‫ق رنك َذزف انشقى‬ٛ‫ٔ نرذق‬
ٔ 4- ٙ‫ شى ظشب ػُاصش انصف األٔل ف‬.َٙ‫ ٔ جًؼّ ػهٗ ػُاصش انصف انصا‬3 ٙ‫انصف األٔل ف‬
.‫جًؼّ ػهٗ ػُاصش انصف انصانس‬
So we need to get rid of the 2 in the second row and the 3 in the third row. To
get rid of the 2 in the second row, we multiply the first row by 3 and add the
result to the second row; we multiply the first row by -4 and add the result to
the third row. This gives
1 2 1  1 2 1 
 3 2  
1  r2  3r1  0 8 2 
 
 4  4 1  r3  4r1 0  12 5 

Step 2:
‫ انصف‬ٙ‫ ف‬َٙ‫ ٔ جًؼّ يغ شالشح اظؼاف انصف انصا‬1 ٙ‫ يٍ انصف انصانس ٔ رنك تعشتّ ف‬21- ‫َذزف‬
.َٙ‫انصا‬
We need to get rid of the (-12) in the third row. This yields:

1 2  1 1 2  1 
0  0 8  2 
 8  2    
0  12 5  2r3  3r2 
0 0 4 


upper triangular matrix

2- Rank of Matrix A: (  (A ) ) ‫سذثح انًصفٕفح‬


.‫ انُغق انًخفط‬-‫قح انصف‬ٚ‫ق غش‬ٛ‫ح انُاذجح يٍ ذطث‬ٚ‫ش انصفش‬ٛ‫ ػذد انصفٕف غ‬ْٙ
It is the number of all non-zeros rows after the reduced echelon form.
23 - 6 12 
A   0 0 0    (A ) = 2,
 0 0 1 

7 0 4 
B  0 4 5    (B) =3.
0 1 0 

88
Chapter 3 Introduction to Linear Algebra

0 0 0 
C  2 4 0    (C) =1.
0 0 0 

Form the n  2n augmented matrix, ٙ‫ٍ انًصفٕفح انًٕعؼح كانران‬ٕٚ‫رى ذك‬ٚ

 a11 a12  a1n  1 0  0


a a  a2 n  0 1  0
A n*n  I n    21 22
           and transforms the
 
an1 an 2  ann  0 0  1

augmented matrix to the matrix,


1 0  0  d11 d12  d1n 
0 d 22  d 2 n 
I n  A n1*n  

1  0  d 21
         in reduced row echelon
 
0 0  1  d n1 d n 2  d nn 

form via elementary row operations.

Example
1 1  2
  5  , we can employ the procedure
To find the inverse of A   2 3
 1 3 5 

introduced above.
1 1 2  1 0 0
2 3 5  0 1 0 r2  2r1  .

 1 3 5  0 0 1 r3  r1

1 1 2  1 0 0
0 1 1  2 1 0  r2 

0 2 3  1 0 1

1 1 2  1 0 0 r1  r2
0 1 1  2 1 0

0 2 3  1 0 1 r3  2r2

89
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

1 0 1  3 1 0 r1  r3
0 1 1  2 1 0 r2  r3

0 0 1  3 2 1

1 0 0  0 1 1
0 1 0  5 3  1

0 0 1  3 2 1 

The inverse of A is
 0 1 1 
A 1 
 5 3  1
.

 3 2 1 

3.2 Linear Systems ‫النظم الخطية‬

3.2.1 Introduction to Linear Systems ‫مقذمة في النظم الخطية‬


.ٙ‫ يٍ انًؼادالخ كانران‬ٙ‫نُثذأ تُظاو خط‬
Consider the following linear system of n-equations of n-unknowns.
a11x1  a12 x 2  a13 x 3 ..... a1n x n  b1
a 21x1  a 22 x 2  a 23 x 3 ..... a 2n x n  b 2
    
a n1x1  a n2 x 2  a n3 x 3 ..... a nn x n  b n
.ٙ‫اغح َظى انًؼادالخ انًطهٕب دهٓا كانران‬ٛ‫جة اٌ َغرذذو انًصفٕفاخ نص‬ٚ
Matrices can be used to represent systems of equations, which we solve. Thus,
the above system is rewritten as
 a 11 a 12  a 1n   x1   b1 
a  a 2n   x 2   b 2 
 21 a 22 
           .
    
a n1 a n2  a nn   x n  b n 
Or Ax  b
For example, let’s say we have the three equations:
2.3x  4.2y  0.5z   0.5
5x  4.25y  6z  0.26
2x  y 7z  2.7

90
Chapter 3 Introduction to Linear Algebra

The matrix form of this system may be written as


2.3 4.2 0.5  x  - 0.5
 5 4.25 6   y   0.26
    .
 2 1 7  z  2.7 

Obtaining the unknowns x, y and z represents the solution of this system. In


the remainder section, we use different methods to find the exact solution of
linear systems of equations.

MATLAB example ‫تطبيق ماتالب‬


Solve the system: 2x-3y+4z = 5, y+4z+x = 10, -2z+3x+4y = 0 using
MATLAB.
Solution
>> clear, syms x y z;
>> eq1 = '2*x-3*y+4*z = 5'; eq2 = 'y+4*z+x = 10'; eq3 = '-2*z+3*x+4*y = 0' ;
>> [x, y, z] = solve(eq1,eq2,eq3,x,y,z) % the solution command
x=
-5/37
y=
45/37
z=
165/74
>> soln=double([x,y,z]) % real form of solution
soln =
-0.1351 1.2162 2.2297

We can check the previous examples and solve problems of higher orders
using programming with MATLAB.

Example: Design a program to solve the following the linear systems Ax=b,
Test the program using the following system
 1 -1 2 0 
 3 -2 5 -1 
i) A =  
 1 0 -2 6 
 
 4 0 5 2 
b= [-10 -25 21 -12] T

91
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

1 - 1 2 0 0  x 1   3 
2 4 - 1 0
 0  x 2   0 
ii) 1 1 3 0 0  x 3    1 
    
0 0 0 1 2  x 4  10
0 0 0 - 2 3  x 5   1 

Solution
i)
>> format rat
>> A=[1 -1 2 0;3 -2 5 -1;1 0 -2 6;4 0 5 2]
A=
1 -1 2 0
3 -2 5 -1
1 0 -2 6
4 0 5 2
>> b=[-10 -25 21 -12]'
b=
-10
-25
21
-12
>> x=inv(A)*b
x=
1
3
-4
2

ii)
>> A=[1 -1 2 0 0;2 4 -1 0 0;1 1 3 0 0;0 0 0 1 2;0 0 0 -2 3]
A=
1 -1 2 0 0
2 4 -1 0 0
1 1 3 0 0

92
Chapter 3 Introduction to Linear Algebra

0 0 0 1 2
0 0 0 -2 3
>> b=[3 0 1 10 1]
b=
3 0 1 10 1
>> x=inv(A)*b'; x=x'
x=
2.0000 -1.0000 0.0000 4.0000 3.0000

Theorem (without proof)


Consider the following linear system of equations.
A nn x n1  b n1 or,
 a 11 a 12  a 1n   x1   b1 
a  a 2n   x 2   b 2 
 21 a 22 
           .
    
a n1 a n2  a nn   x n  b n 

The augmented matrix can be written as

 a11 a 12  a 1n  b1 
a  a 2n  b 2 
~  21 a 22
A n( n 1)  A b  =        .
 
a n1 a n2  a nn  b n 
.‫خعغ نصالز إَٔاع يٍ انذم‬ٚ ٙ‫ْزا انُظاو انخط‬
This system has the following cases of solution.

~
i) If  A   A   n , then, the system has a unique solution, )‫ذ‬ٛ‫(دم ٔد‬

~
ii) If  A   A   n , has infinite solutions, )‫ يٍ انذهٕل‬ٙ‫(ػذد ال َٓائ‬

~
iii) If  A   A  , the system has no solution. )‫ظ نّ دم‬ٛ‫(ن‬

93
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

Example

.‫اخ انصف انًخرصش‬ٛ‫ تاعرخذاو ػًه‬ٙ‫ذأكذ يٍ ٔجٕد دم نهُظاو انران‬


Test the existence of solution of the following system using row echelon
opeartions.
1  1 1   x  8 
2 3  1  y   3 
    
5 0 2  z  10

Solution

1  1 1  8  1  1 1  8 
~    0 5  3   13
A  A b  2 3  1  3  r2  2r1
5 0 2  10 r3  5r1 0 5 - 3   30 r3  r2

1  1 1  8 
 0 5  3   13
0 0 0  - 17 

ُٗ‫ؼ‬ٚ ‫ ٔ رنك‬.)‫ (غير المنطقي‬ٙ‫ًكٍ كراترٓا ػهٗ انشكم انران‬ٚ ‫شج‬ٛ‫الدع أٌ انًؼادنح انًخرصشج األخ‬
~
.‫ نهذانح انصانصح‬A ٔ A ٍٛ‫ انًصفٕفر‬ٙ‫ نًطاتقح سذثر‬.‫اعرذانح ٔجٕد دم‬
The last reduced equation may be written as
 
0  -17 !!!. But this is impossible. In other words, 3   A   A  2 .
~

Thus, the system has no solution.

3.2.2 Gauss-Elimination (Back Substitution) Method:


)‫طريقة الحذف لجاوس (التعويض العكسي‬
Illustrative example
Consider the system,
3x - 5y = 13,
4x +3y = -2.
‫ أظؼاف انًؼادنح‬3 ٗ‫ شى جًغ انُاذج ػه‬4- ٙ‫ تعشب انًؼادنح األٔنٗ (كايهح) ف‬x ‫ًكٍ إصانح انًجٕٓل‬ٚ
.)‫ح (كايهح‬َٛ‫انصا‬

94
Chapter 3 Introduction to Linear Algebra

Multiplying the first equation by -4, then add this to the second equation
(multiplied by 3), we find a new equation.
-12x +20y = -52,
+ 12x +9y = -6.
------------------
0*x+29y = -58
.)‫ (نّ َفظ انذم‬ٙ‫ذى انرذٕل إنٗ انُظاو انًكافئ انران‬
We have the following equivalent system
3x - 5y = 13,
0*x+29y = -58
→y=-2
The value of x may be calculated by back substitution
3x -5*(-2) = 13 →x=3/3=1.
Then, the solution vector is
 x  1 
 y    2
   
ٕ٘‫ ذذر‬ٙ‫ ٔ تانران‬.‫شج راخ يجٕٓل ٔادذ فرذم يثاششج‬ٛ‫قح ذثذأ تجؼم انًؼادنح األخ‬ٚ‫إٌ فكشج ْزِ انطش‬
....‫ ٔ ْكزا‬.‫عا يثاششج‬ٚ‫انًؼادنح انغاتقح نٓا يجٕٓال ٔادذا فرذم أ‬
The idea of this method is to reduce unknowns of the last equation to only one.
Then, the last unknown is calculated directly. The other unknowns are
calculated by back substitution. To achieve this target, all zeros below the
diagonal in the coefficients matrix (A).

.‫قح انصف انًخرصش‬ٚ‫ تاعرخذاو غش‬U ‫ا‬ٛ‫ح ػه‬ٛ‫ إنٗ يصفٕفح يصهص‬A ‫م يصفٕفح انًؼايالخ‬ٕٚ‫ذى ذذ‬
In other words, the matrix A will be transformed to an upper triangular matrix
(U) by row echelon procedure. This can be written as

Ax  b  Ux  b or

Ab  U b 
Where, Ab is called the augmented matrix. )‫(انًصفٕفح انًٕعِّؼح‬

Example

95
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

Solve the following system using Gauss-elimination method:


 1 -1 2 0   x1  - 10 
    
 3 -2 5 -1   x2    25
 1 0 -2 6   x3   21 
    
 4 0 5 2   x4   12 

Solution

. U b  ٗ‫هٓا إن‬ٕٚ‫ نرذ‬Ab ‫انًٕعؼح‬


ِّ ‫قح انصف انًخرصش ػهٗ انًصفٕفح‬ٚ‫ق غش‬ٛ‫ُا ذطث‬ٛ‫جة ػه‬ٚ
We should use the row echelon procedure to get un upper triangular system as

Ab  U b . The augmented matrix is written as


1 -1 2 0  - 10 
 
~
A  A b  3 -2 5 - 1- 25
 
1 0 -2 6  21 
4 0 5 2  - 12 

.)ٙ‫غ‬ٛ‫م انؼًٕد األٔل إنٗ أصفاس (يا ػذا انقطش انشئ‬ٕٚ‫قح ترذ‬ٚ‫ذثذأ ْزِ انطش‬
The procedure starts with transform first column to zeros except the first
element.
‫ شى جًغ انصفٕف‬4- ‫ شى‬2- ‫ شى‬3- ٙ‫قح انصف انًخرصش تعشب انصف األٔل ف‬ٚ‫ق غش‬ٛ‫رى ذطث‬ٚ ‫ٔ نزنك‬
.‫ة‬ٛ‫ ٔ انصانس ٔ انشاتغ ػهٗ انرشذ‬َٙ‫ انصا‬:‫انصالشح انُاذجح ػهٗ انصفٕف‬
Thus, row echelon operations states that we multiply the first row by -3, -1
and -4, then add the new scaled rows to 2nd , 3rd and 4th rows, respectively. See
the following illustartions.

1 - 1 2 0  - 10  1 - 1 2 0 - 10


   
3 -2 5 - 1- 25 r2  3r1  0 1 - 1 - 1 5 
   
1 0 -2 6  21  r3  r1 0 1 -4 6  31 
4
 0 5 2  - 12  r4  4r1  0 4 - 3 2  28 

.‫ إنٗ أصفاس‬ٙ‫غ‬ٛ‫غ انؼُاصش ذذد انقطش انشئ‬ًٛ‫م ج‬ٕٚ‫قح نرذ‬ٚ‫رى ذكشاس ْزِ انطش‬ٚ
The present operations will performed to transform vlues of second column to
zeros under diagonal. Thus, we multiply the second row by -1 and -4, then add

96
Chapter 3 Introduction to Linear Algebra

the new scaled rows to 3rd and 4th rows, respectively. So, we can write the
following operations.

1 -1 2 0 - 10 1 -1 2 0 - 10


   
0 1 - 1 - 1 5  0 1 - 1 - 1 5 
  r r   
0 1 -4 6  31  3 2 0 0 - 3 7  26 
0
 4 -3 2  28  r4  4r2  0 0 1 6  8  3r4  r3

 
1 - 1 2 0 - 10

 0 1 - 1 -1  5 
  
 = U b .
0 0 - 3 7  26 
 
0 0 25
0  
  50 
 
 U 

.ِّ‫ذغة يثاششج‬ٚ ‫شج اخرصاسْا إنٗ يجٕٓل ٔادذ‬ٛ‫ انًؼادنح األخ‬ٙ‫الدع ف‬


The last reduced equation may be written as
25x 4  50  x 4  2 .
The other unknowns can be calculated by back substitutions as in the
following steps.
- 3x 3  7x 4  26  -3x 3  7 * 2  26  x 3  26 -14  /( 3)  4
x 2  x 3  x 4  5  -x 2  (4)  2  5  x 2  5 - 4  2  3
x 2 - x 2  2x 3  -10  x1 - 3  2(-4)  -10  x1  -10  3  8  1
Finally, the solution vector is
x = [1 3 -4 2]T .

Example

Solve the following system using Gauss-elimination method.


1  1 1   x  8 
2 3  1  y   3 
    
5 0 2  z  27

Solution

97
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

1  1 1  8  1  1 1  8 
~  3  1  3  r2  2r1  0 5  3   13
A  A b  2
5 0 2  27 r3  5r1 0 5 - 3   13 r3  r2

1  1 1  8 
 0 5  3   13
0 0 0  0 

The last reduced system may be written as


x y z 8
5y  3z  - 13
0 0 0 0
‫رى‬ٚ ‫جاد انذهٕل‬ٚ‫ ٔ إل‬.‫م‬ْٛ‫ شالشح يجا‬ٙ‫ٍ ف‬ٛ‫ ذذٕنُا إنٗ يؼادنر‬ٙ‫شج اخٕ تانران‬ٛ‫الدع اخرفاء انًؼادنح األخ‬
‫ ٔ نكٍ انفشض‬.‫م‬ْٛ‫ نهؼٕدج إنٗ ػذد يؼادالخ=ػذد انًجا‬z   ٍ‫ك‬ٛ‫م انصالشح ٔ ن‬ْٛ‫فشض أدذ انًجا‬
.‫ يٍ انذهٕل‬ٙ‫ فُذصم ػهٗ ػذد ال َٓائ‬.ٙٓ‫ش يُر‬ٛ‫ غ‬ٙ‫انذان‬
The reduced system represents two equations in three unknowns (x, y and z).
This system has more than one solution (infinite solutions), since, we can
assume any unknown (say z) to transform this system to two equations in two
unknowns (say x and y). Assume that, z   , this system is rewritten as
 x  y  8-
- 13  3 - 13  3 27  2
5y  -13  3  y   x  y 8-  8- 
5 5 5
Finally, the solution vectors are written as
 x  (27  2 ) / 5 27  2
 y   (3  13) / 5   1 13     3  , where,  is an arbitrary parameter.
    5  5  
z     0   5 

The above example lead us to state an important theorem which classifies the
three cases of solution of linear systems of equations.

3.2.3 Gauss-Jordan (Pivoting) Method )‫جٕسداٌ (انرًشكض‬-‫قح جأط‬ٚ‫غش‬

This procedure gives, directly, the solution of system of linear equations by


the following transformation.

98
Chapter 3 Introduction to Linear Algebra

1
Ax  b . Multiplying both sides by A , we may write,
1 1
A Ax  A b . Then, Ix  x
In other words, we may obtain the following transformation.
Ab  I  x.
.‫قح انصف انًخرصش‬ٚ‫ ) ىثاعرخذاو غش‬x ( ‫قٕدَا إنٗ انذم يثاششج‬ٚ ‫إٌ ْزا انرذٕل‬
By row operations, we can obtain the above formula, which gives, directly, the
required solution vector x .

For n  n systems, the n  (n  1) augmented matrix may be written as

 a11 a 12  a 1n  b1 
a  a 2n  b 2 
~  21 a 22
A  A b        
 
a n1 a n2  a nn  b n 
Then, we can transform the augmented matrix to the matrix form,

1 0  0  x1 
0 1  0  x 2 
I n  x  
       by elementary row operations.
 
0 0  1  xn 

Finally, the solution vector x is the last column of the last reduced matrix.

Example: Solve the following linear system using Gauss-Jordan method.


1  1 1   x  8
2 3  1  y   3
    
1 1 3   z  1 

Solution
The augmented matrix is written as

99
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

 1  1 1  8
A  2 3  1  3
~ 

1 1 3  1

Using the reduced echelon (row operations), we can perform the following
steps to obtain the final formula.
1  1 1  8 1  1 1  8 
A  2 3  1  3 r2  2r1  0 5  3   13 r2 / 5
~  
1 1 3  1 r3  r1 0 2 2   7 

1  1 1  8  r1  r2 1 0 2/5  27/5 
 0 1  3/5   13/5
  0 1  3/5   13/5
0 2 2   7  r3  2r2 0 0 16/5   9/5  5r3 /16

1 0 2/5  27/5  r1  2r3 / 5 1 0 0  45/8 


 0 1  3/5   13/5 r2  3r3 / 5  0 1 0   47/16  I 3  x
0 0 1   9/16 0 0 1   9/16 

Then, the solution is


 x   45/8   5.6250 
 x   y    47/16   - 2.9375
z   - 9/16   - 0.5625

.ٙ‫ح كانران‬ٛ‫قح نذم أكصش يٍ َظاو نهًؼادالخ انخط‬ٚ‫ش ْزِ انطش‬ٕٚ‫ًكٍ ذط‬ٚ :‫يهذٕظح ْايح‬
Note. We can solve more than one system which have the same matrix
coefficients A and different residuals b as:

Ab1 b 2 b3   I x1 x2 x3 

Example: Solve the following linear systems using Gauss-Jordan method.


1  1 1   x  6  1  1 1  u  8
2 3  1  y    2     
      and 2 3  1 v   3
1 1 3   z  10  1 1 3   w 1 

Solution
The modified augmented matrix is written as

100
Chapter 3 Introduction to Linear Algebra

 1  1 1  6  8
A  2 3  1  2  3
~ 

1 1 3  10  1

Using the reduced echelon (row operations), we can perform the following
steps to obtain the final formula
1  1 1  6  8 1  1 1  6  8 
A  2 3  1  2  3 r2  2r1  0 5  3  14   13 r2 / 5
~  
1 1 3  10  1 r3  r1 0 2 2  4   7 

1  1 1  6  8  r1  r2 1 0 2/5  16/5  27/5 


 0 1  3/5  14 / 5   13/5  0 1  3/5  14 / 5   13/5
0 2 2  4   7  r3  2r2 0 0 16/5  48/5   9/5  5r3 /16

1 0 2/5  16/5  27/5  r1  2r3 / 5 1 0 0 2  45/8 


 0 1  3/5  14 / 5   13/5 r2  3r3 / 5  0 1 0  1   47/16
0 0 1  3   9/16 0 0 1 3   9/16 

Then, the solutions are


x   2  u   45/8   5.6250 
 y     1 and  v    47/16   - 2.9375 .
         
z   3   w   - 9/16   - 0.5625

3.2.4 Solving Linear System of equations Using Inverse Methods


The system,
Ax  b , where, b  0 , has a unique solution if A -1 exists. This solution can be
written as
A -1 A x  A -1 b → I x  A -1 b . Thus,

x  A b.
-1

-1
The inverse A can be obtained using several methods such as adjoint
method and pivoting method.

101
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

3.3 Determinants ‫المحذدات‬


3.3.1 Definitions ‫ف‬ٚ‫ذؼاس‬
.ٙ‫اع‬ٛ‫ذٕنٓا إنٗ سقى يق‬ٚ ‫إٌ يذذد انًصفٕفح انًشتؼح‬
The determinant of the square matrix A nn transforms it to scalar.

Consider square matrix, A nn  aij  . The determinant of A which is denoted

by detC or C is defined as follows:

a11 a12
i) If n=2: A 22   a11a22  a12 a21 .
a21 a22

 3 1
Example: The determinant of the matrix A    is:
 5 2
A  (3)(2)  (5)(1)  6  5  11.

 2  2
Example: The determinant of the matrix A  4 3  is:
 
A  (2)(3)  (4)(2)  6  8  6  8  14.

a11 a12 a13


ii) If n=3: A 33  a21 a22 a23 
a31 a32 a33

Example

102
Chapter 3 Introduction to Linear Algebra

 a11 a12 a13 ..... a1n 


a a22 a23 ..... a2 n 
iii) The determinant A   21 is written, in general, as
      
 
 an1 an 2 an 3 ..... ann 

n
A   akj (1)k  j M kj
j1
,

Where, k is a certain row and M kj is called the minor, which, is the


determinant of a reduced matrix after eliminating the kth row and jth column.
For instant,
a22 a23 a24 ..... a2 n a11 a12 a13 ..... a1,n 1
a32 a33 a34 ..... a3n a21 a22 a23 ..... a2,n 1
M11  and Mnn 
         
an1 an 2 an 3 ..... ann an 1,1 an 1, 2 an 1,3 ..... an 1,n 1

A 33

The following determinant is written for simplicity,


a 11 a 12 a 13
A 33  a 21 a 22 a 23  c 11 *
a 22
a 32
a 23
a 33
a 12 *
a 21
a 31
a 23
a 33
a 13 *
a 21
a 31
a 22
a 32
a 31 a 32 a 33
is
where,
  
 signs , ,  are obtained from determinant signs    or the
  

term (1)k  j such that k=row number and j=column number.


a 22 a 23  a 21 a 23  a 21 a 22 
 For instant M 11    
a 33  a  a  are
, M 12 , M 13
, a 32  31 a 33   31 a 32 

called minors M kj which is obtained by eliminating the kth row and jth
column.

103
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

Example
 7 6  5
 
If A   0  1  5 , then,
 0  3 8 

det(A) =
7 6 5
1  5 0 5 0 1
A 0  1  5  (1) * 7 *  (1) * 6 *  (1) * (5) *
3 8 0 8 0 3
0 3 8

=7*(-8-15)-6*(0)+5*(0)=161.

Example
2  3 5  1
3 0 2 0 
If A   , then, find A .
2 - 1 5 1
 
1 0 0 - 2

Solution
.‫ًح انًذذد تاعرخذاو أدذًْا‬ٛ‫فعم دغاب ق‬ٚ ‫ ٔ نزنك‬,‫ش اصفاس أكصش‬ٛ‫ ٔ األخ‬َٙ‫ٍ انصا‬ٛ‫الدع ادرٕاء انصف‬
4
A 4*4   a2j (1)2 j M 2j
j1

2  3 5 1
3 0 2 0
A  a21 (1)21 M 21  a23 (1)23 M 23
2 -1 5 1
1 0 0 -2

3 5 1 2  3 1
A  3 *  1 5 1  2 * 2 1 1
0 0 2 1 0 2

3 5   3 1 2 3
 3 * (2) *  2 * (1) *  (2) * 
1 5  1 1 2 1 

 6 * (10)  2 *  4  (2) * 3  36 .

104
Chapter 3 Introduction to Linear Algebra

3.3.2 Some Properties of Determinants ‫تؼط خصائص انًذذداخ‬


1) The inverse using determinants may be written as
adj(A)
A 1  , where, the adjoint matrix adj(A) is calculated in the following
A
steps.
T
C11 C12 C13 ..... C1n 
C a22 a23 ..... a2 n 
adj(A)   21 , where,
      
 
Cn1 Cn 2 Cn3 ..... Cnn 

Ci j   1
i j
M i j is the cofactor

Example
14  9  12
Consider the matrix: A   3  23  11 . Find:
 1  12  16
i) A ,
ii) The adjoint matrix adj(A) .
iii) A1 using adjoint method.

 -5 
iv) use the above results to solve the system: Ax  b , where, b   16 .
 16 

Solution

a11 a12 a13


i) A 33  a21 a22 a23 
a31 a32 a33

=14*23*16-9*11+12*3*12+12*23-14*11*12-9*3*16
=3481.

105
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

  4  2   1  2   1 4  
 
 3 5   1 5   1  3 
 M11 M12 M13   
  0 3  4 3  4 0  
ii) Let M  M 21 M 22 M 23      1 
 3 5 5  1  3 
M 31 M 32 M 33    
 0 3    4 3   4 0 
  4  2   1  2   1 4 
  
Thus, the adjoint matrix obtained as

C11 C 21 C 31   M 11  M 21 M 31  14  9  12


 
adj( A)  C12 C 22 C 32    M 12 M 22  M 32    3  23  11
C13 C 23 C 33   M 13  M 23 M 33   1  12  16
Where, C ji is a cofactors.

iii) The inverse is calculated by the following formula.


14  9  12
adj(A)  1 
A 1    3  23  11
A 59
 1  12  16
.
iv) Finally, the required solution is calculated as:.
14  9  12  - 5   2  x   2 
1       y    3
x  A b =  3  23  11  16   3 
-1
   
59
 1  12  16  16   1   z   1 

a11 a12 a13 ..... a1n a11 a21 a31 ..... an1
a21 a22 a23 ..... a2 n a12 a22 a32 ..... an 2
At  A   .
2)          
an1 an 2 an 3 ..... ann a1n a2 n a3n ..... ann

1 - 3 1 3 1 -3 1 3
If A     AT     A   10, AT   10
3 1 - 3 1 3 1 -3 1

3) Determinant of diagonal/upper/lower matrix equal to the multiplication of


elements on diagonal.

106
Chapter 3 Introduction to Linear Algebra

a 11 0 0  0
a 11 0 0  0 a 11 a 12 a 13  a 1n
a2 a 22 0  0
0 a 22 0  0 0 a 22 a 23  a 2n
a 31 a 32 a 33 0 0
0 0 a 33 0 0  0 0 a 33   
     
0 0 0  0 0 0  0
0 a n1 a n2   a nn
0 0 0  0 a nn 0 0 0  0 a nn

 a 11 * a 22 * a 33 * ..... * a nn  i 1 a ii
n

.
For instant,
1 2 3 
0  1  6   1 * (1) * 28  28
  .
0 0 28 

4) Interchanging any two rows (columns) reverses the sign of determinant.


a11 a12 a13 ..... a1n a21 a22 a23 ..... a2 n
a21 a22 a23 ..... a2 n a11 a12 a13 ..... a1n

         
an1 an 2 an 3 ..... ann an1 an 2 an 3 ..... ann

5 ) The factor of determinant is taken from total row (column).


a11 a12 a13 ..... a1n a11 a12 a13 ..... a1n
a21 a22 a23 ..... a2 n a21 a22 a23 ..... a2 n

         
an1 an 2 an 3 ..... ann an1 an 2 an 3 ..... ann

6) The determinant vanishes if any row(column) vanishes


a11 a12 a13 ..... a1n
0 0 0 ..... 0
0
    
a n1 a n2 a n3 ..... a nn

107
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

a11 a12 a13 ..... a1n


a11 a12 a13 ..... a1n
or any two rows (columns) are equal, 0
    
an1 an 2 an 3 ..... ann

a11 a12 a13 ..... a1n


a11 a12 a13 ..... a1n
or any two rows (columns) are proportional,  0.
    
an1 an 2 an 3 ..... ann

7) AB  BA  A B  B A
For instant, consider,
1 3 2  1
A 
 1 0 2 
and B
2 

2 5  0 7 
 AB    and BA   
 4  4  4  2
2 5 0 7
AB   -28,  BA   28
4 4 4 2

1 3 2 1
AB  7 * 4  -28
2 1 0 2

2 1 1 3
BA  4 * (7)  -28
0 2 2 1

----------------------

108
Chapter 3 Introduction to Linear Algebra

Exercises (3)
1. Find the inverse of the following matrices using partitioning method:
1 - 1 0 0 1 - 1 2 0
2 3 0 0 2 3 0 5
i) E   ii) F  
0 0 - 2 2 0 0 - 2 2
   
0 0 4 1 0 0 4 1

1 2 0
0
3 - 1 0   1 0 
iii) G  0 3 - 2 
3 0
iv) H  
4 7 3 2
0 4 2   
2 6 7/2  1

1 - 1 2 0 0
2 4 - 1 0 0

v) 1 1 3 0 0 .
 
0 0 0 1 2
0 0 0 - 2 3

2. Consider the following matrix.


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

Construct the following operations.


a) Determinant of matrix A.
b) Row echelon form for A.

3. Find the determinant of the following matrices


 1 1 1 1 
1 2 0  4 0 1  1 2  4  2
   
A  2 1  1 , B  2 1 0 , C   
2 1 1 5
3 1 1  2 2 3  
  1 0  2  4

1  1 2  1
2  2 3  3
4. Find inverse of B   using Pivoting method, and adjoint
1 1 1 0
 
1  1 4 3
method.

109
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

1 3 2 3 
2 8 7 12 
5. Design MATLAB program to find inverse of E   .
0 3 15 0 
 
 3  4 5 2 

1 1  2
  5  using Pivoting method
6. Find inverse of A   2 3
 1 3 5 

7. Given the matrix,


 2  1 3
A   0 4 1 ,
 1 6 8
.
Use three methods to solve the system A x=b, where, b  2  3 1t .

8. Solve the following linear system using Gauss-elimination:


2.3 x1  4. 2 x 2  0.5 x3   0.5
5 x1  4.25x2  6 x3  0.26
2 x1  x2  7 x3  2 .7

9. Solve the following linear system using Gauss-Jordan method:

1  1 2  1 x   8 
2  2 3  3  y   20
 
1 1 1 0  z   2 
    
1  1 4 3  w   4 

10. Consider the following linear system


x y z 
2x  3y  4z  0 ,
3x  4y  5z  1

Find the value(s) of  such that the system has:


i) a unique solution,
ii) infinite solutions,
iii) no solution (inconsistent).

110
Chapter 3 Introduction to Linear Algebra

11. Consider the following linear system


 1 -1 1 -2   x1  - 6 
    
 0 2 1 -3   x2    5 ,
 3 -1 -4 -1   x3   9 
    
 -1 -3 3 2   x4   5

Find whether the system has a unique solution, infinite solutions or no solution
(inconsistent).

12. Design a program to solve the following the linear system Ax=b, using
Gauss-elimination method. Enter the coefficients in the augmented matrix in
one nested loop. Test the program using the following system
 1 -1 2 0 
 3 -2 5 -1 
A=  
 1 0 -2 6 
 
 4 0 5 2 
b= [9 26 -29 11]T

13. Find the rank of the following matrices using MATLAB.

 1  1 2  1
1  1 1  -2 2 -4 2 
C  2 2 1 , D 
 3 - 3 6 - 3 .
5 3 3  
- 10 10 - 20 10 
 - 3 23 12
14. Consider the matrix: A  - 14 9 11 . Find:
 1 12 16
i) A ,
ii) The adjoint matrix adj(A) .
iii) A1 using adjoint method.

32
iv) use the above results to solve the system: Ax  b , where, b   6  .
29

111
‫مقذمة في الجبر الخطي‬ ‫الباب الثالث‬

15. Find the existence of solution of the systems. Find it if exist:

x y z 0
i) 2y  8z  8 ,
4x  5y  9z  9
 0 3 -6 4  9
 -1 - 2 -1 3  1
A , b 
ii) - 2 - 3 0 3    1
   
 1 4 5 - 9   7 

 2  1 3  - 3
~  
iii) A  - 3 2  6  7 
 5 - 3 8  9 
.
----------------------

112

You might also like