MATH 5 Lesson 3
MATH 5 Lesson 3
MATRICES
An m×n matrix is a rectangular array of numbers (m rows and n columns)
enclosed in brackets. The numbers are called the elements of the matrix.
Examples:
1. A 2×3 matrix has 2 rows and 3 columns:
1 2 3
5 6 7
1
5
8
4. Row vectors are matrices which only have one row:
[3 -1 7]
Special matrices
The unit matrix I is a square matrix whose only non-zero elements are on the
diagonal and are equal to one, e.g.
1 0 0 0
1 0 0
1 0 0 1 0 0
𝐼= , 0 1 0 ,
0 1 0 0 ⋱ 0
0 0 1
0 0 0 1
MATH 5
Zero matrix 0 : All elements of the zero matrix are equal to zero, e.g.
0 0 0 0 0 ⋯ 0
0 0 0 0 ⋯ 0
, 0 0 0 ,
0 0 ⋮ ⋮ ⋱ ⋮
0 0 0 0 0 ⋯ 0
MATH 5
A diagonal matrix only has non-zero elements on the main diagonal. These
non-zero elements can have any value, e.g.
𝑑11 0 ⋯ 0
𝑑11 0 0
𝑑11 0 0 𝑑22 ⋯ 0
𝐷= , 0 𝑑22 0 ,
0 𝑑22 ⋮ ⋮ ⋱ ⋮
0 0 𝑑33
0 0 ⋯ 𝑑𝑛𝑛
MATH 5
Upper triangular matrix: all the elements under the main diagonal are zero
and the others can have any value, e.g.
2 5 1 −3
1 3 7
2 −1 0 9 7 6
𝑈= , 0 −5 −1 ,
0 5 0 0 1 4
0 0 2
0 0 0 −2
Lower triangular matrix: all the elements above the main diagonal are zero
and the others can have any value, e.g.
3 0 0 0
1 0 0
2 0 2 −5 0 0
L= , 2 −4 0 ,
1 −3 0 9 2 0
7 3 5
4 −6 1 7
MATH 5
Matrix algebra
1. Matrix Equality
Two matrices are equal if they have the same size and if their corresponding
elements are identical , i.e.
A=B
if and only if:
aij = bij , for i = 1,….., m ; j = 1,……, n
MATH 5
Examples:
1 −2 3 2 4 4
1. If A = ,B= then A ≠ B
5 7 −9 3 5 2
(same size but the corresponding elements are not equal)
1 0
1 3 9
2. If A = 3 −5 , B = then A ≠ B
0 −5 6
9 6
(different size)
1 2 1 −2
3. If A = ,B= then A ≠ B
−3 7 −3 7
( same size but a12 ≠ b12 )
MATH 5
Examples:
1 0 a b
A= , B= , given that A = B, find a, b, c, and d?
−4 2 c d
MATH 5
Examples:
1 0 a b
A= , B= , given that A = B, find a, b, c, and d?
−4 2 c d
Sol.
A=B
a=1
b=0
c = -4
d=2
MATH 5
Matrix algebra
2. Matrix Addition
Two matrices can only be added if they have the same size. The result is another
matrix of the same size. We add matrices by adding their corresponding
elements, i.e.
C=A+B
cij = aij + bij for i = 1,….., m ; j = 1,……, n
MATH 5
Matrix algebra
2. Matrix Addition
Two matrices can only be added if they have the same size. The result is another
matrix of the same size. We add matrices by adding their corresponding
elements, i.e.
C=A+B
cij = aij + bij for i = 1,….., m ; j = 1,……, n
MATH 5
Example
1 2 3 10 1 23
if A = ,B= find:
5 6 7 5 16 3
1. C = A + B ?
2. D = B – A ?
MATH 5
Example
1 2 3 10 1 23
if A = ,B= find:
5 6 7 5 16 3
1. C = A + B ?
MATH 5
Example
1 2 3 10 1 23
if A = ,B= find:
5 6 7 5 16 3
𝟏𝟏 𝟑 𝟐𝟔
1. C = A + B =
𝟏𝟎 𝟐𝟐 𝟏𝟎
MATH 5
Example
1 2 3 10 1 23
if A = ,B= find:
5 6 7 5 16 3
2. D = B – A ?
MATH 5
Example
1 2 3 10 1 23
if A = ,B= find:
5 6 7 5 16 3
𝟗 −𝟏 𝟐𝟎
2. D = B – A =
𝟎 𝟏𝟎 −𝟒
MATH 5
Sol.
1 + 10 2+1 3 + 23 11 3 26
C=A+B= =
5+5 6 + 16 7+3 10 22 10
10 − 1 1−2 23 − 3 9 −1 20
D=B–A= =
5−5 16 − 6 3−7 0 10 −4
MATH 5
Example:
3 5 −2
If A = 4 2 4 find 3A?
3 −4 3
MATH 5
Example:
3 5 −2
If A = 4 2 4 find 3A?
3 −4 3
Sol.
3×3 3 × 5 3 × −2 9 15 −6
3A = 3 × 4 3×2 3 × 4 = 12 6 12
3×3 3 × −4 3 × 3 9 −12 9
MATH 5
This implies that the number of columns of the first matrix must
be equal to the number of rows in the second matrix.
MATH 5
2 1
1 2 3 2
C= , D= 5 6
5 −7 6 −2
9 −2
−9 0 −1 7
3 7
3×4 4×2
MATH 5
Ex:
1 2 4 3 2
Find AB if A = ,B = ?
3 4 2 1 1
MATH 5
Sol.
4 3 2
1 2 1 2 1 2
AB = 2 1 1
4 3 2
3 4 3 4 3 4
2 1 1
𝟖 𝟓 𝟒
𝐀𝐁 =
𝟐𝟎 𝟏𝟑 𝟏𝟎
MATH 5
𝟖 𝟓 𝟒
AB =
𝟐𝟎 𝟏𝟑 𝟏𝟎
MATH 5
𝟖 𝟓 𝟒
AB =
𝟐𝟎 𝟏𝟑 𝟏𝟎
MATH 5
𝟖 𝟒 𝟏𝟎 𝟔
AB = BA =
𝟏𝟏 𝟗 𝟕 𝟕
MATH 5
1 × −1 + 1 × 1 1 × 1 + 1 × (−1) 𝟎 𝟎
AB = =
2 × −1 + 2 × 1 2 × 1 + 2 × (−1) 𝟎 𝟎
−1 1 1 1 −1 × 1 + 1 × 2 −1 × 1 + 1 × 2
BA = . =
1 −1 2 2 1 × 1 + (−1) × 2 1 × 1 + (−1) × 2
𝟏 𝟏
=
−𝟏 −𝟏
MATH 5
1 1 2 1 1×2+1×2 1×1+1×2 𝟒 𝟑
AB = . = =
2 2 2 2 2×2+2×2 2×1+2×2 𝟖 𝟔
1 1 3 0 1×3+1×1 1×0+1×3 𝟒 𝟑
AC = . = =
2 2 1 3 2×3+2×1 2×0+2×3 𝟖 𝟔
MATH 5
5 1
B+C=
3 5
1 1 5 1 8 6
A(B+C) = . =
2 2 3 5 16 12
MATH 5
5 1 4 3 4 3
B+C= AB = , AC =
3 5 8 6 8 6
1 1 5 1 8 6 4 3 4 3 8 6
A(B+C) = . = AB + AC = + =
2 2 3 5 16 12 8 6 8 6 16 12
MATH 5
Transpose of a matrix.
Example
1 2 3
Find AT if A = ?
5 6 7
MATH 5
Example
1 2 3
Find AT if A = ?
5 6 7
Sol.
1 5
AT = 2 6
3 7
MATH 5
3 2 −1 3 2 −1
A= 2 7 0 , AT = 2 7 0
−1 0 8 −1 0 8
MATH 5
Determinant of a matrix
From https://www.purplemath.com/modules/determs.htm
MATH 5
Determinant of a matrix
When written out, the determinant swaps out the matrix's square brackets for
absolute-value bars.
Determinant of a matrix
Example
1 2
Find det. A if A = ?
4 −7
MATH 5
Example
1 2
Find det. A if A = ?
4 −7
Sol.
1 2
A = = 1 × −7 − 2 × 4 = −15
4 −7
MATH 5
MATH 5
Determinant of a matrix
A = 𝑎11 𝑎22 𝑎33 − 𝑎23 𝑎32 − 𝑎12 𝑎21 𝑎33 − 𝑎23 𝑎31 + 𝑎13 𝑎21 𝑎32 − 𝑎22 𝑎31 .
MATH 5
Example
3 −5 3
Find det. A if A = 2 1 −1 ?
1 0 4
MATH 5
Example
3 −5 3
Find det. A if A = 2 1 −1 ?
1 0 4
3 −5 3
Sol. A = 2 1 −1
1 0 4
1 −1 2 −1 2 1
=3 − −5 + 3
0 4 1 4 1 0
= 3(4) + 5(9) + 3(-1)
= 54
MATH 5
Example
3 −5 3
Find det. A if A = 2 1 −1 ?
1 0 4
Minor and Cofactor
of a Matrix
MATH 5
Cofactors
Cofactors
MATH 5
Example
2 1 4
Find the cofactors matrix of A = 5 2 3 ?
8 7 3
MATH 5
Example
Sol.
5 3
𝑐12 = (−1)1+2
= (−1) 5 × 3 − 3 × 8 = (-1).(-9) = 9
8 3
2 4
𝑐22 = (−1) 2+2
= −1 2 × 3 − 4 × 8 = 1 . −26 = −26 , etc...
8 3
MATH 5
Example
−2 3
Find the cofactors matrix of A = ?
7 11
Sol.
1+1
𝑐11 = −1 11 = 1 . 11 = 11