QT_LESSON 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

LESSON 5: MATRICES

let's explore types of Matrices!


A matrix is an arrangement (array) of numbers in rows and columns. Rows are the
horizontal arrangement while column are the vertical arrangement. The number of
rows and columns determine the order of the matrix which is given by stating
the number of rows followed by the number of columns.

In general, if the number of rows is 𝒎 and the number of columns 𝒏, the matrix is said
to be of order 𝒎 × 𝒏.

For example

State the order of the following matrices

1 6
(a) [−2 5 ] 3 × 2 𝑚𝑎𝑡𝑟𝑖𝑥
4 0
1 0 3
(b) [ ] 2 × 3 𝑚𝑎𝑡𝑟𝑖𝑥
−1 3 2
2 6
(c) [ ] 2 × 2 𝑚𝑎𝑡𝑟𝑖𝑥
−1 1

Elements of a matrix
Each number or letter in a matrix is called an element of the matrix. Each element can be
located in the matrix by stating its position in the row and the column.

𝒂𝟏𝟏 𝒂𝟏𝟐
For example, given the 2 × 2 𝑚𝑎𝑡𝑟𝑖𝑥 [
𝒂𝟐𝟏 𝒂𝟐𝟐 ],
𝒂𝟏𝟏 means the element is in the first row and first column.

𝒂𝟏𝟐 means the element is in the first row and second column.

𝒂𝟐𝟏 means the element is in the second row and first column.

𝒂𝟐𝟐 means the element is in the second row and second column.

In general, 𝑎𝑖𝑗 means an element is in the 𝑖 𝑡ℎ row and 𝑗 𝑡ℎ column.

Page 1 of 14 matrices
A matrix in which the number of rows is equal to the number of columns is known as a
square matrix.
Matrices are denoted by a capital letter in bold face. Two or more matrices are equal if
they are of the same order and their corresponding elements are equal.

OPERATION ON MATRICES

Addition and Subtraction of Matrices.


Addition and subtraction of matrices is possible if they are of the same order. The sum
of two or more matrices is obtained by adding corresponding elements. Subtraction is
done in a similar manner.

Example 1.

1 2 3 2 1 2
If P=[ ] and Q=[ ], find
−1 3 2 5 2 4

(a) P+Q (b) P-Q


Solution
1 2 3 2 1 2
P+Q =[ ]+[ ]
−1 3 2 5 2 4
1+2 2+1 3+2
=[ ]
−1 + 5 3+2 2+4
3 3 5
=[ ]
4 5 6

1 2 3 2 1 2
P-Q =[ ]−[ ]
−1 3 2 5 2 4
1−2 2−1 3−2
=[ ]
−1 − 5 3−2 2−4
−1 1 1
=[ ]
−6 1 −2
Example

3 2 1 3 2 1 3 4 −1
If A=[0 4 5], B=[1 4 5] and C= [0 −2 1 ]. Find A-B+C
1 3 2 1 2 3 2 3 2

Page 2 of 14 matrices
Solution

3 2 1 3 2 1 3 4 −1
A-B+C= [0 4 5] - [1 4 5] + [0 −2 1 ]
1 3 2 1 2 3 2 3 2
3−3+3 2−2+4 1 − 1 + (−1)
= [0 − 1 + 0 4 − 4 + (−2) 5−5+1 ]
1−1+2 3−2+3 2−3+2
3 4 −1
= [−1 −2 1 ]
2 4 1
Exercise

1. State the order of each of the following matrices:


−1 3
(a) [ ]
1 2
5 3 2
(b) [6 0 4 ]
1 −1 3
1 1 0
(c) [ ]
2 1 0
0
(d) [2]
3
3 4 8
10 2 5 15
2. [2 0 1 ]Given 𝑷 = [ ], 𝑸 = [ ] , 𝑹 = [2 1 0 ] and 𝑺 =
6 5 3 4
1 6 12
11 4 5
[5 13 −4], find where possible:
7 3 4
(a) 𝑷 − 𝑸 (b) 𝑸 − 𝑷 (c) 𝑹 − 𝑺 (d) 𝑺−𝑹

(e) 𝑺−𝑷 (f) 𝑺 − 𝑸 (g) 𝑹 − 𝑺 − 𝑸

Page 3 of 14 matrices
Matrix Multiplication
𝑎 𝑏 𝑐
Consider a matrix 𝑨 = [ ] and a scalar 𝑘 , then;
𝑑 𝑒 𝑓

𝑎 𝑏 𝑐 𝑘𝑎 𝑘𝑏 𝑘𝑐
k𝑨 = [ ]=[ ], where each element of A is multiplied by 3.
𝑑 𝑒 𝑓 𝑘𝑑 𝑘𝑒 𝑘𝑓

−1 4 2
For example, given 𝑨 = [ ] then;
1 0 3
−1 4 2 3 × (−1) 3 × 4 3 × 2 −3 12 6
3𝑨 = 3 [ ]= [ ] =[ ].
1 0 3 3×1 3×0 3×3 3 0 9

Example

1 2 −1
1
If 𝑩 = [0 2 1 ], find (a) 5B (b) 2 B (c) 0.1B
1 3 4
Solution

1 2 −1 5 × 1 5 × 2 5 × (−1) 5 10 −5
(a) 5 𝑩 = 5 [0 2 1 ] = [5 × 0 5 × 2 5 × 1 ] = [0 10 5 ]
1 3 4 5×1 5×3 5×4 5 15 20
1 1 1
× 1 2 × 2 2 × (−1)
1 2 −1 2 0.5 1 −0.5
1 1 1 1 1
(b) 2 𝑩 = [0 2 1 ]= 2×0 2×2 2
× 1 = [ 0 1 0.5 ]
2
1 3 4 1 1 1 0.5 1.5 2
[2 × 1 2 × 3 2
×4 ]
1 2 −1 0.1 × 1 0.1 × 2 0.1 × (−1) 0.1 0.2 −0.1
(c) 0.1 𝑩 = 0.1 [0 2 1 ] = [0.1 × 0 0.1 × 2 0.1 × 1 ] = [ 0 0.2 0.1 ]
1 3 4 0.1 × 1 0.1 × 3 0.1 × 4 0.1 0.3 0.4

Multiplication of matrices
Multiplication of two matrices, A by B is possible if the number of columns in the
first matrix (A) is equal to the number of rows in the second matrix (B).

In this case, the two matrices A and B are said to be compatible(conformable).

Steps;

Each time a row is multiplied by a column.

In the product matrix, the element in the 𝑖 𝑡ℎ row and 𝑗 𝑡ℎ column is obtained by
multiplying 𝑖 𝑡ℎ row of A by the 𝑗 𝑡ℎ column of B.

Page 4 of 14 matrices
In general, given a matrix A of order 𝑚 × 𝑛 and a matrix B of order 𝑛 × 𝑟 then the
product matrix AB is of order 𝑚 × 𝑟.

Example

1 1
2 1 0
Given the matrices 𝐴 = [ ] 𝑎𝑛𝑑 𝐵 = [ 2 0],
−1 3 1
−1 2
compute (a) AB and (b) BA.

Solution

(a) Matrix A is a 2 × 𝟑 matrix and B is a 𝟑 × 2 matrix. The number of columns in A are


3 which is the same as the number of rows in B. Thus, the two matrices are compatible
therefore we can find the product of AB which will be a 2 × 2 matrix.

1 1
2 1 0 2 × 1 + 1 × 2 + 0 × −1 2×1+1×0+0×2
𝐴𝐵 = [ ] [ 2 0] = [ ]
−1 3 1 −1 × 1 + 3 × 2 + 1 × −1 −1 × 1 + 3 × 0 + 1 × 2
−1 2
2+2+0 2+0+0 4 2
=[ ]=[ ]
−1 + 6 + (−1) −1 + 0 + 2 4 1

(b) Matrix B is a 3 × 𝟐 matrix and A is a 𝟐 × 3 matrix. The number of columns in B are 2


which is the same as the number of rows in A. Thus, the two matrices are compatible
therefore we can find the product of BA which will be a 3 × 3 matrix.

1 1 1 × 2 + 1 × (−1) 1 ×1+1×3 1×0+1×1


2 1 0
𝐵𝐴 = [ 2 0] [ ] = [ 2 × 2 + 0 × (−1) 2×1+0×3 2×0+0×1 ]
−1 3 1
−1 2 −1 × 2 + 2 × (−1) −1 × 1 + 2 × 3 −1 × 0 + 2 × 1
2 + (−1) 1+3 0+1 1 4 1
=[ 4+0 2 + 0 0 + 0] = [ 4 2 0]
−2 + (−2) −1 + 6 0 + 2 −4 5 2

Note

From the above example we observe that 𝑨𝑩 ≠ 𝑩𝑨

Exercise

Work out the following:

1 2 3 0 3 2 4
(a) [ ][ ] (b) [ ][ ]
3 4 1 2 1 −1 5
[5 2] [−1 3
(b) ]
6 4

Page 5 of 14 matrices
2 1
8 2
(c) [3 4] [ ]
1 0
5 7
3 4 7 0 2
(d) [2 −1 4] [ 4 −1]
0 3 5 −2 3

2 1 0 1 3 −2
(e) [4 3 1 ] [2 −1 0 ]
5 −1 −2 3 2 4

Identity matrix
A square matrix which has ones in the main diagonal and zeros elsewhere is called a
unit or an identity matrix. The main diagonal is the one running from the top left to the
bottom right. It is also known as the principal or leading diagonal. The letter I is used
to denote the identity matrix.

1 0
The identity matrix of order 2, denoted by 𝑰2 is [ ].
0 1
1 0 0
The identity matrix of order 3, denoted by 𝑰3, is [0 1 0].
0 0 1

Determinant of a 𝟐 × 𝟐 Matrix
For a square matrix of order two, if we subtract the product of the elements of the other
diagonal from the product of the elements of the main diagonal, the number obtained is
called the determinant of the matrix. The determinant of a matrix A is denoted by det 𝑨.

𝑎 𝑏
Let 𝑨 = [ ], then 𝑑𝑒𝑡 𝑨 = 𝑎𝑑 − 𝑏𝑐.
𝑒 𝑑
Example

Find determinant of the following matrices.

2 1 −2 2 2 3
(a) 𝑨 = [ ] (b) 𝑩 = [ ] (c) 𝑪 = [ ]
3 4 6 −9 −3 7
2 3 3 6
(d) 𝑫 = [ ] (e) 𝑬 = [ ]
−1 5 2 3

Solution
(a) det 𝑨 = (2 × 4) − (3 × 1) = 8 − 3 = 5

Page 6 of 14 matrices
(b) det 𝑩 = (−2 × −9) − (6 × 2) = 18 − 12 = 6
(c) det 𝑪 = (2 × 7) − (−3 × 3) = 14 − −9 = 14 + 9 = 23
(d) det 𝑫 = (2 × 5) − (−1 × 3) = 10 − −3 = 10 + 3 = 13
(e) det 𝑬 = (3 × 3) − (2 × 6) = 9 − 12 = −3

Inverse of a 𝟐 × 𝟐 Matrix
If the product of two matrices P and Q are such that PQ=QP=I, then Q is known the
inverse of P and vice versa. The inverse of A is written as 𝑨−1 . Thus𝑨𝑨−1 = 𝑨−1 𝑨 = 𝑰

The procedure for getting the inverse of a 𝟐 × 𝟐 matrix.


(i) Find the determinant of the matrix. If the determinant is zero, then the given
matrix has no inverse.
(ii) If it is non-zero, then:
• interchange the elements in the main diagonal
• Reverse the signs of the elements in the other diagonal (secondary
diagonal).
• Divide the matrix obtained by the determinant of the given matrix.

𝒂 𝒃
In general , let 𝑨 = [ ], 𝐝𝐞𝐭 𝑨 = 𝒂𝒅 − 𝒃𝒄 ≠ 𝟎, then;
𝒄 𝒅
𝟏 𝒅 −𝒃
𝑨−𝟏 = [ ]
𝒂𝒅−𝒃𝒄 −𝒄 𝒂
Example

Find the inverse of the following matrices;

1 3
(a) 𝑨 = [ ]
1 4
−1 −2
(b) 𝑩 = [ ]
3 −4
7 −3
(c) 𝑪 = [ ]
−4 2

Solution
(a) We first determine the determinant of matrix A.
det 𝑨 = (1 × 4) − (1 × 3) = 4 − 3 = 1.
1 4 −3
𝑨−1 = [ ]
1 −1 1

Page 7 of 14 matrices
4 −3
= [ ].
−1 1
(b) We compute the determinant of matrix B.
det 𝑩 = (−1 × −4) − (3 × (−2)) = 4 − 6 = −2.
1 −4 2
𝑩−1 = [ ]
−2 −3 −1
−1 −4 2
= [ ]
2 −3 −1
2 −1
=[ ].
1.5 0.5

(c) The determinant of matrix C is,

det 𝑪 = (7 × 2) − (−4 × (−3)) = 14 − 12 = 2.


Therefore
1 2 3
𝑪−1 = [ ]
2 4 7

1 1.5
=[ ].
2 3.5

Exercise
Find the determinant of each of the following matrices;
3 5 6 −4
(a) [ ] (b) [ ]
4 −2 −2 4
3 7 5 1
(c) [ ] (d) [ ]
1 4 6 4
1 5 2 3
(d) [ ] (e) [ ]
0 2 4 7
2. Find where possible the inverse of each of the following matrices:

7 9 6 2
(a) [ ] (b) [ ]
3 4 4 −8
2 2 13 0
(c) [ ] (d) [ ]
3 4 7 −1
4 −2 3 5
(e) [ ] (f) [ ]
−12 −6 9 15
2 −2 1 2
(g) [ ] (h) [ ]
3 1 4 6

Page 8 of 14 matrices
Solution of Simultaneous Linear Equations using Matrices.
Given an equation Ax=b where A is the coefficient matrix, x stands for the unknowns
and b is the solutions, to get the unknowns, we first compute the inverse of the
coefficient matrix and then multiply this inverse with the solutions.

Example

Solve the following simultaneous equations using matrix method

3𝑥 + 𝑦 = 7

5𝑥 + 2𝑦 = 12

Solution

In matrix form the above system can be written as

3 1 𝑥 7
[ ] [ ] = [ ] … … … … (𝑖)
5 2 𝑦 12
𝟑 𝟏 𝟕
The matrix [ ] is called the coefficient matrix while [ ] is called the
𝟓 𝟐 𝟏𝟐
constant matrix.
2 −1
The inverse of the coefficient matrix is [ ].
−5 3
Pre-multiplying both sides of the matrix equation (i) by the inverse of the coefficient
matrix is

2 −1 3 1 𝑥 2 −1 7
[ ][ ] [𝑦] = [ ][ ]
−5 3 5 2 −5 3 12
1 0 𝑥 2 × 7 + −1 × 12
[ ] [𝑦] = [ ]
0 1 −5 × 7 + 3 × 12
𝑥 17 − 12
[𝑦 ] = [ ]
−35 + 36
𝑥 2
[𝑦 ] = [ ]
1
Therefore 𝒙 = 𝟐 and 𝒚 = 𝟏.

Page 9 of 14 matrices
Example

Use matrix method to solve the following system of linear equations:

3𝑥 + 2𝑦 = 12

4𝑥 − 𝑦 = 5

Solution

In matrix form we obtain

3 2 𝑥 12
[ ] [𝑦] = [ ] … … … … (𝑖𝑖)
4 −1 5
3 2
The coefficient matrix [ ]
4 −1
−1 −1 −2
The inverse of the coefficient matrix is [ ].
11 −4 3
Pre-multiplying both sides of the matrix equation by the inverse;

−1 −1 −2 3 2 𝑥 −1 −1 −2 12
[ ][ ] [𝑦 ] = [ ][ ]
11 −4 3 4 −1 11 −4 3 5

1 0 𝑥 −1 −1 × 12 + −2 × 5
[ ] [𝑦 ] = [ ]
0 1 11 −4 × 12 + 3 × 5
𝑥 −1 −12 − 10
[𝑦] = [ ]
11 −48 + 15
𝑥 −1 −22
[𝑦] = [ ]
11 −33
𝑥 2
[𝑦 ] = [ ]
3
Therefore 𝒙 = 𝟐 and 𝒚 = 𝟑.

Exercise

1. Use matrix method to solve the following system of linear equations;


(a) 3𝑥 − 2𝑦 = 3 (b) 𝑥 + 𝑦 = 5
3𝑦 + 𝑥 = 4 3𝑥 − 2𝑦 = 0

(𝑐) 𝑥 + 2𝑦 = 6 (d) 7𝑥 + 5𝑦 = 11

15𝑥 − 3𝑦 = 3 3𝑥 + 4𝑦 = 2

Page 10 of 14 matrices
(e) 3𝑥 + 2 = 𝑦 (f) 𝑡 − 2𝑠 = 2

−4 + 2𝑦 = 2𝑥 2𝑡 − 3𝑠 = 1

(g) 5𝑡 + 3𝑠 = 7 (h) 2𝑡 − 𝑠 = −3

2𝑡 + 𝑠 = 5 2𝑠 + 𝑡 = 0

2. Repeat question 1 using substitution method.


Formulating problems as simultaneous Equation
It is important to develop mathematical models of real-life situation to help analyze and
solve the problems of such situations. The use of algebraic notation to represent
variables in a situation and their combination with numerical constants to form
equations are the building blocks of such mathematical models.

Simple equation can be developed to model situation and enable us to find the value of
one unknown variable where we know the values of all the other variables. In the same
manner, we can develop models which will enable us find two or more unknown
variable by using simultaneous equations.

The following should be considered when formulating problems as simultaneous


equations.


State clearly what the unknowns represent and give the units been used

After getting the number for which the unknowns represent, give the answer of
the question in words.
• Check your answer in the question and not in the formulated equations.
Example

The expenditure of 10 men and 8 boys amount to £160. If 4 men together spend £18
more than 6 boys, how much does each man and boy spend?

Solution

Let: 𝑥 = the expenditure of 1 man in £

𝑦 = the expenditure of 1 boy in £

The information in this situation can be expressed as

10𝑥 + 8𝑦 = 160 (1)

4𝑥 − 6𝑦 = 18 (2)

Page 11 of 14 matrices
On solving these two equations using elimination method, we get;

Multiplying equation (1) by 2 and equation (2) by 5 and subtracting equation (2) from
(1) we obtain:

20𝑥 + 16𝑦 = 320

20𝑥 − 30𝑦 = 90

46𝑦 = 230

Therefore 𝑦 = 5.

To find 𝑥, we substitute the value of 𝑦 = 5 in equation (2) to get

4𝑥 − 6(5) = 18

4𝑥 = 18 + 30 = 48

𝑥 = 12

Thus, each man spends £12 and each boy spend £5.

Exercise
1. In a bag containing black and white balls, half the number of whites is equal to a
third the number of black, and twice the total number of balls exceeds three times the
number of black balls by four. How many balls did the bag contain?

2. Half the sum of two numbers is 20 and three times their difference is 18. Find the
numbers.

3. 6 kg of tea and 11kg of sugar cost £ 13.30. 11 kg of tea and 6 kg of sugar cost £17.30.
Find the cost of tea and sugar per kilo.

4. The income from advertisements and sales for a college magazine amounted in a year
1
to £670. In the following year the income from advertisement was increased by 12 2 %
2
and the income from sales decreased by 16 3 %. The total income decreased by £12.50.

Find the original income from advertisements and sales using a calculation method.

Page 12 of 14 matrices
EXTRA WORK

Q1. Using Matrix to solve the following system of linear equations:

3x + 4y = 5

2x – y = 7
𝟏𝟏𝐱 + 𝟑𝐲 = 𝟔𝟕
𝟓𝐱 + 𝟕𝐲 = 𝟒𝟔

5𝑥 − 2𝑦 = 16
7𝑥 + 6𝑦 = −4

3𝑥 − 𝑦 = 4
𝑥 + 2𝑦 = 13

4 x − 5 y = 13
3x − 2 y = 8
3x + 2 y = 0
(i)
x + 3y = 8
2 1
x + y =1
3 3
(ii)
4 2 2
x− y =
3 3 3
𝟓 𝟑
𝟒 𝟓 𝟑
Q2. Given the matrices A=[ ], B= [ 𝟏 𝟔]
𝟔 −𝟑 𝟕
−𝟓 𝟗
Determine

i. 𝑩𝑻
ii. 𝑨𝑻 + 𝑩
iii. AB
3 8   6 1
iv. Given the matrices A =   , B = 4 6 C =  
5 2  − 1 2
Determine
(i) BA
(ii) A+C
(iii) B TC

Page 13 of 14 matrices
Q3. A) Solve for x given that the following is a singular matrix
1 2 
 
x x − 3 

B) Find the inverse of the matrix 1 1


3 1

Hence determine the point of intersection of the: lines:


y+x=7
3x + y = 1

3 4 8 11 4 5
10 2 5 15
Q4. Given 𝑷 = [ ], 𝑸 = [ ] , 𝑹 = [2 1 0 ] and 𝑺 = [ 5 13 −4], find where
6 5 3 4
1 6 12 7 3 4
possible:
(a) 𝑷 − 𝑸 (b) 𝑸 − 𝑷 (c) 𝑹 − 𝑺 (d) 𝑺 − 𝑹

(e) 𝑺 − 𝑷 (f) 𝑺 − 𝑸 (g) 𝑹 − 𝑺 − 𝑸

Q5.
1 2 3 0 3 2 4
(f) [ ][ ] (b) [ ][ ]
3 4 1 2 1 −1 5
−1 3
(g) [5 2] [ ]
6 4
2 1
8 2
(h) [3 4] [ ]
1 0
5 7
3 4 7 0 2
(i) [2 −1 4] [ 4 −1]
0 3 5 −2 3

2 1 0 1 3 −2
(j) [4 3 1 ] [2 −1 0 ]
5 −1 −2 3 2 4

Q6. Solve by matrix method


(𝑐) 𝑥 + 2𝑦 = 6 (d) 7𝑥 + 5𝑦 = 11
15𝑥 − 3𝑦 = 3 3𝑥 + 4𝑦 = 2

(e) 3𝑥 + 2 = 𝑦 (f) 𝑡 − 2𝑠 = 2

−4 + 2𝑦 = 2𝑥 2𝑡 − 3𝑠 = 1

(g) 5𝑡 + 3𝑠 = 7 (h) 2𝑡 − 𝑠 = −3

2𝑡 + 𝑠 = 5 2𝑠 + 𝑡 = 0

Page 14 of 14 matrices

You might also like