EMS 112-Topic 1-Matrix
EMS 112-Topic 1-Matrix
By:
Masoud Amri Komunte
Department of mathematics and Statistics Studies (MSS)
Mzumbe University
Linear Algebra
(Matrices)
2
Topic 1: Linear Algebra (Matrices)
1.1 Matrices
1.2 Operations of matrices
1.3 Types of matrices
1.4 Properties of matrices
1.5 Determinants
1.6 Inverse of a 33 matrix
1.7 Solutions to systems of equations
1.8 Eigen values and Eigen vectors
1.9 Diagonalisation of matrices
1.10 The Cayley-Hamilton theorem
3
1.1 Matrices
1 3 1
2 3 7
A B 2 1 4
1 1 5 4 7 6
Why matrix?
4
1.1 Matrices
Consider the following set of equations:
x y 7, It is easy to show that x = 3 and
3x y 5. y = 4.
x y 2 z 7,
2 x y 4 z 2,
How about solving
5 x 4 y 10 z 1,
3 x y 6 z 5.
if A = B, then a = 1, b = 0, c = -4 and d = 2.
9
1.1 Matrices
Zero matrices
10
1.2 Operations of matrices
Sums of matrices
If A = [aij] and B = [bij] are m n matrices,
then A + B is defined as a matrix C = A + B,
where C= [cij], cij = aij + bij for 1 i m, 1 j n.
1 2 3 2 3 0
Example: if A and B
0 1 4 1 2 5
Evaluate A + B and A – B.
1 2 2 3 3 0 3 5 3
A B
0 ( 1) 1 2 4 5 1 3 9
1 2 2 3 3 0 1 1 3
A B
0 ( 1) 1 2 4 5 1 1 1 11
1.2 Operations of matrices
Sums of matrices
Two matrices of the same order(number of
rows and columns) are said to be conformable
for addition or subtraction.
Two matrices of different orders cannot be
added or subtracted, e.g., 1 3 1
2 3 7 2 1 4
1 1 5
4 7 6
are NOT conformable for addition or
subtraction.
12
1.2 Operations of matrices
Scalar multiplication
Let l be any scalar and A = [aij] is an m n
matrix. Then lA = [laij] for 1 i m, 1 j n,
i.e., each element in A is multiplied by l.
1 2 3
Example: A . Evaluate 3A.
0 1 4
3 1 3 2 3 3 3 6 9
3A
3 0 3 1 3 4 0 3 12
1 2
1 2 3 18 8
C AB 2 3
0 1 4 22 3
5 0 16
1.2 Operations of matrices
Matrix multiplication
In particular, A is a 1 m matrix and
B is a m 1 matrix, i.e., b11
b
A a11 a12 ... a1m B 21
bm1
m
then C = AB is a scalar. C a1k bk1 a11b11 a12b21 ... a1mbm1
k 1
17
1.2 Operations of matrices
Matrix multiplication
BUT BA is a m m matrix!
b11 b11a11 b11a12 b11a1m
b b a b21a12 b21a1m
BA
21
a11 a12 ... a1m
21 11
m1
b bm1a11 bm1a12 bm1a1m
So AB BA in general !
18
1.2 Operations of matrices
Properties
Matrices A, B and C are conformable,
A(B + C) = AB + AC
(A + B)C = AC + BC
A(BC) = (AB) C
AB BA in general
AB = 0 NOT necessarily imply A = 0 or B = 0
AB = AC NOT necessarily imply B = C
19
1.3 Types of matrices
Identity matrix
The inverse of a matrix
The transpose of a matrix
Symmetric matrix
Orthogonal matrix
20
1.3 Types of matrices
Identity matrix
A square matrix whose elements aij = 0, for
i > j is called upper triangular, i.e., a11 a12 a1n
0 a22 a2 n
0 0 ann
21
1.3 Types of matrices
Identity matrix
Both upper and lower triangular, i.e., aij = 0, for
i j , i.e., a11 0 0
0 a22 0
D
0 0 ann
22
1.3 Types of matrices
Identity matrix
23
1.3 Types of matrices
Special square matrix
AB BA in general. However, if two square
matrices A and B such that AB = BA, then A
and B are said to be commute.
26
1.3 Types of matrices
Symmetric matrix
A matrix A such that AT = A is called symmetric,
i.e., aji = aij for all i and j.
A + AT must be symmetric. Why?
1 2 3
Example: A 2 4 5 is symmetric.
3 5 6
1/ 3 1/ 3 1/ 3
Since, A 1/ 6
T
2 / 6 1/ 6 . Hence, AAT = ATA = I.
1/ 2 0 1/ 2
Can you show the
details?
We’ll see that orthogonal matrix represents a
rotation in fact! 28
1.4 Properties of matrix
(AB)-1 = B-1A-1
(AT)T = A and (lA)T = l AT
(A + B)T = AT + BT
(AB)T = BT AT
29
1.4 Properties of matrix
Example: Prove (AB)-1 = B-1A-1.
30
1.5 Determinants
2x2
3x3
nxn
31
1.5 Determinants
Determinant of order 2
a11 a12
Consider a 2 2 matrix: A
a22
a21
32
1.5 Determinants
Determinant of order 2
easy to remember (for order 2 only)..
a11 a12
| A | a11 a22 a12 a21
a21 a22
- +
1 2
Example: Evaluate the determinant: 3 4
1 2
1 4 2 3 2
3 4
33
1.5 Determinants
The following properties are true for
determinants of any order.
1. If every element of a row (column) is zero,
e.g., 1 2
1 0 2 0 0 , then |A| = 0.
0 0
determinant of a matrix
= that of its transpose
2. |AT| = |A|
3. |AB| = |A||B|
34
1.5 Determinants
Example: Show that the determinant of any
orthogonal matrix is either +1 or –1.
For any orthogonal matrix, A AT = I.
Since |AAT| = |A||AT | = 1 and |AT| = |A|, so |A|2 = 1 or
|A| = 1.
35
1.5 Determinants
a11 a12
For any 2x2 matrix A
a21 a22
a22 a12
Its inverse can be written as 1 1
A a
A 21 a11
1 0
Example: Find the inverse of A
1 2
The determinant of A is -2
1 0
Hence, the inverse of A is 1
A
1/ 2 1/ 2
How to find an inverse for a 3x3 matrix?
36
1.5 Determinants of order 3
1 2 3
Consider an example: A 4 5 6
7 8 9
Its determinant can be obtained by:
1 2 3
5 6 4 6 4 5
A 4 5 6 1 2 3
8 9 7 9 7 8
7 8 9
1 3 2 6 3 3 0
2 3 1 3 1 2
A21 12 A22 3 A23 2
0 6 1 6 1 0
2 3 1 3 1 2
A31 2 A32 5 A33 4
4 5 0 5 0 4
38
1.6 Inverse of a 33 matrix
1 2 3
Cofactor matrix of A 0 4 5 is then given
by: 1 0 6
24 5 4
12 3 2
2 5 4
39
1.6 Inverse of a 33 matrix
1 2 3
Inverse matrix of A 0 4 5 is given by:
1 0 6
24 5 4 24 12 2
T
1 1 1
A 12 3 2 5 3 5
A 22
2 5 4 4 2 4
12 11 6 11 1 11
5 22 3 22 5 22
2 11 1 11 2 11
40
1.7 Applications (solutions to systems of equations)
–1
1 2
–1 1 2 x 1 2 3
y =
3 1
-1 3 1
-1 3 1-1 1
1 0 x 1 2 3
1 -1
y =
0 1 75 3 1 1
Step 3: x = -1 and y = -2 1
x 71
y 2 42
Cramer’s Rule
43
Cramer’s Rule
a2 x b2 y c2
a1 b1
Then D
a2 b2
44
Cramer’s Rule Continued
c1 b1 a1 c1
Also Dx Dy
c2 b2 a2 c2
Dx Dy
Thus x y
D D
45
Cramer’s Rule Continued
46
Sample Cramer’s Rule problem
2 x 3 y 5
3x y 9
47
Cramer’s Rule Answer
2 3 5 3
D 11, Dx 22
3 1 9 1
2 5
Dy 33
3 9
Dx 22
x 2
D 11
Dy 33
y 3
D 11 48
Try this problem
2x y z 8
z x y 1
2 y x z 2
49
Gaussian Elimination Method
3 2 5
Coefficient matrix A 2 1 4
1 4 7
50
3x 2 y 5 z 3 If you take the coefficient
matrix and then add a last
2 x y 4 z 2 column with the constants,
it is called the augmented
x 4 y 7z 1 matrix. Often the constants
are separated with a line or
a dotted line.
3 2 5 3
A 2 1 4 2
Augmented matrix
1 4 7 1
51
Operations that can be performed without
altering the solution set of a linear system
1 # # #
0 1 # #
0 0 1 #
3r1 3 6 3 3 2r1 2 4 2 2
+ r2 + r3 2 6 7 1
3 5 1 3
0 1 2 0 0 2 5 1
y column
x column
z column
equal signs y y 22z100
x 2 y 2 z 1
1 2 1 1
0 1 2 0 Substitute −1 in for z in
second equation to find y
0 0 1 1 Substitute −1 in for z and 2 for
y in first equation to find x.
Now we’ll move to the third
column and we see for our Solution is: (−2 , 2 , −1)
goal we just need a 1 in the
third row of the third column.
We have it so we’ve achieved 1 # # #
the goal and it’s time for back 0 1 # #
substitution. We put the
variables and = signs back in. 0 0 1 #
57
x 2y z 1 Solution is: (−2 , 2 , −1)
3x 5 y z 3 This is the only (x , y , z) that
2x 6 y 7z 1 make ALL THREE equations
true. Let’s check it.
3 2 52 1 3
Geometrically this means
we have three planes that
58
To obtain reduced row echelon form (rref) , you
continue to do more row operations to obtain the goal
below.
1 0 0 #
0 1 0 #
0 0 1 #
60
• Which matrices are in Reduced Row Echelon
form?
• If a matrix is not in rref then what changes
would be needed to change it to that form?
61
Let’s try this method on the x 2y z 1
problem we just did. We take the
matrix we ended up with when 3x 5 y z 3
doing row echelon form:
2x 6 y 7z 1
−2r +r11
3r32+r 11 002 0
13 112
00
−2r3+r2
11 0 22 0200 x 2, y 2, z 1
000 000 1 11
11 1
Let’s get the 0 we need in
Notice when we put the variables the second column by
and = signs back in we have the using the second row as
solution a tool.
1 0 0 #
Now we’ll use row 3 as a tool to 0 1 0 #
work on the third column to get
zeros above the 1. 0 0 1 #
62
The process of reducing the augmented matrix to echelon
form or reduced echelon form, and the process of
manipulating the equations to eliminate variables, is called:
Gaussian Elimination
63
Let’s try another example
The augmented matrix: 3x 2 y 2 z 6
3 2 2 6 2x 3y 4z 0
2 3 4 0
7 x 3 y 2 z 1
7 3 2 1
We’ll now use row 1 as our
tool to get 0’s below it.
r1 −r2 11 11 222 66
0 553 848 012
12 We have the first column
−2r1+r2
2 like our goal. On the
−7r1+r3 0 10 2 143
77 33 216 next screen we’ll work
on the next column.
69
Examples/Task
1.Using elementary row operations find the
inverse of 1 2 3
A 4 5 6
7 8 9
71
1.8 Eigen values and Eigen vectors
72
1.8 Eigen values and Eigen vectors
73
1.8 Eigen values and Eigen vectors
74
75
1.8 Eigen values and Eigen vectors
• Eigenvalues and Eigenvectors of 3×3 matrices
76
77
78
79
Note
80
1.9 Diagonalisation of matrices
81
1.9 Diagonalisation of matrices
82
Note that:
83
Example
1.
84
85
86
1.10 The Cayley Hamilton Theorem
87
Example
End of topic 1 88