You are on page 1of 27

# UNIT 2

MATRICES
2.1 Introduction
Matrices and Linear Equations made their appearance long time ago. The word
matrix was first introduced by Sylvester(1850). Many of the symbols and
operations that we used today were formalized by Cayley(1841). In the present
day, we use matrices to solve many complex problems of very great importance in
Medical Diagnostic Systems, Public Transport System, Communication Network
and others. In this topic students will be exposed to the operations of matrices,
determine the inverse matrices and hence solve the system of linear equation by
using the matrices.

Objectives
At the end of the topic, students should be able to:
State the size of matrices according to the number of rows and columns.
Perform the algebraic operation on matrices for 2 and 3 rows matrices.
Recognize matrices according to their types .
Determine the inverse matrix by determinant and adjoin method for 3 by 3
matrices.
Solve the system of linear equation using the inverse matrix method and the
Cramers rule for 3 by 3 matrices.
39

2.2 Definition of Matrices
2.2.1 Size and Symbol
Matrices have columns and rows.
Let
1
]
1

4 3
2 1
A

A symbol of a matrix can be written as :
( ) or [ ]
2.2.2 Element of Matrices
Each number in a matrix is called the element of the matrix.
If
1
]
1

4 3
2 1
A
,
so numbers like 1, 2, 3, and 4 are the elements of matrix A.
2.2.3 Size of a Matrix
The size of a matrix is determined by the number of its rows and columns.
If a matrix has m rows and n columns, so the size of the matrix is (m by n) or can
also be written as (
n m
).
If
1
]
1

1 1 2
2 3 1
B
.
The size of matrix B is (2 3) or we can say B is a (2 by 3) matrix.
40
row 1
row 2
Column 1 Column 2
Example 2.1
Given matrix
1
1
1
]
1

2 2 3
1 2 4
3 1 2
A
.
(a) State the size of matrix A.
(b) Determine the elements of
12
A and
33
A
.
2.3 Operation and Types of Matrices
2.3.1 Addition of Matrices
Addition of matrices can be done if the matrices involve are of equal size.
Example 2.2
If
1
]
1

1
]
1

2 1
2 2
3 2
4 1
B A
.
size : 2 by 2 size : 2 by 2
It means matrix A and matrix B can be added. How to do it?
Add the elements of the same row and column.
Solution:
41
3.1.2 Subtraction of Matrices
The same condition applies to the subtraction of matrices.
Subtract the same elements of rows and columns.
Example 2.3
1
]
1

1
]
1

2 1
2 2
,
3 2
4 1
B A
Solution
2.3.3 Multiplication of a Matrix with a Constant
Example 2.4
If given
1
]
1

1 3
2 1
C
, determine 2C.
Solution:
2.3.4 Multiplication of Matrices
42
Two matrices can be multiplied if the number of column for the first matrices and
the number of rows for the second matrices are equal.
If A = m by p matrix and B = p by n matrix, can A be multiplied with B?
Let us check!
The number of columns of A = p and the number of rows of B = p.
EQUAL so A and B can be multiplied.
Can you guess the size of the product?
matrix ) ( matrix ) ( matrix ) ( p m n p p m
So the product of AB has m rows and p columns.
Let
1
]
1

23 22 21
13 12 11
a a a
a a a
A
and
1
1
1
]
1

32 31
22 21
12 11
b b
b b
b b
B
.
( 2 by 3) (3 by 2)
Can we get the product of AB?
Let us check the number of columns of matrix A and the number of rows of
matrix B.
The size of matrix A = 2 by 3 so the number of columns = 3.
The size of matrix B = 3 by 2 so the number of rows = 3.
EQUAL!
We can get the product. Can you guess the size of the product?
Of course, it is a 2 by 2 matrix.
How to get the product of AB?
1
]
1

+ + + +
+ + + +

1
1
1
]
1

1
]
1

32 23 22 22 12 21 32 23 21 22 11 21
32 13 22 12 12 11 31 13 21 12 11 11
32 31
22 21
12 11
23 22 21
13 12 11
b a b a b a b a b a b a
b a b a b a b a b a b a
b b
b b
b b
a a a
a a a
AB
Note : Make the first row of matrix A has been multiplied by every column
of matrix B. Then, only you move to the second row of matrix A.
43
Example 2.5
Given
1
]
1

1
]
1

3
2
and
1 3
2 1
B A
. Find AB.
Solution:
Example 2.6
Given
1
]
1

1
]
1

4 2
5 1
and
2 3
0 1
B A
. Find AB.
Solution:
Check whether A and B can be multiplied. How?
Size of A = 2 by 2, number of columns = 2.
Size of B = 2 by 2, number of rows = 2.
EQUAL, it means A and B can be multiplied.
Can you guess the size of the product, AB?
Of course, a 2 by 2 matrix.
Example 2.7
44
Given
1
1
1
]
1

1
]
1

1 1 2
0 3 1
4 0 1
and
1 1 3
0 2 1
B A
. Find AB.
Solution:
Characteristics of matrix multiplication
(i) (mAB) = m(AB)
45
(ii) A(BC) = (AB)C
(iii) (A + B)C = AC + BC
(iv) C(A + B) = CA + CB
(v)
T T T
A B AB ) (
Note : T is the symbol of a transpose matrix.
If
1
]
1

1
]
1

4 2
3 1
then
4 3
2 1
T
A A
.
If
1
1
1
]
1

1
1
1
]
1

9 6 3
8 5 2
7 4 1
then
9 8 7
6 5 4
3 2 1
T
B B
.
Can you see what happened here?
The process of transposition changes the first row to be the first column, the
second row to be the second column and so on.
2.3.5 Types of Matrices
Here are a couple of examples of different types of matrices:
A. Symmetric

1
1
1
]
1

1
]
1

6 5 3
5 0 2
3 2 1
1 2
2 1
.
B. Diagonal

1
1
1
]
1

1
]
1

6 0 0
0 4 0
0 0 1
4 0
0 1
.
C. Upper Triangular

1
1
1
]
1

1
]
1

6 0 0
5 7 0
3 2 1
1 0
2 1
.
46
D. Lower Triangular

1
1
1
]
1

1
]
1

3 5 3
0 7 2
0 0 1
1 2
0 1
.
E. Zero

1
1
1
]
1

1
]
1

0 0 0
0 0 0
0 0 0
0 0
0 0
.
F. Identity

1
1
1
]
1

1
]
1

1 0 0
0 1 0
0 0 1
1 0
0 1
.
Practice 2.1
1. Solve the equation of the following matrices.
1
]
1

1
]
1

+
5 4
3 1
5 2
2 1
y
x
.
47
2. Given

,
_

,
_

,
_

0 1
1 0
2 1
and
1 1 2
1 0 1
,
4 2 1
1 1 2
C B A
.
Calculate A + B and B + C.
3. Given
1
]
1

1
]
1

1
]
1

1 0
0 1
and
3 0
1 2
,
1 3
2 1
C B A
.
Calculate
(a) 3A .
(b) 2B + 3C.
(c) BC.
(d) (BC)
T
.
2.4 Determinants, Minor, Adjoin, and Inverse Matrix
2.4.1 Determinants
Determinants play an important role in finding the inverse of a matrix and also in
solving system of linear equations. In the following we assume we have a square
48
matrix (m rows = m columns). The determinant of a matrix A will be donated by
det(A) or
A
.
Determinant of a 3 by 3 matrix.
Assume
1
1
1
]
1

33 32 31
23 22 21
13 12 11
a a a
a a a
a a a
A
.
det(A) =
A

32 31
22 21
13
33 31
23 21
12
33 32
23 22
11
33 32 31
23 22 21
13 12 11
a a
a a
a
a a
a a
a
a a
a a
a
a a a
a a a
a a a
+

Example 2.8
Given
1
1
1
]
1

5 4 3
3 3 2
1 1 1
A
. Find det(A).
2.4.2 Minor and Cofactor
A. Minor for a 3 by 3 matrix.
Assume
1
1
1
]
1

33 32 31
23 22 21
13 12 11
a a a
a a a
a a a
A
.
49
Minor for
33 32
23 22
11
is
a a
a a
a
.
Minor for
33 32
23 21
12
is
a a
a a
a
.
Minor for
32 31
22 21
13
is
a a
a a
a
.
By now, you can figure out how to determine the minor of an element. Minor is
formed by excluding the row and column of the element involved.
Example 2.9
Given
1
1
1
]
1

5 4 3
3 3 2
1 1 1
A
. Determine the minor for the first rows elements.
B. Cofactor of a 3 by 3 matrix
Cofactor for elements ij
a
is defined as :
ij
j i
ij
A
+
) 1 (
. ij

## is the minor for the element of row i and column j.

Example 2.10
Given
1
1
1
]
1

5 4 3
3 3 2
1 1 1
A
.
50
Cofactor matrix of
33 32 31
23 22 21
13 12 11
A A A
A A A
A A A
A
.
1 1 ) 1 ( 1 . ) 1 (
1 1 ) 1 ( 1 ) 1 (
0 0 ) 1 ( 0 ) 1 (
1 1 . ) 1 ( 1 ) 1 (
2 2 ) 1 ( 2 ) 1 (
1 1 ) 1 ( 1 ) 1 (
1 ) 1 ( ) 1 ( ) 1 ( ) 1 (
1 1 ) 1 ( 1 ) 1 (
3 3 ) 1 ( 3 ) 1 (
6 3 3
33
5 2 3
32
4 1 3
31
5 3 2
23
4 2 2
22
3 1 2
21
4 3 1
13
3 2 1
12
2 1 1
11

+
+
+
+
+
+
+
+
+
A
A
A
A
A
A
A
A
A
So the cofactor matrix of A is defined as :
Cofactor
1
1
1
]
1

1 1 0
1 2 1
1 1 3
A
.
Adjoin matrix is defined as the transpose of the cofactor matrix.
T
ij
A A ] [ ) ( adj
Example 2.11
1
1
1
]
1

5 4 3
3 3 2
1 1 1
A
and cofactor
1
1
1
]
1

1 1 0
1 2 1
1 1 3
A
1
1
1
]
1

1 1 1
1 2 1
0 1 3
A
.
51
2.4.4 Inverse Matrix
Assuming we have a square matrix A, which is non-singular ( det(A) 0 ), then
there exists matrix
1
A
which is called the inverse of A, such that this property
holds :
I A A AA
1 1
where I is the identity matrix.
The inverse of any square matrix, size of n by n is given by :
) det(
) (
1
A
A

.
Example 2.12
Given
1
1
1
]
1

5 4 3
3 3 2
1 1 1
A
. We have found earlier that adjoin
1
1
1
]
1

1 1 1
1 2 1
0 1 3
A
.
Det(A) = 1 .
So
) det(
) (
1
A
A

=
1
1 1 1
1 2 1
0 1 3
1
1
1
]
1

=
1
1
1
]
1

1 1 1
1 2 1
0 1 3
.
If we want to make sure the inverse matrix is indeed the inverse of matrix A, then
we have to multiply matrix A with the inverse matrix,
1
A
.
By definition,
I A A AA
1 1
where I is the identity matrix.
So,
1
1
1
]
1

5 4 3
3 3 2
1 1 1
A
and
1
1
1
]
1

1 1 1
1 2 1
0 1 3
1
A
.
52
1
1
1
]
1

1
1
1
]
1

1 1 1
1 2 1
0 1 3
5 4 3
3 3 2
1 1 1
1
AA
=
1
1
1
]
1

+ +
+ +
+ +
5 4 0 5 8 3 5 4 9
3 3 0 3 6 2 5 3 6
1 1 0 1 2 1 1 1 3

=
1
1
1
]
1

1 0 0
0 1 0
0 0 1
.
The product is an identity matrix so the inverse matrix that we got is correct.
Practice 2.2
1. Given
1
1
1
]
1

3 4 1
4 3 1
3 2 1
A
. Find the
1
A
.
2. Given
1
1
1
]
1

1 1 3
2 3 2
3 2 1
A
.
(a) By following the four steps, find the
1
A
.
(b) Show that the inverse matrix in (a) is correct.
Solution

2.5 The System of Linear Equations
Solving the system of linear equations by using matrices.
A system of linear equations is a set of equations with n equations and n
unknowns, is of the form of

. .......
. . .
. . .
.......
.......
2 2 1 1
2 2 2 22 1 21
1 1 2 12 1 11
n n nn n n
n n
n n
b x a x a x a
b x a x a x a
b x a x a x a
+ + +
+ + +
+ + +
53
The unknowns are denoted by n
x x x ......., , ,
2 1 and the coefficient (as and bs)
are assumed to be given. In matrix form the system of equations above can be
written as :

1
1
1
1
]
1

1
1
1
1
]
1

1
1
1
1
]
1

n n nn n n
n
n
b
b
b
x
x
x
a a a
a a a
a a a
: :
........
: : : :
........
........
2
1
2
1
2 1
2 22 21
1 12 11
A X B
A simplified way of writing, AX = B.
Example 2.13
Express the system of linear equations given below in matrix form.
(a)
. 5 3
3 2

+
y x
y x
(b)
. 3 2 3
2 2 3
1 2
+ +
+
+
z y x
z y x
z y x
Solution:
54
2.5.1 Inverse Matrix Method
The inverse matrix method uses the inverse of a matrix to help solve a system of
linear equations, such like the above, AX = B.
Multiply both sides with
1
A
.
B A X A A
B A AX A
B AX
) ( ) (
) ( ) (
1 1
1 1

So it means
B A X
1

## By calculating the inverse of a matrix and multiplying this by matrix, B we can

find the solution to the system of equations directly.
Looking at three equations we might have that
w vz uy tx
s rz qy px
d cz by ax
+ +
+ +
+ +
55
Written in matrix form would look like

1
1
1
]
1

1
1
1
]
1

1
1
1
]
1

w
s
d
z
y
x
v u t
r q p
c b a
.
By rearranging we would get that the solution would look like

1
1
1
]
1

1
1
1
]
1

1
1
1
]
1

w
s
d
v u t
r q p
c b a
z
y
x
1
.
Example 2.14
Solve the given the system of linear equations,
. 3 5 4 3
1 3 3 2
2
+ +
+ +
+ +
z y x
z y x
z y x
Solution
56
2.5.2 Cramers Rule
Cramers rule uses a method of determinants to solve system of equations.
Let the system of equations be written as AX = B.
1
1
1
]
1

1
1
1
]
1

1
1
1
]
1

3
2
1
33 32 31
23 22 21
13 12 11
b
b
b
z
y
x
a a a
a a a
a a a
.
Here,
1
1
1
]
1

33 32 31
23 22 21
13 12 11
a a a
a a a
a a a
A
.
A
A
x
1

where
1
1
1
]
1

33 32 3
23 22 2
13 12 1
1
a a b
a a b
a a b
A
. Note : column
31
21
11
a
a
a
is replaced by
3
2
1
b
b
b
.
A
A
y
2

where
1
1
1
]
1

33 3 31
23 2 21
13 1 11
2
a b a
a b a
a b a
A
. Note : column
32
22
12
a
a
a
is replaced by
3
2
1
b
b
b
.
57
A
A
z
3

where
1
1
1
]
1

3 32 31
2 22 21
1 12 11
3
b a a
b a a
b a a
A
. Note : column
33
23
13
a
a
a
is replaced by
3
2
1
b
b
b
.
Example 2.15
Solve the system of linear equations below by using the Cramers rule.
. 3 2
4 2
1 3 2
+
+
+
z y x
z y x
z y x
Solution:
58
Practice 3.3
1. Solve the system of linear equations given by the inverse matrix method.

. 3 4 3
2 3 4
1 3 3
+ +
+ +
+ +
z y x
z y x
z y x
Solution
59
2. Solve the given system by using the Cramers rule.

. 2 2 3
1 2
1 2
+ +
+
+ +
z y x
z y
z y x
Solution
60

EXERCISE
1. Find the values of a, b, c and d if
(a)
1
]
1

1
]
1

1 8 4 2
4 3 6
1 2 4
4 2 2
d
c
b
a
.
(b)
1
]
1

1
]
1

+ b
c
b d
a
2 1
2
3
4 3
2
2
.
2. Given
1
]
1

1
1
1
]
1

1
1
1
]
1

2 2
4 3
and
1 1
2 1
1 2
,
1 2
0 4
1 3
C B A
.
Calculate,
(a) A + 2B.
(b) BA.
(c)
T
BC) ( .
3. Find the determinants of the followings.
(a)
1 5 0
2 3 2
4 0 3

. (b)
1 4 1
2 1 3
3 4 2

.
61
4. Given
1
]
1

cos sin
sin cos
B
.
Calculate,
(a)
2
B
. (b)
3
B
.
5. Given
1
1
1
]
1

1
1
1
]
1

r q
p B A
0
3 0
0 5 5
,
0 1 0
2 1 0
1 2 1
.
Calculate,
(a) AB. (b) BA.
(c) Hence, determine the values of p, q and r if AB = BA.
6. Find the inverse matrices of the given matrices below.
(a)
1
1
1
]
1

5 2 4
0 1 2
3 2 1
A
. (b)
1
1
1
]
1

3 0 1
0 2 1
1 1 2
B
.
(c)
1
1
1
]
1

11 2 5
4 1 2
6 1 3
C
. (d)
1
1
1
]
1

1 1 2
2 1 2
2 2 1
D
.
7. Solve the system of linear equations given by using
(i) the inverse method
(ii) the Cramers rule
(a)
11 2 7 3
5 4 3
3 2
+
+
+
z y x
z y x
z y x
. (b)
0 4 3
1
3 2
+
+
+
z y x
z x
z y x
.
62
(c)
1 3 3
3 2
2 2 5 3
+
+
+
z y x
z y x
z y x
. (d)
13 6 3
6 3 2
2
+ +
+ +
+ +
z y x
z y x
z y x
.
1. (a) a = -4, b = -4, c = 1, d = -0.5
(b) a = -3, b = 14, c = -1.33, d = 0.5
2. (a)
1
1
1
]
1

3 4
4 6
1 7
(b) cannot multiply (c)
1
]
1

6 8 10
5 7 8
3. (a) 1 (b) -5
4. (a)
1
]
1

2 cos 2 sin
2 sin 2 cos
(b)
1
]
1

3 cos 3 sin
3 sin 3 cos
5. (a)
1
1
1
]
1

+ +
+ +
p
r p q
r p q
3 0
2 2 3 0
2 11 5
(b)
1
1
1
]
1

+
+
q r q
p
2 0
6 3 0
15 15 5
(c) p = 8, q = 4, r = -1
6. (a)
1
1
1
]
1

5 6 8
6 7 10
3 4 5
(b)
1
1
1
]
1

43 . 0 14 . 0 29 . 0
14 . 0 71 . 0 43 . 0
29 . 0 43 . 0 86 . 0
(c)
1
1
1
]
1

1 1 1
0 3 2
2 1 3
(d)
1
1
1
]
1

1 1 0
67 . 0 1 67 . 0
67 . 0 0 33 . 0
7. (a) x = 1, y = 2, z = 3
(b) x = 3, y = 1, z = -2
(c) x = 2, y = 6, z = 13
(d) x = 1, y = -2, z = 3
63
Activity
1. The manufacture of an automobile requires painting, drying, and polishing. The
Parit Motor Company produces three types of cars : the Bengkok, the Jambol, and
the Botak. Each Bengkok requires 8 hours for painting, 2 hours for drying, and 1
hour for polishing. A Jambol needs 10 hours for painting, 3 hours for drying, and
two hours for polishing. It takes 16 hours of painting, 5 hours of drying, and 3
hours of polishing to prepare a Botak. The company uses 240 hours for painting,
69 hours for drying, and 41 hours for polishing in a given month. As the General
Manager, you have to determine how many of each type of car are produced.
You have to submit the report to your Board of Directors three days from now.
2. Mahkota Sdn Bhd produces luggage of three types : economy, standard and
deluxe. The company produces 1000 pieces of luggage at a cost of RM 20, RM
25, and RM 30 for the economy, standard, and deluxe luggage respectively.
Mahkota Sdn Bhd has a budget of RM 20,700. Each economy luggage requires 6
hours of labor, each standard luggage requires 10 hours of labor, and each deluxe
model requires 20 hours of labor. Mahkota Sdn Bhd has a maximum of 6800
hours of labor available. However, Mahkota sells all the luggage, consumes the
entire budget, and uses all the available labor.
Considering facts given, as the General Manager of Mahkota Sdn Bhd, you have
to determine how many of each type of luggage should be produced. Please do it
as fast as you can, because you have to report it in the next meeting which is two
days from now.