Matrices Study Guide
Matrices Study Guide
INTRODUCTION TO
MATRICES AND LINEAR
EQUATIONS
49
in the form: ⎛ ⎞
a11 a12 ... a1n
⎜ ⎟
⎜ ⎟
⎜ a21 a22 . . . a2n ⎟
⎜ ⎟
⎜ ⎟
⎜. . . . . . . . . . . . . . . . . . . . .⎟
⎝ ⎠
am1 am2 . . . amn
The number aij is called an entry or member, which is in row i and column j
of the matrix. A matrix with m rows and n columns is called an m by n matrix,
written m × n. The pair of numbers m and n is called the order or size of the
matrix.
• A square matrix is one which has the same number of rows as columns
i.e. m × n matrix with (m⎛ = n). ⎞
⎛ ⎞ 1 3 −1
0 8 ⎜ ⎟
⎝ ⎠ ⎜ ⎟
e.g. A = B = ⎜4 −7 1 ⎟ where A is 2 × 2 and B is 3 × 3
12 −1 ⎝ ⎠
1 2 −5
matrices respectively.
• A matrix with all entries equal to zero is called a zero matrix, and is
denoted by 0⎛m×n ; ⎞
0 0 0
e.g. 02×3 = ⎝ ⎠
0 0 0
50
⎛ ⎞
1
⎜ ⎟
⎜ ⎟
B = ⎜−7⎟
⎝ ⎠
8
• Two ⎛
matrices are equal
⎞ if ⎛
their sizes and⎞corresponding
⎛ entries⎞are equal;
0 8 12 1 3 −1 0 8 12
A=⎝ ⎠; B = ⎝ ⎠; C = ⎝ ⎠, then
−2 5 −1 4 −7 1 −2 5 −1
A = B; B = C; A = C.
• A diagonal matrix is one with at least one non-zero entry in the leading
(main) diagonal and zeroes everywhere;
⎛ ⎞
9 0 0
⎜ ⎟
⎜ ⎟
A = ⎜0 0 0 ⎟
⎝ ⎠
0 0 −2
• A matrix
⎛ A is symmetric
⎞ if At =⎛A; ⎞
5 8 −3 5 8 −3
⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ ⎟
A = ⎜ 8 −1 −4⎟ then At = ⎜ 8 −1 −4⎟.
⎝ ⎠ ⎝ ⎠
−3 −4 0 −3 −4 0
• Scalar multiple: Given a matrix A and a real number k, then the matrix
kA is a matrix obtained by multiplying each entry of matrix A by k. The
matrix kA is called a matrix multiple of A. When dealing with matrices,
real numbers are often called scalars hence the scalar multiplication
for multiplying A by k.
51
⎛ ⎞
2 −3 3
E.g.: If A = ⎝ ⎠, then
0 −1 5
⎛ ⎞
−6 9 −9
−3A = ⎝ ⎠
0 3 −15
and ⎛ ⎞
1 1 − 32 3
A=⎝ 2⎠
2 −1 5
0 2 2
We can only add or subtract two matrices if they have the same order. The
sum or difference of two matrices is obtained by adding or subtracting the
corresponding entries respectively. If
⎛ ⎞ ⎛ ⎞
a11 a12 a13 b b12 b13
A=⎝ ⎠ , B = ⎝ 11 ⎠,
a21 a22 a23 b21 b22 b23
then
⎛ ⎞ ⎛ ⎞ ⎛ ⎞
a11 a12 a13 b11 b12 b13 a11 + b11 a12 + b12 a13 + b13
A+B = ⎝ ⎠+⎝ ⎠=⎝ ⎠
a21 a22 a23 b21 b22 b23 a21 + b21 a22 + b22 a23 + b23
Example 2.1.2.
⎛ ⎞ ⎛ ⎞
−1 8 ⎛ ⎞ 0 −1 ⎛ ⎞
⎜ ⎟ 1 3 ⎜ ⎟ 9 0
⎜ ⎟ ⎠;C = ⎜ ⎟
A=⎜ 5 0 ⎟;B = ⎝ ⎜1 0 ⎟;D = ⎝ ⎠.
⎝ ⎠ 4 −7 ⎝ ⎠ −3 −6
2 −3 −2 −5
⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
−1 8 0 −1 −1 + 0 8 + (−1) −1 7
⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎟
A+C = ⎜ 5 0 ⎟+⎜ 1 0 ⎟=⎜ 5+1 0+0 ⎟=⎜ 6 0 ⎟.
⎝ ⎠ ⎝ ⎠ ⎝ ⎠ ⎝ ⎠
2 −3 −2 −5 2 + (−2) −3 + (−5) 0 −8
52
⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞
1 3 9 0 1−9 3−0 −8 3
B−D =⎝ ⎠−⎝ ⎠=⎝ ⎠=⎝ ⎠.
4 −7 −3 −6 4 − (−3) −7 − 6 7 −13
A ± B; A ± D; B ± C or C ± D do not exist.
⎛ ⎞⎛ ⎞ ⎛ ⎞
a11 a12 ... a1n b11 b12 ... b1q c11 a12 ... a1q
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ a21 a22 . . . a2n ⎟ ⎜ b21 b22 . . . b2q ⎟ ⎜ a21 a22 . . . a2q ⎟
⎜ ⎟⎜ ⎟=⎜ ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ . . . . . . . . . . . . . . . . . . . . . ⎟ ⎜. . . . . . . . . . . . . . . . . . .⎟ ⎜. . . . . . . . . . . . . . . . . . . . .⎟
⎝ ⎠⎝ ⎠ ⎝ ⎠
am1 am2 . . . amn bn1 bn2 . . . bnq am1 am2 . . . amq
n
Where cij = ai1 b1j + ai2 b2j + . . . + ain bnj = k=1 aik bkj .
Example 2.1.4.
⎛ ⎞
⎛ ⎞ −3 4 0
−1 −3 5 ⎜ ⎟
A=⎝ ⎠ 2 × 3 matrix; B = ⎜
⎜1 5
⎟
−1⎟ 3 × 3 matrix.
2 0 −4 ⎝ ⎠
2 0 3
53
AB exist since number of column in A is same as number of rows in B.
⎛ ⎞
⎛ ⎞ −3 4 0
−1 −3 5 ⎜ ⎟
AB = ⎝ ⎠⎜ ⎜ 1 5 −1⎟
⎟
2 0 −4 ⎝ ⎠
2 0 3
⎛ ⎞
(−1)(−3) + (−3)(1) + (5)(2) (−1)(4) + (−3)(5) + 5(0) (−1)(0) + (−3)(−1) + 5(3)
=⎝ ⎠
2(−3) + 0(1) + (−4)(2) 2(4) + 0(5) + (−4)(0) 2(0) + 0(−1) + (4)(−3)
⎛ ⎞
10 −19 18
=⎝ ⎠
−14 8 −12
(i) A + B = B + A
(ii) (A + B) + C = A + (B + C)
(iii) A(B + C) = AB + AC
(v) k(A + B) = kA + kB
(vi) (A + B)t = At + B t
(vii) (AB)t = B t At
54
(viii) AB = BA
(a) Which of the matrices above are: (i) Diagonal matrix; (ii) Square
matrix; (iii) Symmetric; (iv) Identity matrix; (v) Zero Matrix (vi)
Column Matrix; (vi) Row matrix.
(c) Which of the following operations are possible? Where the opera-
tions are possible evaluate: AC; B 3 ; C t F ; DEB; At C − B; (3E t )B;
(−3I3 − D)t ; HGB CGt .
(d) Write down the following entries: (i) b22 in B; (ii) e32 in E; (iii) a31
in A; (iv) f23 in F
2. Solve
⎛ for a, b, c and ⎞
d given
⎛ that ⎞ ⎛ ⎞ ⎛ ⎞
2a − b 3c − d 7 −3 a 3b 3 b−3
(i) ⎝ ⎠ = ⎝ ⎠ (i) 5 ⎝ ⎠+⎝ ⎠ =
c + d a + 4b 0 −4 2c −d 0 −4
⎛ ⎞
2a b−a
⎝ ⎠
3c + d 7d
55
⎛ ⎞
x 2x xy
⎜ ⎟
⎜ ⎟
5. Determine x and y such that the given matrix is symmetric: A = ⎜y −1 x ⎟.
⎝ ⎠
y x2 x
We shall see how to apply this from next examples as well throughout the
chapter.
Example
⎛ 2.2.2. The⎞ following
⎛ matrices are in
⎞ a row echelon form:
1 0 −2 3 1 8 −2 7 2
⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ ⎟
⎜0 1 −1 −4⎟ ⎜0 0 1 3 1⎟
(a) ⎜
⎜
⎟ (b) ⎜
⎟ ⎜
⎟.
⎟
⎜0 0 1 0⎟ ⎜0 0 0 1 1⎟
⎝ ⎠ ⎝ ⎠
0 0 0 1 0 0 0 0 0
56
• every column with a leading one has zeros elsewhere.
Example
⎛ 2.2.4. ⎞The following
⎛ matrices⎞are in a reduced row echelon form:
1 0 0 0 1 0 0 0 3
⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ ⎟
⎜0 1 0 0⎟ ⎜0 0 1 0 0⎟
⎜
(a) ⎜ ⎟ ⎜ ⎟.
⎟ (b) ⎜ ⎟
⎜0 0 1 0⎟ ⎜0 0 0 1 2⎟
⎝ ⎠ ⎝ ⎠
0 0 0 1 0 0 0 0 0
Example 2.2.5. Reduce the following matrix and leave your answer in
57
Solution: (a)
⎛ ⎞
1 1 1 1 1 3
⎜ ⎟
⎜ ⎟
⎜2 1 1 1 2 4⎟
⎜ ⎟
⎜ ⎟
⎜1 −1 −1 1 1 5⎟
⎝ ⎠
1 0 0 1 1 4
⎛ ⎞
1 1 1 1 1 3
⎜ ⎟
⎜ ⎟
⎜0 −1 −1 −1 0 −2⎟ R2 − 2R1
∼⎜
⎜
⎟
⎟
⎜0 −2 −2 0 0 2 ⎟ R3 − R 1
⎝ ⎠
0 −1 −1 0 0 1 R 4 − R1
⎛ ⎞
1 1 1 1 1 3
⎜ ⎟
⎜ ⎟
⎜0 1 1 1 0 2⎟ −R2
∼⎜⎜
⎟
⎟
⎜0 −2 −2 0 0 2⎟
⎝ ⎠
0 −1 −1 0 0 1
⎛ ⎞
1 1 1 1 1 3
⎜ ⎟
⎜ ⎟
⎜0 1 1 1 0 2⎟
∼⎜
⎜
⎟
⎟
⎜0 0 0 2 0 6⎟ R3 + 2R2
⎝ ⎠
0 0 0 1 0 3 R4 + R 2
⎛ ⎞
1 1 1 1 1 3
⎜ ⎟
⎜ ⎟
⎜ 0 1 1 1 0 2⎟
∼⎜
⎜
⎟
⎟
⎜0 0 0 1 0 3⎟ 12 × R3
⎝ ⎠
0 0 0 1 0 3
⎛ ⎞
1 1 1 1 1 3
⎜ ⎟
⎜ ⎟
⎜0 1 1 1 0 2⎟
∼⎜⎜ ⎟
⎟
⎜0 0 0 1 0 3⎟
⎝ ⎠
0 0 0 0 0 0 R4 − R3
58
(a) to ensure that all columns with leading one have zeros elsewhere as follows:
⎛ ⎞
1 1 1 0 1 0 R 1 − R3
⎜ ⎟
⎜ ⎟
⎜0 1 1 0 0 −1⎟ R2 − R3
⎜ ⎟
⎜ ⎟
⎜0 0 0 1 0 3⎟
⎝ ⎠
0 0 0 0 0 0
⎛ ⎞
1 0 0 0 1 0 R1 − R2
⎜ ⎟
⎜ ⎟
⎜0 1 1 0 0 −1⎟
∼⎜ ⎜
⎟
⎟
⎜0 0 0 1 0 3⎟
⎝ ⎠
0 0 0 0 0 0
Tutorials 2.2.6. Reduce the following matrix and leave your answer in
2.3 Determinant
Given any square matrix A, there is a special scalar called the determinant of
A denoted by det(A) or we make use of vertical bars |A|. This number is also
important in determining whether a matrix is invertible or not, which will be
studied in the next section.
We will show how to evaluate determinant of square matrices of different orders.
59
(a): 1 × 1 matrix:
(b): 2 × 2 matrix:
⎛ ⎞
a b
If A = ⎝ ⎠;
c d
a b
The determinant is defined by: det A = = ad − bc
c d
⎛ ⎞
5 −1
Example 2.3.2. If A = ⎝ ⎠,then
6 −3
5 −1
det A = = (5)(−3) − 6(−1) = −15 + 6 = −9.
6 −3
Definition 2.3.3. The (i, j)-th minor of a matrix A, denoted by mij (A), is the
determinant⎛obtained by deleting
⎞ row i and column j of A.
a a12 a13
⎜ 11 ⎟
⎜ ⎟ a 11 a 13
e.g. If A = ⎜a21 a22 a23 ⎟, then m32 (A) = .
⎝ ⎠ a21 a23
a31 a32 a33
Definition 2.3.4. The (i, j)-th cofactor of a matrix A, denoted by cij (A), is
the signed minor
⎛ given by cij⎞(A) = (−1)i+j mij (A) of A.
a a12 a13
⎜ 11 ⎟
⎜ ⎟
e.g. If A = ⎜a21 a22 a23 ⎟, then
⎝ ⎠
a31 a32 a33
a11 a12 a a12
c23 (A) = (−1)2+3 = − 11 .
a31 a32 a31 a32
60
(c): 3 × 3 matrix:
a11 a12 a13
det A = a21 a22 a23
a31 a32 a33
This is Laplace expansion along row one. This expansion can be done
along any other row or column without affecting the value of the determi-
nant.
⎛ ⎞
−2 3 −1
⎜ ⎟
⎜ ⎟
Example 2.3.5. A= ⎜ 4 −7 1⎟
⎝ ⎠
1 2 −5
−2 3 −1
det A = 4 −7 1
1 2 −5
61
Another useful method which can be used to evaluate the determinant of a
3 × 3 matrix is what we call “Sarrus scheme” or also commonly referred to as
“butterfly method ”. To find the det(A) using this method we follow the following
steps:
(i) Rewrite the 1st and 2nd columns on the right (as Columns 4 and 5).
(ii) Add the products along the three full diagonals that extend from upper
left to lower right.
(iii) Subtract the products along the three full diagonals that extend from
lower left to upper right.
= −70 + 3 − 8 − 7 + 4 + 60 = −18.
Properties of determinants:
1. The sign of a determinant changes if any two columns or rows are inter-
changed.
62
E.g. From an example, we saw that
−2 3 −1
4 −7 1 = −18.
1 2 −5
2. The determinant a matrix with a zero column or zero row is zero.
of
1 0 −5
1 2
= 0.
E.g. 4 0 1 = 0 and
0 0
−2 0 −1
63
then det B = −5 det A = −5(−18) = 90.
Suppose we multiply the whole matrix A by 2, then each row will be
multiplied by two. So
Expanding along C1
7 −11
= 1 ×
−15 21
64
we deal with higher order square matrices, e.g. 4 × 4, 5 × 5, etc.
E.g. Consider a 4 × 4 matrix
⎛ ⎞
1 3 5 7
⎜ ⎟
⎜ ⎟
⎜3 1 3 5⎟
D=⎜
⎜
⎟
⎟
⎜5 3 1 3⎟
⎝ ⎠
7 5 3 1
1 3 5 7 1 3 57
3 1 3 5 0 −8 −12 −16 R2 − 3R1
=
5 3 1 3 0 −12 −24 −32 R3 − 5R1
7 5 3 1 0 −16 −32 −48 R4 − 7R1
−8 −12 −16
= 1 × −12 −24 −32
−16 −32 −48
2 3 4
= (−4)(−4)(−16) 3 6 8
1 2 3
0 −1 −2 R1 − 2R3
= −256 0 0 −1 R2 − 3R3
1 2 3
−1 −2
= −256 × 1 ×
0 −1
= −256 × (1 − 0) = −256.
65
a b+c a2 a a+b+c a2
b c+a b2 = b a+b+c b2
c a+b c2 c a+b+c c2
C2 + C1
a 1 a2
= (a + b + c) b 1 b2
c 1 c2
a 1 a2
= (a + b + c) b − a 0 b2 − a2 R2 − R1
c − a 0 c2 − a2 R3 − 1R1
Expand along C2
b − a (b − a)(b + a)
= −(a + b + c)
c − a (c − a)(c + a)
1 b + a
= −(a + b + c)(b − a)(c − a)
1 c + a
8. det(A) = det(At )
66
2. Use properties of determinants to evaluate:
3 −4 −2
(a) 6 −4 −1
9 2 3
1 k k 2
(b) 1 k k 2
1 k k 2
3 3 0 5
2 2 0 −2
(c)
4 1 −3 0
2 10 3 2
4 0 0 1 0
3 3 3 −1 0
(d) 1 2 4 2 3
2 2 4 2 3
−3 −1 2 0 9
67
• An invertible matrix and its inverse commute with respect to matrix mul-
tiplication i.e. AA−1 = A−1 A = In .
• A non-square matrix can never be invertible, and also among square ma-
trices there are infinitely many that are not invertible.
We will study two methods of finding the inverse of a matrix. The first method
involves Gauss-Jordan operation and the second is the adjoint method.
[A|I] → [I|A−1 ]
68
the following matrices:
⎛ ⎞
⎛ ⎞ 2 7 1
−2 3 ⎜ ⎟
(a) A = ⎝ ⎠ ; (b) B = ⎜
⎜1 4
⎟
−1⎟
4 −5 ⎝ ⎠
1 3 0
(a)
⎛ ⎞
−23 1 0
(A|I) = ⎝ ⎠
4 −5 0 1
⎛ ⎞
−2 3 1 0
=⎝ ⎠
0 1 2 1 R2 + 2R1
⎛ ⎞
−2 0 −5 −3 R1 − 3R2
=⎝ ⎠
0 1 2 1
⎛ ⎞
1 0 52 23 (− 12 ) × R1
=⎝ ⎠
0 1 2 1
⎛ ⎞
5 3
∴ A−1 = ⎝2 2⎠
.
2 1
(b)
⎛ ⎞
2 7 1 1 0 0
⎜ ⎟
⎜ ⎟
(A|I) = ⎜1 4 −1 0 1 0⎟
⎝ ⎠
1 3 0 0 0 1
69
First interchange row 1 and 2.
⎛ ⎞
1 4 −1 0 1 0 R2 ↔ R1
⎜ ⎟
⎜ ⎟
∼ ⎜2 7 1 1 0 0⎟
⎝ ⎠
1 3 0 0 0 1
⎛ ⎞
1 4 −1 0 1 0
⎜ ⎟
⎜ ⎟
∼ ⎜0 −1 3 1 −2 0⎟ R2 − 2R1
⎝ ⎠
0 −1 1 1 −1 1 R3 − R1
⎛ ⎞
1 4 −1 0 1 0
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −3 −1 2 0⎟ −R2
⎝ ⎠
0 −1 1 0 −1 1
⎛ ⎞
1 0 11 4 −7 0 R1 − 4R2
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −3 −1 2 0⎟
⎝ ⎠
0 0 −2 −1 1 1 R3 + R2
⎛ ⎞
1 0 11 4 −7 0
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −3 −1 2 0 ⎟
⎝ ⎠
0 0 1 12 − 12 − 12 − 12 R3
⎛ ⎞
1 0 0 − 32 − 32 11 2 ⎟ R1 − 11R3
⎜
⎜ 1 ⎟
∼ ⎜0 1 0 2 1
− 32 ⎟ R2 + 3R3
⎝ 2 ⎠
0 0 1 21 − 12 − 12
⎛ ⎞ ⎛ ⎞
−3 −3 11
−3 −3 11
⎜ 2 2 2 ⎟ ⎜ ⎟
⎜ −3 ⎟ 1 ⎜ ⎟
Hence A−1 = ⎜ 1 1 ⎟ = 2 ⎜1 1 −3⎟
⎝ 2 2 2 ⎠ ⎝ ⎠
1 −1 −1
2 2 2 1 −1 −1
70
For example if ⎛ ⎞
a11 a12 a13
⎜ ⎟
⎜ ⎟
A = ⎜a21 a22 a23 ⎟ ;
⎝ ⎠
a31 a32 a33
then the matrix of cofactors of A, which we will denote by C is:
⎛ ⎞
c11 (A) c12 (A) c13 (A)
⎜ ⎟
⎜ ⎟
C = ⎜c21 (A) c22 (A) c23 (A)⎟ ,
⎝ ⎠
c31 (A) c32 (A) c33 (A)
71
Now the adjoint matrix is the transpose of cofactor matrix, i.e.
⎛ ⎞
3 3 −11
⎜ ⎟
⎜ ⎟
adjB = C T = ⎜−1 −1 3 ⎟
⎝ ⎠
−1 1 1
Now
2 7 1
det B = 1 4 −1
1 3 0
2 1 1
= 1 1 −1
1 0 0
C2 − 3C1
Expanding along R3
1 1
= 1 ×
1 −1
= −1 − 1 = −2.
Tutorials 2.4.6. By using the methods below, find the inverse of matrices
below if they exist:
72
⎛ ⎞
−3 6
(a) A = ⎝ ⎠
4 5
⎛ ⎞
−1 3
(b) B = ⎝ ⎠
3 −2
⎛ ⎞
−1
3 4
⎜ ⎟
⎜ ⎟
(c) C = ⎜1 0 3 ⎟
⎝ ⎠
2 5 −4
⎛ ⎞
−1 3 −4
⎜ ⎟
⎜ ⎟
(d) D = ⎜ 2 4 1 ⎟
⎝ ⎠
−4 2 −9
Definition 2.5.1. A linear equation over a field of real numbers with unknowns
x1 , x2 , . . . , xn is an equation that can be put in the standard form
a1 x1 + a2 x2 + . . . + an xn = b
where a1 , a2 , . . . an , and b are constants (scalars) which comes from the field of
real numbers (R) and x1 , x2 , . . . , xn are variables. The constant ak is called the
coefficient of xk , and b is called the constant term of the equation.
A system of linear equations (or linear system) is a finite collection of
linear equations in same variables. For instance, a linear system of m equations
in n variables x1 , x2 , . . . , xn can be written as:
73
a11 x1 + a12 x2 + · · · + a1n x = b1
(c) No solution
Example 2.5.4. Solve for x, y and z using the Gauss-Jordan elimination method
of the following system of linear equations.
2x + 7y + z = 4
x + 4y − z = 9
x + 3y = 3
74
⎛ ⎞
⎛ ⎞
2 7 1 4
⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ ⎟
A = ⎜1 4 −1⎟ ; B = ⎜9⎟
⎝ ⎠ ⎝ ⎠
1 3 0 3
⎛ ⎞
2 7 1 4
⎜ ⎟
⎜ ⎟
(A|B) = ⎜1 4 −1 9⎟
⎝ ⎠
1 3 0 3
⎛ ⎞
1 4 −1 9 R2 ↔ R1
⎜ ⎟
⎜ ⎟
∼ ⎜2 7 1 4⎟
⎝ ⎠
1 3 0 3
⎛ ⎞
1 4 −1 9
⎜ ⎟
⎜ ⎟
∼ ⎜0 −1 3 −14⎟ R2 − 2R1
⎝ ⎠
0 −1 1 −6 R3 − R1
⎛ ⎞
1 4 −1 9
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −3 14 ⎟ −R2
⎝ ⎠
0 −1 1 −6
⎛ ⎞
1 0 11 −47 R1 − 4R2
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −3 14 ⎟
⎝ ⎠
0 0 −2 8 R 3 + R2
⎛ ⎞
1 0 11 −47
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −3 14 ⎟
⎝ ⎠
0 0 1 −4 − 12 R3
⎛ ⎞
1 0 0 −3 R1 − 11R3
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 0 2 ⎟ R2 + 3R3
⎝ ⎠
0 0 1 −4
∴ the system has unique solution with solutions x = −3, y = 2 and z = −4.
75
Example 2.5.5. Solve for x, y and z using the Gauss-Jordan elimination method
of the following system of linear equations.
2x − 3y + z = 5
−x + 2y − z = 0
−x + 3y − 2z = 4
⎛ ⎞
2 −3 1 5
⎜ ⎟
⎜ ⎟
(A|B) = ⎜−1 2 −1 0⎟
⎝ ⎠
−1 3 −2 4
⎛ ⎞
−1 −1 0 R1 ↔ R2
2
⎜ ⎟
⎜ ⎟
∼ ⎜ 2 −3 1 5⎟
⎝ ⎠
−1 3 −2 4
⎛ ⎞
1 −2 1 0 −R1
⎜ ⎟
⎜ ⎟
∼ ⎜ 2 −3 1 5⎟
⎝ ⎠
−1 3 −2 4
⎛ ⎞
1 −2 1 0
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −1 5⎟ R2 − 2R1
⎝ ⎠
0 1 −1 4 R3 − R1
⎛ ⎞
1 0 −1 10 R1 + 2R2
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −1 5 ⎟ R3 − R1
⎝ ⎠
0 0 0 −1
From row 3, we see that we have equation 0x+0y +0z = −1 which is impossible;
hence the system will have a no solution.
Example 2.5.6. Solve for x, y and z using the Gauss-Jordan elimination method
76
of the following system of linear equations.
x − 3y + 2z = −1
2x − 5y − z = 2
2x − 7y + 9z = −6
⎛ ⎞ ⎛ ⎞
1 −3 2 −1
⎜ ⎟ ⎜ ⎟
⎜ ⎟ ⎜ ⎟
A = ⎜2 −5 −1⎟ ; B = ⎜ 2 ⎟
⎝ ⎠ ⎝ ⎠
2 −7 9 −6
⎛ ⎞
1 −3 2 −1
⎜ ⎟
⎜ ⎟
(A|B) = ⎜2 −5 −1 2 ⎟
⎝ ⎠
2 −7 9 −6
⎛ ⎞
1 4 −1 9
⎜ ⎟
⎜ ⎟
∼ ⎜0 −1 3 −14⎟ R2 − 2R1
⎝ ⎠
0 −1 1 −6 R3 − 2R1
⎛ ⎞
1 −3 2 −1
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −5 4 ⎟ −R2
⎝ ⎠
0 −1 5 −4
⎛ ⎞
1 0 −13 11 R1 + 3R2
⎜ ⎟
⎜ ⎟
∼ ⎜0 1 −5 4 ⎟
⎝ ⎠
0 0 0 0 R 3 + R1
77
and our solution will be in parametric equation as:
x = 13t + 11, y = 5t + 4 and z = t.
Matrix inverses can be used to solve certain systems of linear equations. The
system of linear equations can be written as a single matrix equation
AX = B.
Example 2.5.8.
2x + 7y + z = 4
x + 4y − z = 9
x + 3y = 3
⎞⎛ ⎞ ⎛ ⎞
⎛
x2 4 7 1
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
We can express as AX = B as follows ⎜1 4 −1⎟ ⎜y ⎟ = ⎜9⎟ .
⎝ ⎠⎝ ⎠ ⎝ ⎠
1 3 0 z 3
We have already seen that
⎛ ⎞
−3 −3 11
⎜ 2 2 2 ⎟
⎜ −3 ⎟
A−1 =⎜ 1 1 ⎟.
⎝ 2 2 2 ⎠
1 −1 −1
2 2 2
78
Using inverse of matrix method to solve X = A−1 B, i.e.
⎛ ⎞ ⎛ ⎞⎛ ⎞
−3 −3 11
x 2 ⎟ ⎜4⎟
⎜ ⎟ ⎜ 2 2
⎜ ⎟ ⎜ 1 1 −3 ⎟ ⎜ ⎟
⎜y ⎟ = ⎜ 2 ⎟⎜ ⎟
2 ⎠ ⎝9⎠
⎝ ⎠ ⎝ 2
1 −1 −1
z 2 2 2 3
⎛ ⎞
( −3 )(4) + ( −3 )(9) + ( 11 )(3)
⎜ 2 2 2 ⎟
⎜ ⎟
= ⎜ ( 12 )(4) + ( 12 ) + ( −3 )(3) ⎟
⎝ 2 ⎠
1 −1 −1
( 2 )(4) + ( 2 )(9) + ( 2 )(3)
⎛ ⎞
−6 − 27 + 33
⎜ 2 2 ⎟
⎜ ⎟
= ⎜ 2 + 92 − 92 ⎟
⎝ ⎠
2 − 92 − 32
⎛ ⎞
−3
⎜ ⎟
⎜ ⎟
= ⎜ 2 ⎟.
⎝ ⎠
−4
Cramer’s Rule
Dx Dy Dz
x= ; y= ; z= ; etc. where D = 0.
D D D
79
Example 2.5.9.
2x + 7y + z = 4
x + 4y − z = 9
x + 3y = 3
⎛ ⎞⎛ ⎞ ⎛ ⎞
2 7 x1 4
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜ ⎟⎜ ⎟ ⎜ ⎟
⎜1 4 −1⎟ ⎜y ⎟ = ⎜9⎟ .
⎝ ⎠⎝ ⎠ ⎝ ⎠
1 3 0 z 3
Then
2 7 1
D =| A | = 1 4 −1
1 3 0
2 7 1
= 3 11 0
1 3 0
3 11
= 1 × = 3 × 3 − 11 × 1 = 9 − 11 = −2.
1 3
4 7 1
Dx =| Ax | = 9 4 −1
3 3 0
4 7 1
= 13 11 0
3 3 0
13 11
=1× = 13 × 3 − 11 × 3 = 39 − 33 = 6.
3 3
80
2 4 1
Dy =| Ay | = 1 9 −1
1 3 0
2 4 1
= 3 13 0
1 3 0
3 13
= 1 × = 3 × 3 − 13 × 1 = 9 − 13 = −4.
1 3
2 7 4
Dz =| Az | = 1 4 9
1 3 3
0 1 −2
= 1 4 9
0 −1 −6
1 −2
= −1 × = −[1 × (−6) − (−1) × (−2)] = −(−6 − 2) = 8.
−1 −6
So
Dx 6
x= = = −3,
D −2
Dy −4
y= = = 2,
D −2
Dz 8
z= = = −4.
D −2
81
Example 2.6.1.
x + 3y + (2 − 3k)z = 3
2x + 7y + (4 − 7k)z = 7
2x + ky + (k + 2)z = 2k − 1
Solution:
Then
82
we obtain ⎛ ⎞
1 0 2 0
⎜ ⎟
⎜ ⎟
⎜0 1 2 1 ⎟
⎝ ⎠
0 0 0 −3
which is clearly impossible.
(a)
x + 3y + 2z = 4
−2x − 7y + z = 9
3x + 10y + 9z = 19
(b)
x + 2y + z = 2
2x + 3y + 3z = 3
−3x − 4y − 5z = −5
(c)
x + 2y + 3z = 3
2x + 3y + 8z = 4
5x + 8y + 19z = 11
(d) From (a), (b) and (c) above, where you found a unique solution, use
the inverse of matrix method to confirm the solution.
83
2. In each of the following solve for x, y and z using
(a)
x + 2y + 3z = 3
2x + 3y + 8z = 4
5x + 8y + 19z = 11
(b)
x + y + 2z = 8
−x − 2y + 3z = 1
3x − 7y + 4z = 10
(c)
2x + 5y − z = −4
x + 2y + z = 3
3x − 2y − z = 5
3. For which value(s) of k will the following system of linear equations have
(i) No solution
(a)
x + 2y + z = 3
ky + 5z = 10
2x + 7y + kz = 4
84
(b)
y + 2kz = 0
x + 2y + 6z = 2
kx + 2z = 1
(i) No solution
x + 2y + 2z = 1
x + ky + 3z = 3
x + 11y + kz = a
Here we are going to look at a very important theorem which determines whether
a matrix is invertible or not.
(a) A is invertible.
85
(d) A is expressible as a product of elementary matrices.
Proof. (⇒:) Assume A is invertible, i.e. A−1 exists. Then AA−1 = In and
R = E1 E2 . . . Er A
86
Tutorials 2.6.9. 1. Which of the following matrices are elementary matri-
ces?
⎛ ⎞
1 0 −8
⎜ ⎟
⎜ ⎟
(a) ⎜0 1 0⎟
⎝ ⎠
0 0 1
⎛ ⎞
1 0 0
⎜ √ ⎟
⎜ ⎟
(b) ⎜ 0 − 7 0⎟
⎝ ⎠
−3 0 1
⎛ ⎞
1 0 0 0
⎜ ⎟
⎜ ⎟
⎜0 0 1 0⎟
⎜
(c) ⎜ ⎟
⎟
⎜0 1 0 0⎟
⎝ ⎠
0 0 0 1
⎛ ⎞
1 0
(d) ⎝ ⎠
0 − 23
⎛ ⎞
1 1 0
⎜ ⎟
⎜ ⎟
(e) ⎜0 1 0⎟
⎝ ⎠
0 0 0
2. From the above question, show which operations where used to obtain
those matrices which are elementary matrices.
Example 2.6.10. Mpho sells four types of Magazines which are, Drum, You,
Car and True love. On a particular day he picked four spots to sell on. In spot
1, he sold five Drum, two You, three Car and one True love. In spot 2, he sold
four Drum, five You, one Car and one True love. In spot 3, he sold one Drum,
three You, zero Car and four True love. In spot 4, he sold three Drum, two You,
three Car and three True love. In total he got R93, R90, R79 and R103 in spot
1, spot 2, spot 3 and spot 4 respectively. Let a be the price of Drum, b be the
price of You, c be the price of Car and d be the price of True love magazine.
87
(a) Form a system of linear equations from the above sales of magazines done
by Mpho.
(b) Use any of the method you did in class which involves the matrices to
determine the price of each type of magazine.
Solution:
(a)
5a + 2b + 3c + d = 93
4a + 5b + c + d = 90
a + 3b + 4d = 79
3a + 2b + 3c + 3d = 103.
⎛ ⎞ ⎛ ⎞
5 2 3 1 93 1 3 0 4 79
⎜ ⎟ ⎜ ⎟R ↔R
⎜ ⎟ ⎜ ⎟ 1 3
⎜4 5 1 1 90 ⎟ ⎜4 5 1 1 90 ⎟
⎜ ⎟ ∼⎜ ⎟
⎜ ⎟ ⎜ ⎟
⎜1 3 0 4 79 ⎟ ⎜5 2 3 1 93 ⎟
⎝ ⎠ ⎝ ⎠
3 2 3 3 103 3 2 3 3 103
⎛ ⎞
1 3 0 4 79
⎜ ⎟
⎜ ⎟
⎜0 −7 1 −15 −226⎟ R2 − 4R1
∼⎜
⎜
⎟
⎟
⎜0 −13 3 −19 −302⎟ R3 − 5R1
⎝ ⎠
0 −7 3 −9 −134 R4 − 3R1
⎛ ⎞
1 3 0 4 79
⎜ ⎟
⎜ ⎟
⎜0 −7 1 −15 −226⎟
∼⎜
⎜
⎟
⎟
⎜0 1 1 11 150 ⎟ R3 − 2R2
⎝ ⎠
0 0 2 6 92 R4 − R2
88
⎛ ⎞
1 3 0 4 79
⎜ ⎟
⎜ ⎟
⎜0 1 1 11 150 ⎟
∼⎜
⎜
⎟
⎟
⎜0 −7 1 −15 −226⎟
⎝ ⎠
1
0 0 1 3 46 2 R4
⎛ ⎞
1 0 −3 −29 −371
⎜ ⎟
⎜ ⎟
⎜0 1 1 11 150 ⎟
∼⎜
⎜
⎟
⎟
⎜0 0 8 62 824 ⎟ R3 + 7R2
⎝ ⎠
0 0 1 3 46
⎛ ⎞
1 0 −3 −29 −371
⎜ ⎟
⎜ ⎟
⎜0 1 1 11 150 ⎟
∼⎜
⎜
⎟
⎟
⎜0 0 1 3 46 ⎟
⎝ ⎠
0 0 8 62 824 R3 ↔ R 4
⎛ ⎞
1 0 0 −20 −233 R1 + 3R3
⎜ ⎟
⎜ ⎟
⎜0 1 0 8 104 ⎟ R2 − R3
∼⎜
⎜
⎟
⎟
⎜0 0 1 3 46 ⎟
⎝ ⎠
0 0 0 38 456 R4 − 8R3
⎛ ⎞
1 0 0 −20 −233
⎜ ⎟
⎜ ⎟
⎜0 1 0 8 104 ⎟
∼⎜
⎜
⎟
⎟
⎜0 0 1 3 46 ⎟
⎝ ⎠
1
0 0 0 1 12 38 R4
⎛ ⎞
1 0 0 0 7 R1 + 20R4
⎜ ⎟
⎜ ⎟
⎜0 1 0 0 8 ⎟ R2 − 8R4
∼⎜
⎜
⎟
⎟
⎜0 0 1 0 10⎟ R3 − 3R4
⎝ ⎠
0 0 0 1 12
89
and 3 grams of protein. Each serving of c has 2 grams of fat, 4 grams
of carbohydrates, and 3 grams of protein. The diet allows 15 grams fat,
24 grams carbohydrates and 30 grams protein. Showing the three simul-
taneous equations obtained, use any method to calculate the number of
serving of each dish that can be allowed to be eaten on this diet.
“If others would think as hard as I did, then they would get similar results.”
Isaac Newton
90