Chapter 2 Matrices Jan 2024
Chapter 2 Matrices Jan 2024
Chapter 2: Matrices
2.1 Introduction to matrices
2.2 Types of matrices
2.3 Operations of matrices
2.4 Determinants
2.5 Properties of matrices
2.6 Adjoint of a 33 matrix
2.7 Inverse of a 33 matrix
2
2.1 Introduction to matrices
1 3 1
2 3 7
A= B = 2 1 4
1 −1 5 4 7 6
Both A and B are examples of matrix. A matrix is a
rectangular array of numbers enclosed by a pair of bracket.
Why matrix?
3
2.1 Introduction to matrices
▪
i =1
aii = a11 + a22 + ... + ann is called the trace of A.
6
2.1 Introduction to matrices
Equal matrices
▪Two matrices A = [aij] and B = [bij] are said to be equal (A = B)
if & only if each element of A is equal to the corresponding
element of B, i.e., aij = bij for 1 i m, 1 j n.
Example: 𝐴 = 1 0
and 𝐵 = 𝑎 𝑏
−4 2 𝑐 𝑑
if A = B, then a = 1, b = 0, c = -4 and d = 2.
7
2.1 Introduction to matrices
Zero matrices
0 0 0
0 0 0
A=
0 0 0
8
2.2 Types of matrices
▪Identity matrix
▪The inverse of a matrix
▪The transpose of a matrix
▪Symmetric matrix
▪Orthogonal matrix
9
2.2 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= ▪Properties: AI = IA = A
0 0 ann
D = diag[a11 , a22 ,..., ann ] is called a diagonal matrix
1 0 0
Examples of identity matrices: 1 0
0 1 0 1 0
0 0 1
10
2.2 Types of matrices
The inverse of a matrix
▪If matrices A and B such that AB = BA = I, then B is called the
inverse of A (symbol: A-1); and A is called the inverse of B (symbol:
B-1).
1 2 3 6 −2 −3
Example: A = 1 3 3 B=
−1 1 0
1 2 4
−1 0 1
1 2 3
Example: A=
6
4 5 1 4
The transpose of A is AT =
2 5
3 6
▪For a matrix A = [aij], its transpose AT = [bij], where bij = aji.
12
2.2 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
▪A matrix A such that AT = -A is called skew-symmetric,
i.e., aji = -aij for all i and j.
13
2.2 Types of matrices
Orthogonal matrix
▪A matrix A is called orthogonal if AAT = ATA = I, i.e., AT = A-1
1/ 3 1/ 6 −1/ 2
Example: prove that A = 1/
3 −2 / 6 0
is orthogonal.
1/ 3 1/ 6 1/ 2
1/ 3 1/ 3 1/ 3
Since, A = 1/ 6
T
−2 / 6 1/ 6 . Hence, AAT = ATA = I.
−1/ 2
0 1/ 2
Sums of matrices
Example: if 1 2 3 and 2 3 0
A= 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
15
Addition of Matrices
If A and B are both m × n matrices then the sum of
A and B, denoted A + B, is a matrix obtained by
adding corresponding elements of A and B.
add
add add add
add
these add − 3 0 4
111 −−2−22 222these
these
these= −
these
−
3 − 30 0 4
4
AA=
A== 11 −−22 22
B
these − 3
3
BB=B= =2 1 − 4
0
0
4
4
AA=0=00 −−1−11 333 B =2−23 1 01− 4−44
0 − 1 3 B =22 1 1 − −4 4
0 − 1 3 2 1 − 4
−− 2
−−−222
2 −2 6
A ++ B == − 2 −−−−2222 666
A B
AAAA++++BBBB==== 2 0 −1
22 0
16
Sums of matrices
17
Matrix
A+ B = B + A addition is
commutative
Matrix
addition is
associative A + ( B + C ) = ( A + B) + C
18
Scalar Multiplication of Matrices
If A is an m × n matrix and s is a scalar, then we let kA denote
the matrix obtained by multiplying every element of A by k.
This procedure is called scalar multiplication.
k ( hA ) = ( kh ) A
( k + h ) A = kA + hA
k ( A + B ) = kA + kB
19
The m × n zero matrix, denoted 0, is the m × n
matrix whose elements are all zeros.
0 0
0 0
0 0 0
1 × 3
2 × 2
A+0 = A
A + ( − A) = 0
0( A) = 0
20
Matrix multiplication
▪If A = [aij] is a m p matrix and B = [bij] is a p n matrix, then
AB is defined as a m n matrix C = AB, where C= [cij] with
−1 2
1 2 3
Example: A = B = 2 3 and C = AB.
0 1 4
Evaluate c21. 5 0
−1 2
1 2 3
0 1 4 2 3 𝒄𝟐𝟏 = 𝟎 × −𝟏 + 𝟏 × 𝟐 + [𝟒 × 𝟓] = 𝟐𝟐
5 0
21
To multiply matrices A and B
look at their dimensions
mn n p
MUST BE SAME
SIZE OF PRODUCT
22
Multiplication of Matrices
The multiplication of matrices is easier shown than put into words.
You multiply the rows of the first matrix with the columns of the
second adding products
Find AB
2 4
3 − 2 1
A= B = − 1 3
0 4 − 1
− 3 1
3(3(2)()2+) +(−(−2)(
2−)(−1)1) + (1)(− 3) = 5
First we multiply across the first row and down the
first column adding products. We put the answer in
23
the first row, first column of the answer.
Find AB
2 4
3 − 2 1
A= B = − 1 3
0 4 − 1
− 3 1
55 777
AB ==
AB ((00
300)(()(3)(2442)(
( 4))+
4)++)((+
4(− −3)(
44)(()(2
)( )
312))3)(++3+()−−(111)()(11−) =
3)11
7= −1
− 1
11
2 4 3 − 2 1
A=
B = − 1 3 0 4 − 1
− 3 1 ((−−(3−(132−()(1()(2)(12−)(13)(1)()−)2−3++)2)2(++()311)4+)((+(1)(34−(0)((3−)()(41)4)(01)0)(=)4)=)4==−)=)−10
=
9−
=6414
2312
32 23
across
across second
across
as
as we
as we
second
second
third
we go
third row
first
go
go
row
row
go down
down
down 6666 12 12 −−−2−
12
12
12 222
third
first
second
second
third
second
third
first column:
column:
column:
column:
column:
column:
column:
column:
BA
BA
=====−−−
BA
BA
BA 333 14
14
14 −−
− 4
44
− 99 10
− 10 − 4
A(BC ) = ( AB )C
A(B + C ) = AB + AC
( A + B )C = AC + BC
AB BA
Is it possible for AB = BA ? ,yes it is possible.
26
2 − 1 2 Multiplying a
What is AI? 0 1 5 = A
1 0 0
matrix by the
2 − 2 3
identity gives
I 3 = 20− 1 12 0 the matrix
What is IA? 0 1 5 = A back again.
1 0 0
2 − 1 2
2 0− 2 0
3
1
I 3 = 0 1 0
A = 0 1 5
2 − 2 3 0 0 1
identity matrix
an n n matrix with ones on the main diagonal
and zeros elsewhere
27
Properties
▪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
28
Matrix Transpose
A matrix which is formed by turning all the rows of a given matrix into
columns and vice-versa
Notation → AT a b c
A ji = AijT A = d e f
g
h i
i.e.
a
A23 = A T
A =
32 T
A22 = A22
T e
i
29
Example:
3
2 4
(a) A = (b) B = 6
3 6 8
2
A = B = 3
T
T
6
1 5 5 1
(c ) D = 4 8 2
D = 8
T
3 9 0 0
30
Determinant of order 2
a11 a12
Consider a 2 2 matrix: A =
a21 a22
▪easy to remember (for order 2 only)..
a11 a12
| A |= = + a11 a22 − a12 a21
a
- 21
a22 +
determinant of a matrix
= that of its transpose
2. |AT| = |A|
3. |AB| = |A||B|
33
2.5 Properties of matrix
▪(AB)-1 = B-1A-1
▪(AT)T = A and (A)T = AT
▪(A + B)T = AT + BT
▪(AB)T = BT AT
34
2.6 Adjoint of a 33 matrix
35
Co-factors: Matrix 3x3
If A is a nxn matrix and Mij is the minor for the element aij, then the cofactor
for aij is given by Kij = (-1)i+j Mij
a b c
when, A = d e f
g i
h
+ − +
e f d f d e
+ − + 𝐴 = − + −5
h i g i g h 1 0 6
b c a c a b
cofactors = − + −
h i g i g h
b c a c a b
+ − +
e f d f d e
36
Co-factors: Matrix 3x3
e f d f d e
+ − + + − +
h i g i g h
b c − + −
a c a b
cofactors = − + − + − +
h i g i g h
b c a c a b
+ − +
e f d f d e
+ (ei − fh ) − (di − fg ) + (dh − eg )
= − (bi − ch) + (ai − cg ) − (ah − bg )
+ (bf − ce) − (af − cd ) + (ae − bd )
m1 m2 m3
= m4 m5 m6
m m9
7 m8
37
3.6 Adjoint of a 33 matrix
m1 m2 m3
cofactors = m4 m5 m6
m m9
7 m8
m1 m4 m7
Transpose = m2 m5 m8
m m9
3 m6
adj ( A) = Transpose Cofactors
m1 m4 m7
adj ( A) = m2 m5 m8
m m9
3 m6
38
2.6 Adjoint of a 33 matrix
1 11111 22222
2 33333
3
00
Cofactor matrix of AAAA
A =====0
A= 000 44444
4 55555
5
111 66666
111 00000 6
0
39
1 2 3 24 5 −4
Cofactor matrix of 𝐴 = 0 4 5 is then given by: −12 3 2
1 0 6 −2 −5 4
1 2 3
Adjoint matrix of 𝐴 = 0 4 5 is then given by:
1 0 6
𝑇
24 5 −4 24 −12 −2
−12 3 2 = 5 3 −5
−2 −5 4 −4 2 4
40
2.7 Inverse matrices
a b c
when , A = d e f
g i
h
−1
a b c
−1
A = d e f
g i
h
−1
A =
1
(adj ( A) )
| A|
41
2.7 Inverse of a 33 matrix
1 2 3
Inverse matrix of 𝐴= 0 4 5 is given by:
1 0 6
𝑇
1 24 5 −4 1 24 −12 −2
𝐴−1 = −12 3 2 = 5 3 −5
𝐴 22
−2 −5 4 −4 2 4
12 6 1
− −
11 11 11
5 3 −5
=
22 22 22
2 1 2
−
11 11 11
42
Finding inverse matrix using
Elementary Row Operation (ERO)
A I reduce to I A −1
Ri Ri + kR j
43
RECALL!!!
a1 0b 0c
d e 0f
0 1
g
0 h
0 1i
NOTES: A I I A
−1
44
EXAMPLE
1. Find the inverse matrix of B using ERO method.
2 1
B =
A I reduce to I A
−1
3 4
4 −1
B = 5
−1 5
−3 2
5 5
45
EXAMPLE
46
EXAMPLE A I reduce to I A
−1
47
48
Exercise
3 1 0
− 2 − 4 3
5 4 − 2
49
Answer
4 − 2 − 3
− 11 6 9
− 12 7 10
50