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

Matrix Operations

1
Matrices - Operations
MULTIPLICATION OF MATRICES
The product of two matrices A B is possible only if the
number of columns of the matrix A is equal to the number of
rows of the matrix B as following:

Amn  Bnr  Cmr

2
Matrices - Operations
A31 , B23  A  B is not possible

A42 , B42  A  B is not possible

A33 , B13  A  B is not possible

A42 , B23  A  B is possible


but B  A is not possible
3
Matrices - Operations
b11 b12 
 a11 a12 a13     c11 c12 
a   b21 b22    
 21 a22 a23 
b31 b32   c21 c22 

(a11  b11)  (a12  b21)  (a13  b31)  c11


(a11  b12 )  (a12  b22 )  (a13  b32 )  c12
(a21  b11)  (a22  b21)  (a23  b31)  c21
(a21  b12 )  (a22  b22 )  (a23  b32 )  c22
Successive multiplication of row i of A with column j of
B – row by column multiplication
4
Matrices - Operations
4 8 
1 2 3    (1 4)  (2  6)  (3  5) (1 8)  (2  2)  (3  3) 
4 2 7 6 2  (4  4)  (2  6)  (7  5) (4  8)  (2  2)  (7  3)
  5 3  
 
31 21
 
 63 57 
Remember that
I n  Ann  Ann  I n  Ann
1 0  31 21  31 21 1 0  31 21
0 1 63 57   63 57  0 1   63 57
       

5
Matrices - Operations
Assuming that matrices A, B , C, are three matrices and I is the
identity matrix, then we have
1. AI = IA = A
2. AB  BA
3. A(BC) = (AB)C = ABC (associative law)
4. A(B+C) = AB + AC (first distributive law)
5. (A+B)C = AC + BC (second distributive law)
6. If AB = 0, neither A nor B necessarily = 0
7. If AB = AC, B not necessarily = C

6
Matrices - Operations
AB  BA
1 2 3 4
A  , B 
5 0  0 2 
1 2 3 4 3 8 
AB       
5 0  0 2  15 20 
3 4  1 2   23 6 
BA       
0 2  5 0  10 0 
If AB = 0, neither A nor B necessarily = 0

1 1  2 3  0 0
0 0  2  3  0 0
    
7
Matrices - Operations
TRANSPOSE OF A MATRIX
If A  a ij  , then the transpose of A  A T  a ji 
m n nm
 2 5
  2 4 7
A   4 3  A  T

7 1  5 3 1 
1
B   3   BT  1 3 2
 2 

1 3 2   1 5 8
C  5 4 6   CT   3 4 9 
8 9 11   2 6 11
8
Matrices - Operations
Properties of transposed matrices:
1. (A+B)T = AT + BT
2. (AB)T = BT AT
3. (kA)T = kAT
4. (AT)T = A
5. (IT) = I

9
Matrices - Operations
Example: Verify that (A+B)T = AT + BT for the following matrices
7 3 1  1 5 6
A  , B 
 2 5 6   4  2 3 
Solution
T 8  2
 7 3 1  1 5 6  
T
 8 8 5 8  7 
 A  B     
T

         
 2 5 6   4 2 3   2 7 9  5 9 

 7 2  1 4  8 2 
A T  BT   3 5  5 2   8 7 
 1 6  6 3  5 9 

Then, (A+B)T = AT + BT
10
Matrices - Operations
Example 2: Verify that (AB)T = BT AT for the following matrices
1 
1 1 0  1 
A  , B   
 0 2 3   2 
Solution
T
 1   T
 1 1 0    2
 AB    1      2 8
T
 
 0 2 3
   8 
  
2
1 0 
BT A T  1 1 2 
 1 2  2 8
  

0 3  

Then, (AB)T = BT AT
11
Matrices - Operations
SYMMETRIC MATRICES
A Square matrix is a symmetric matric if it is equal to its transpose:
A = AT
 1 2 1  1 2 1
A   2 3 7  and A T   2 3 7   A  A T
 1 7 5   1 7 5 
The transposition does not affect the elements of the main diagonal

Notice that:
• The identity matrix I is symmetric
• The diagonal matrix D is symmetric
• The scalar matrix K is symmetric
12
Matrices - Operations
SKEW-SYMMETRIC MATRICES
A Square matrix is a symmetric matric if it is equal to the negative of
its transpose: AT = - A

 0 2 1 0 2 1  0 2 1
A   2 0 7  and A T   2 0 7     2 0 7   A  A T
1 7 0   1 7 0  1 7 0 

All the elements of the main diagonal are zero

13
Linear Systems of Equations (Gauss Elimination)
A linear system of m equations in n unknowns x1 , x 2 , x 3..., x n is a set
of linear equations as follows:

a11x1  a12 x 2  ....  a1n x n  b1 


a 21x1  a 22 x 2  ....  a 2n x n  b 2 


a m1x1  a m2 x 2  ....  a mn x n  b m 

The system is called linear because each variable x j appears in


the first power only.

Amn Xn1  Bm1

14
Linear Systems of Equations (Gauss Elimination)
 a11 a12 .... a1n 
a a .... a 
A  a ij    21 22 2n 
are called the coefficients
 
 
 m1
a a m2 .... a mn 

 x1 
x 
x   2 are called the unknowns
 
 
xn 

 b1 
b 
B 2 are called the results
 
 
bm 

15
Linear Systems of Equations (Gauss Elimination)
The system is homogeneous if all the results bi for all i are zero

The system is non-homogeneous at least on of bi is non- zero

The solution of any system

No One Infinite
Solution solution solution

16
Linear Systems of Equations (Gauss Elimination)
The augmented matrix
 a11 a12 .... a1n b1 
a a 22 .... a 2n b 2 
A  21

 
 
a m1 a m2 .... a mn bm 

Elementary Row Operations. Row-Equivalent Systems


• Interchange of two rows.
• Addition of a constant multiple of one row to another row.
• Multiplication of a row by a nonzero constant k.

CAUTION!
These operations are for rows, not for columns.

17
Linear Systems of Equations (Gauss Elimination)
Theorem 1
Row-Equivalent Systems
Row-equivalent linear systems have the same set of solutions.

Example 1: Solve the following system of linear equation by using


Gauss elemination

x1  x 2  x 3  0
 x1  x 2  x 3  0
10x 2  25x 3  90
20x1  10x 2  80

18
Linear Systems of Equations (Gauss Elimination)
Solution
 1 1 1 0 Pivot 1  1 1 1 0
 1 1 1 0  R3 / 5  1 1 1 0 
A  A
 0 10 25 90  R 4 /10 0 2 5 18
   
 20 10 0 80  2 1 0 8
1 1 1 0 1 1 1 0
0 0 0 0 3 2 8 
R1  R 2 0 
A R2  R4  A
2R 1  R 4 0 2 5 18 0 2 5 18
   
0 3 2 8 0 0 0 0

1 1 1 0  1 1 1 0
0 3 2 8  3 0 3 2 8 
2
 R2  R3  A    R3  A  
3 0 0 19 / 3 38 / 3 19 0 0 1 2
   
0 0 0 0  0 0 0 0
19
Linear Systems of Equations (Gauss Elimination)
1 1 1 0
0 3 2 8  The system has been reduced to three equations
A
0 0 1 2
 
0 0 0 0

Working backward from the last to the first equation of this


“Upper triangular” system
x3  2
8  2x 3
3x 2  2x 3  8  x 2  4
3
x1  x 2  x 3  0  x1  x 2  x 3  2
The final solution of the system is one solution as:
x1  2, x 2  4, x 3  2

20
Linear Systems of Equations (Gauss Elimination)
Example 2: Solve the following system of linear equation by using
Gauss elemination x  2x  3x  3
1 2 3

x1  x 2  2 x 3  0
4x1  2 x 2  6x 3  6
Solution:
1 2 3 3 1 2 3 3 
 R1  R 2
A  1   A  0 1 1 3   R 3 
1
1 2 0
4R 1  R 3 6
 4 2 6 6  0 6 6 6 
1 2 3 3 1 2 3 3 
A  0 1 1 3 R 2  R 3  A  0 1 1 3 0  2
0 1 1 1  0 0 0 2 

but 0  2 No Solution for the system


21
Linear Systems of Equations (Gauss Elimination)
Example 3: Solve the following system of linear equation by using
Gauss elemination x  2x  3x  3
1 2 3

x1  x 2  2 x 3  0
2x1  x 2  3x 3  3
Solution:
1 2 3 3 1 2 3 3
 R1  R 2
A  1   A  0 1 1 3   R 3 
1
1 2 0
2R 1  R 3 3
 2 1 3 3 0 3 3 9 
1 2 3 3 1 2 3 3
A  0 1 1 3 R 2  R 3  A  0 1 1 3
0 1 1 3  0 0 0 0 
Complete row of zero elements. The system has been reduced to only
two equations
22
Linear Systems of Equations (Gauss Elimination)
Number of equations < Number of unknowns
x 2  x3  3 
  Infinite solutions
x1  2x 2  3x 3  3

Consider that x 3  t (parameter t  )


Hence, we have
x2  3  t
x1  2  3  t   3t  3  3  t
For t  1  x1  4, x 2  2, x 3  1

For t  3  x1  0, x 2  6, x 3  3

23
Linear Systems of Equations (Gauss Elimination)
General form
 a11 a12 a13 b1  a11 a12 a13 b1 
A  a 21 a 22 a 23 b2   E.Op.M  A   0 c 22 c 23 d2 
 a 31 a 32 a 33 b3   0 0   


x3 

0 0 0


any  0 0
One solution Infinite solution No solution

24
Linear Systems of Equations (Gauss Elimination)
Sheet(1)
 2 0 4  0 5 3 1 5
(1) If A   1 3 2  , B   5 6 4  and C   2 2 
 6 5 4   3 4 0   0 3 
Find (i)  3A  2B   iii 
T
(ii) BC CT A

(2) Solve the following systems of linear equations by using Gauss elimination
(i) x1  2x 2  x 3  3, 2x1  x 2  2x 3  1, 3x1  4x 2  5x 3  5
(ii) x  y  2z  2, 2x  y  2z  0, 3x  2y  4z  6
 iii  2x  3y  2z  6,  x  y  2z  0,  3x  y  3z  2

25

You might also like