0% found this document useful (0 votes)
26 views12 pages

Matrices: Basics and Operations

An introduction to matrices for high school students

Uploaded by

dddd8051
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views12 pages

Matrices: Basics and Operations

An introduction to matrices for high school students

Uploaded by

dddd8051
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1 Matrices

ˆ (Ex 4A) Introduction to Matrices

A matrix is a rectangular array of numbers. Matrices (plural of matrix) are denoted by upper case
letters, e.g.  
1 2 3
A=
4 5 6
A has 2 rows and 3 columns. The order of matrix A is 2 × 3 (read “two by three”). Sometimes
the order is written in the lower-right corner of the matrix
 
1 2 3
A=
4 5 6 2×3

The numbers inside the matrix are called elements and are denoted by lower case letters.
The element in the first row, first column of A is 1. We write a1,1 = 1.
Similarly a2,3 = 6.
A row matrix has only one row, e.g.
 
B = 10 11 12

B has order 1 × 3 and b1,2 = 11.


A column matrix has only one column, e.g.
 
20
C=
16

C has order 2 × 1 and c2,1 = 16.


A square matrix has an equal number of rows and columns, e.g.
 
−4 0 6 11
 2 12 −5 3 
D=  1 7

0 1 
8 6 6 11

D has order 4 × 4 and d3,2 = 7.


A square matrix is called symmetric if it is symmetrical about the line running from the top-left
corner to the bottom-right corner of the matrix (this line is called the main diagonal ), e.g.
 
3 1 0 5
 1 2 4 7 
E=
 0

4 6 9 
5 7 9 0

 
0 −1
Matrices can be entered on the calculator, e.g. to enter F = press the key to the left
31 100
of the “Catalogue” key, followed by the 2 × 2 matrix symbol

2
Enter the elements (use the “tab” key), then save the matrix as “f ”

ˆ (Ex 4B) Adding and Subtracting Matrices  


0 −1
Only matrices with the same order can be added or subtracted, e.g. F = and
  31 100
−2 7
G= can be added, as they are both 2 × 2 matrices. The sum will also be a 2 × 2
0 −3
matrix. The elements of the sum are found by adding the corresponding elements of F and G
     
0 −1 −2 7 −2 6
F +G= + =
31 100 0 −3 31 97

Similarly, F − G is a 2 × 2 matrix whose elements are found by subtracting the elements of G from
the corresponding elements of F .
Matrices can be added or subtracted on the calculator

3
 
1 2 3  
A= and B = 10 11 12 cannot be added or subtracted as they do not have the
4 5 6
same order.

ˆ (Ex 4C) Multiplying a Matrix by a Scalar


1
Numbers such as 1, −3.2, 0, etc. are called “scalars”. Scalars and matrices can be multiplied
2  
20
together, e.g. the product of “4” and C = is a 2 × 1 matrix whose elements are found by
16
multiplying the elements of C by “4”
   
20 80
4C = 4 × C = 4 × =
16 64

ˆ (Ex 4D) Multiplying Matrices


Two matrices can only be multiplied if the
 number of columns inthe first matrix
 equals the number
0 −1 1 2 3
of rows in the second matrix, e.g. F = and A = can be multiplied, i.e.
31 100 4 5 6
the inner numbers of the orders must be equal

FA = F × A
2×2 2×3

must be the same

The product is a matrix with an order equal to the outer numbers of the orders

FA = F × A
2×2 2×3

order of the product

Hence F A is a 2 × 3 matrix.

     
0 −1 1 2 3 e1,1 e1,2 e1,3
FA = × =
31 100 4 5 6 e2,1 e2,2 e2,3 2×3

e1,1 is the product of the first row of F and the first column of A.
   
0 −1 1 2 3
×
31 100 4 5 6

Hence e1,1 = 0 × 1 + −1 × 4 = −4.

4
e1,2 is the product of the first row of F and the second column of A.
   
0 −1 1 2 3
×
31 100 4 5 6

Hence e1,2 = 0 × 2 + −1 × 5 = −5.


e1,3 is the product of the first row of F and the third column of A.
   
0 −1 1 2 3
×
31 100 4 5 6

Hence e1,3 = 0 × 3 + −1 × 6 = −6.


e2,1 is the product of the second row of F and the first column of A.
   
0 −1 1 2 3
×
31 100 4 5 6

Hence e2,1 = 31 × 1 + 100 × 4 = 431.


Similarly e2,2 = 31 × 2 + 100 × 5 = 562 and e2,3 = 31 × 3 + 100 × 6 = 693.
Thus
     
0 −1 1 2 3 −4 −5 −6
FA = × =
31 100 4 5 6 431 562 693

This can be checked on the calculator. First enter matrix A as follows

5
Then calculate the product of F and A

A square matrix can be raised to a power by multiplying repeatedly

     
0 −1 0 −1 −31 −100
F2 = F × F = × =
31 100 31 100 3100 9969

     
0 −1 0 −1 0 −1
F3 = F × F × F = × ×
31 10031 100 31 100
   
−31 −100 0 −1
= ×
3100 9969 31 100
 
−3100 −9969
=
309039 993800

These results can be checked on the calculator. Note that only square matrices can be raised to a
power

6
An identity matrix is a square matrix with a “1” in the main diagonal (also called the leading
diagonal ) and a “0” everywhere else. Identity matrices are denoted by “I”.
 
I1 = 1
 
1 0
I2 =
0 1
 
1 0 0
I3 =  0 1 0 
0 0 1
 
1 0 0 0
 0 1 0 0 
I4 =  0 0 1 0 

0 0 0 1
Multiplying a square matrix by I has no effect. In this way it is similar to the scalar 1.
     
0 −1 1 0 0 −1
F ×I = × = =F
31 100 0 1 31 100

Similarly I × F = F

ˆ (Ex 4E) Inverse Matrices and solving Simultaneous Equations using Matrices

The inverse of a square matrix A is another square matrix (denoted by A−1 ) such that A×A−1 = I

100 1
   
0 −1 −1 31 31
The inverse of F = is F = since
31 100 −1 0
   100 1
  
−1 0 −1 1 0
F ×F = × 31 31 = =I
31 100 −1 0 0 1

Note that F −1 × F = I as well

7
An important application of matrices is the solution of simultaneous equations.

2x + 4y = 10
−3x + y = −1

This is written in matrix form as


     
2 4 x 10
× =
−3 1 y −1

To solve for the unknowns x and y we use the inverse of the first matrix
   −1  
x 2 4 10
= ×
y −3 1 −1
 1 −2   
10
= 3 14 7
1 ×
14 7
−1
 
1
=
2

Hence x = 1 and y = 2.

Finally, some square matrices do not have inverses. We use the following rule to determine if a
square matrix has an inverse:

If the determinant of a square matrix is not zero, then the matrix has an inverse.

If the determinant of a square matrix is zero, then the matrix does not have an inverse.

The determinant of a square matrix is found using the calculator

   
0 −1 6 3
Thus F = has an inverse (since its determinant = 31 ̸= 0) but does not
31 100 4 2
have an inverse (since its determinant = 0).

8
ˆ (Ex 4F) Using Matrices to model Road and Communication Graphs

The following graph shows the road connections between four towns A, B, C and D:

A B

C D

The road connections can be represented using a 4 × 4 matrix


A B C D
 
0 1 0 1 A
 1 0 0 2 
T = B
 0 0 0 1 C
1 2 1 0 D

There is one direct road between towns A and B, so we enter a 1 in the 1st row, 2nd column of T
and also a 1 in the 2nd row, 1st column.

There are two direct roads between towns B and D, so we enter a 2 in the 2nd row, 4th column
of T and also a 2 in the 4th row, 2nd column, etc.

Note that T is a symmetric matrix (if any of the roads where one-way streets T would not be
symmetric). The sum of the elements in a particular column (or row) of T gives the number of
roads directly connected to the corresponding town, e.g. column (row) 2 has a sum of 3, showing
that there are 3 roads directly connected to town B.

When it is possible to travel directly between two towns, we say that there is a one step commu-
nication link between the towns. The elements in T show the number of one step communication
links between two towns. Hence there is a one step communication link between towns A and B,
between towns C and D, between towns A and D and two one step communication links between
towns B and D. But there is no one step communication link between towns B and C or between
towns A and C. We also say there are no one step communication links between a town and itself.

A person wishing to travel by road from town B to town C needs to go through town D. When
it is possible to travel between two towns via another town, we say that there is a two step
communication link between the two towns. The elements of T 2 show the number of two step
communication links between two towns, e.g. there are 2 two step communication links between
towns B and C.
A B C D
 
2 2 1 2 A
 2 5 2 1 
B
T2 = 
 1 2 1 0 C
2 1 0 6 D

9
ˆ (Ex 4G) Introduction to Transition Matrices
Suppose a car rental company has two offices, one in town A and another in town B.
Furthermore, suppose all of the cars at each office are rented out for 1 week, and that 80% of the
cars rented out in town A are returned to town A, and 60% of the cars rented out in town B are
returned to town B.
This information can be described by the following transition diagram:

20%

80% A B 60%

40%

This information can also be summarised in a transition matrix, with percentages written as
decimals:

this week
 A B 
0.8 0.4 A next week
T =
0.2 0.6 B

Transition matrices are square matrices for which each column sums to 1.

Suppose initially there were 20 cars at town A and 30 cars at town B.

After one week 80% of the cars at town A, i.e. 16 (80% of 20 = 16) would return to town A and
the remainder, i.e. 4 would go to town B.

Similarly, after one week 60% of the cars at town B, i.e. 16 (60% of 30 = 18) would return to
town B and the remainder, i.e. 12 would go to town A.

Hence after 1 week there would be 16 + 12 = 28 cars at town A and 18 + 4 = 22 cars at town B.

The number of cars at each office after one week can also be found by multiplying the transition
matrix T with the column matrix S0 containing the initial number of cars at each office:

 
20 A
S0 =
30 B

     
0.8 0.4 20 28
T S0 = × =
0.2 0.6 30 22

Note that after one week the total number of cars at both offices stays the same at 50.

10
ˆ (Ex 4H) Recurrence Relations and Transition Matrices

Consider the car rental company of the previous example. The matrix S0 containing the initial
number of cars at each office is called the initial state matrix.

The matrix containing the number of cars at each office after one week is the next state matrix
and is denoted by S1 , i.e.

 
28 A
S1 =
22 B

We saw that S1 is equal to the product of T and S0 , i.e.

S1 = T S0

The matrix containing the number of cars at each office after two weeks is denoted by S2 , and is
equal to the product of T and S1 , i.e.
S2 = T S1

Similarly, the number of cars at each office after three weeks is:

S3 = T S2

i.e. the state matrices S1 , S2 , S3 , . . . can be found using the matrix recurrence relation:

S0 = initial state matrix, Sn+1 = T Sn

To determine the number of cars at each office after three weeks we first find S2 :

S2 = T S1
   
0.8 0.4 28
= ×
0.2 0.6 22
 
31.2
=
18.8

Then we find S3 :

S3 = T S2
   
0.8 0.4 31.2
= ×
0.2 0.6 18.8
 
32.48
=
17.52

i.e. after three weeks there are 32 cars at town A and 18 cars at town B.

11
Suppose we wanted to find S6 . We could do this by first finding S4 from S3 using the matrix
recurrence relation, then find S5 from and S4 and finally S6 from S5 .

However a quicker way is to use the explicit rule:

Sn = T n S0

So
 6  
0.8 0.4 20
S6 = ×
0.2 0.6 30
 
33.28
=
16.72

So after six weeks there would be 33 cars at town A and 17 cars at town B.
The following table shows the number of cars at each office to 4 decimal places for different values
of n (the number of weeks):

n 0 1 3 6 10 20 40
town A 20 28 32.48 33.2787 33.3319 33.3333 33.3333
town B 30 22 17.52 16.7213 16.6681 16.6667 16.6667

Note that as the number of weeks increase the number of cars at town A and B settles down and
remains the same at 33 and 17, respectively. This is called the steady state or equilibrium state.

To find the steady state increase the value of n until the state matrix Sn no longer changes (usually
around n = 50).
ˆ (Ex 4I) Applications of matrices
Suppose a restaurant has a dinner menu consisting of 8 main meals. The quantity of each type of
main meal sold on the weekend is shown in the following matrix:

Sat Sun
 
3 1 Meal 1
 Meal 2
 4 3 

 6 4 
  Meal 3
 Meal 4
 5 2 
N =
 6
 3  Meal 5

 7 5  Meal 6
 
 4 2  Meal 7
4 4 Meal 8

The cost in dollars of each meal is given in the following row matrix:

 Meal 1 Meal 2 Meal 3 Meal 4 Meal 5 Meal 6 Meal 7 Meal 8 


C= 18.2 22.6 14.80 21.40 22.80 21.90 24.20 26.50 cost

12
To find the total revenue collected on the weekend for the meals we multiply C and N :
 
3 1
 4 3 
 
 6 4 
 
   5 2 
R = C × N = 18.2 22.6 14.80 21.40 22.80 21.90 24.20 26.50 ×   
 6 3 

 7 5 
 
 4 2 
4 4
 
= 833.7 520.3

i.e. $833.70 was collected on Saturday and $520.30 on Sunday.

Suppose the manager of the restaurant wants to know the total number of meals sold each day.
This can be found by adding together
 the elements in each
 column of N , but it can also be found
by multiplying the row matrix 1 1 1 1 1 1 1 1 and N :
 
3 1

 4 3 


 6 4 

   5 2 
T = 1 1 1 1 1 1 1 1 × 

 6 3 


 7 5 

 4 2 
4 4
 
= 39 24

i.e. a total of 39 meals were sold on Saturday and 24 on Sunday.


Suppose the manager also wants to know the total number of each type of meal sold on the weekend.
Again, this can be found by adding together the elements in each row of N or by multiplying N
and the column matrix  
1
1
giving
   
3 1 4

 4 3 


 7 


 6 4  
    10 

 5 2 × 1 =
  7 
M = 

 6 3 
 1 
 9 


 7 5 


 12 

 4 2   6 
4 4 8

Hence four Meal 1’s were sold on the weekend, 7 Meal 2’s and so on.

13

You might also like