0% found this document useful (0 votes)
27 views33 pages

Matrices Textbook - PDF 3

Uploaded by

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

Matrices Textbook - PDF 3

Uploaded by

sarisri2023
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Numbers,

Patterns and
Problems
Year 10
Semester 2

1
Part 2 – Matrices

2
Introduction to matrices
Four towns are connected by roads as shown in the figure. There is one road connecting
A and B, two roads connecting A and C and so on. This information may be represented as shown
in the table.

If the headings at the top and side of this display are removed, an array of only numbers is left:

This is called a matrix (plural, matrices).

The arrangement of numbers in matrices is an extension of our number system and, as we will
see, the rules that govern matrix calculations have many similarities to the arithmetic of numbers.
Matrices are particularly useful in solving complex problems in linear programming.

A matrix is a rectangular array of numbers arranged in rows and columns.


The numbers in the matrix are called the elements of the matrix.

The matrix above is a (4 x 4) matrix as it has 4 rows and 4 columns. We say the order of the matrix
is 4 by 4.

is a (3 x 2) matrix because it has 3 rows and 2 columns.

A matrix with m rows and n columns is called an (m x n) matrix.


The elements of the matrix are referred to by the row and then by the column position.
In the (3 x 2) matrix above, the 1, 1 element = 2, the 3, 1 element = −1 and the 1, 2 element = 0.
We often use capital letters as symbols for matrices. Thus we may write:

In general, the elements of a matrix A are referred to as ai j where i refers to the row position and
j refers to the column position.

3
The 1, 1 element is a11.The 3, 1 element is a31 and so on.

Example:

Operations with matrices


Addition
The sports coordinator at Mathglen Secondary College kept records of the number of first, second
and third ribbons awarded to competitors in each house at the swimming and athletics carnivals
and sports events.
The results were:

To find the total number of first, second and third places for each house, the matrices may be
added. The elements in corresponding positions are added to give:

Matrices are added by adding corresponding elements.

4
Subtraction

Matrices can also be subtracted by employing the usual rules of arithmetic on corresponding
elements of the matrices. It follows that:

1. Subtraction of matrices is performed by subtracting corresponding elements.


2. Addition and subtraction of matrices can be performed only if the matrices are of the same
order.

Furthermore, addition of matrices is commutative. That is, for two matrices A and B of the same
order:
A+ B=B+ A

Example:

Multiplication by a scalar

Consider the matrix B =


To find 3B we could use repeated addition:

5
3B could have been calculated more efficiently by multiplying each element of B by 3.
Thus

The number 3 in the term 3B is called a scalar and terms such as 3B are called scalar
multiplication of matrices.

When a matrix is multiplied by a scalar, each element of the matrix is multiplied


by the scalar.
Example:

There are some obvious but important features to scalar multiplication. If A and B are matrices of
the same order and a, b are real numbers, then:
1. aA +bA=(a+b) A
2. aA +aB=a (A + B)
3. (ab) A=a(bA )

If aA = 0, then a =0 or A is a zero matrix. A zero matrix is a matrix which has all elements equal to
zero.

6
Equality of matrices
Two matrices are equal if they are of the same order and all corresponding
elements are equal.

Simple matrix equations


We know that to solve an algebraic equation such as 2 x+5=11, we:
1. subtract 5 from both sides to obtain 2x = 11 – 5 or 2x = 6, then
2. divide both sides by 2 (or multiply by ) to obtain x = 6/2 or x = 3.

Simple matrix equations that require the addition or subtraction of a matrix or multiplication of a
scalar can be solved in similar ways to those employed with algebraic equations.

Example:

7
Exercise 2.1
Using a table format, give the order of each of the following matrices and where possible write down the 2,
1 and 1, 3 elements of each.

1. If , calculate:
a. A+ B
b. A–B
c.B+C
d.C–A
2. Using the matrices A, B and C from question 2 find:
a. 2 A
b. A – B
c. 2 A +3 B
d. 3( A+ B)
e. 2 A +3 B – 4 C
3.

8
4. Write the matrix representing the following maps in the form:

5. A mathematically inclined student has decided to keep a record of her test results in matrix
form. Her results so far are General Maths tests: 82%, 75% and 91%; Maths Methods tests:
54%, 68% and 82%. Write these results in a 3x2 matrix.

Solutions.
1.

2.

3.

4.

5.

9
Multiplying matrices

The sports results at Mathglen Secondary College were:

To calculate the total points for each house colour, this matrix is multiplied by since 5 points are
awarded for first, 3 for second and 1 for third.

We can write A x B = C, where

The order of A is (4 x 3); B is (3 x 1) and C is (4 x 1).


A (4 x 3) matrix multiplied by a (3 x 1) matrix gives a (4 x 1) matrix. We can write
(4 x 3) (3 x 1) = (4 x 1).

Two matrices can be multiplied only if the number of columns of the first matrix equals the
number of rows of the second matrix.
In general, if A is of order (m x n) and B is of order (n x p) then AB exists and its order is (m x p).
The order of AB should be established before multiplying.
In general, for two matrices A and B, AB ≠ BA.

The procedure for multiplying two (3 x 3) matrices can be done using your Graphics Calculator:
https://www.youtube.com/watch?v=awkkWBUWwAg

The identity matrix


10
There is one circumstance in which matrix multiplication is commutative. Look at the following
example:

This example demonstrates the only way in which matrix multiplication is commutative, that is,
when
A I = IA = A. Here, I is called the multiplicative identity matrix.
The multiplicative identity matrix, I, acts in a similar fashion to the number 1 when numbers are
being multiplied.
An identity matrix can be defined only for square matrices, that is 1 x 1, 2 x 2, 3 x 3,. . . matrices.
The other feature of an identity matrix is that it has the number 1 for all elements on the main
diagonal and 0 for all other elements.

I can be defined only for square matrices.

Watch: https://www.youtube.com/watch?v=hPAS6H6xFa0

11
Exercise 2.2
1. Use the matrices below to answer the questions that follow:

a. Write the order of the six matrices.


b. Which of the following products exist?

c. Write the orders of the products which exist.


d. Using your graphics calculator calculate those products which exist.
2. Use the matrices below to answer the questions that follow:

Calculate the following products:


a. AB
b. AC
c. DO
d. OI
e. ID

3. Calculate the following products:

a.

b.

c.
d. What do you notice about all of the answers?
e. What term could be given to these matrices?

4. The matrix below shows the number of wins, draws and losses for two soccer teams, the
Sharks and the Dolphins:

Thus the Sharks have 10 wins, 2 draws and 5 losses. If 3 points are awarded for a win, 1 for
a draw and 0 for a loss:
a. Write a (3 x 1) matrix for the points awarded
b. Use matrix multiplication to find the total points for the two teams

12
5. Two shops, A and B, are supplied with boxes of different brands of chocolates — Yummy,
Scrummy and Creamy — as shown in this matrix:

The cost of the boxes are Yummy $10, Scrummy $25 and Creamy $12.
a. Write the costs in a (3 x 1) matrix.
b. Use matrix multiplication to find the total cost for each shop.

Solutions

1.
a.

b. CA and DB
c. (3 x 2), (1 x 2)
d.

2.
a.

b.

c.

d.

13
e.

3.
a.

b.

c.

d. All are I
e. Multiplicative Inverses
4.
a.

b.

5.
a.

b.

14
Multiplicative inverse and solving matrix equations
When one matrix is the multiplicative inverse of the other then the product of the matrices is I.
We use the symbol A-1 for the multiplicative inverse of A.

If AA-1 = A-1 A = I then A-1 is called the multiplicative inverse of A.

7 1
In working with numbers, a similar result would be or . Numbers such as these are called
1 7
reciprocals or multiplicative inverses of each other.

Example:

15
There is a relationship between A and A-1 which is outlined as follows:

If A is the matrix , proceed as follows:

Watch: https://www.youtube.com/watch?v=3ROzG6n4yMc

Example:

16
Singular matrices
1
Matrices for which the determinant equals 0 do not have an inverse, since is undefined. Such
0
matrices are called singular matrices.

If det A = 0 then A is singular and an inverse does not exist.

Further matrix equations


Matrix equations of the type AX = B may be solved by using the properties of multiplicative
inverses.
A matrix equation AX = B is similar to the equation 3x = 7. To solve this we would divide both sides
1
of the equation by 3 (or multiply by ). To solve the matrix equation we multiply both sides by A-1.
3
Since the order of multiplying matrices is important we must be careful in which position we
multiply by the inverse.

1. For AX = B
Pre-multiply by A-1: A-1AX = A-1B
or IX = A-1B since A-1A = I.
X = A-1B since IX = X.
2. For XA = B
Post-multiply by A-1: XA A-1 = B A-1
or XI = B A-1 since A A-1= I
X = B A-1 since XI = X.

1. If AX = B, then X = A-1B.
2. If XA = B, then X = B A-1.

Example:

17
Exercise 2.3

1. If A = and B = , find AB and hence write the:


a. Inverse of A
b. Inverse of B
2. Calculate the determinants of the following matrices:

3. Find the inverses of each matrix in Question 2.

4. Let A = ,B= and X = . Solve these matrix equations:

a.

b.

18
5. Find the value of x and y by solving these matrix equations:

Solutions.

1.

2.

3.

4.

5.

Applications of matrices

Matrices may be used to solve linear simultaneous equations. The pair of equations may be
written in the form AX = B where A is the matrix of the coefficients of x and y in the equations,

and B is the matrix of the numbers on the right-hand side of the simultaneous equations.
A is called the coefficient matrix.

For example, the simultaneous equations:


ax + by = e
cx + dy = f
can be expressed as the matrix equation:

which is of the form AX = B.

19
Example:

Exercise 2.4
1. Solve these simultaneous equations by matrix methods:
a. 2 x – 3 y=13 and x +2 y=3
b. 3 x+ y=9 and −2 x+5 y =−6
c. −x +4 y=−2 and x−5 y=0
d. 6 x +7 y=0 and 4 x−3 y=0
e. 4 x+ y=20and x− y =0
f. 3 x−2 y=0 and x− y =1

2. Consider the simultaneous equations:


a. Write the coefficient matrix.
b. Calculate the values of x and y .
3. Cyril’s circus arrived in town last week and during the week the number of adults,
children and pensioners attending the circus was recorded for the first five shows
(see table below).

The entry cost is $20 for adults, $6 for children and $5 for pensioners.
Using matrix calculations find the total takings for the first five shows.

20
Solutions.

1.

2.
a.

b. x=3 , y=2

3. $51 070

Matrices and transformations

Matrices may be used to describe transformations of points or curves in the x–y plane.
Points in the plane may be transformed by translation, reflection, rotation and dilation.

Translations.
Consider the shape at right.
Each point on the original figure is moved horizontally and
vertically. A point P(x, y) is moved to the point P′(x′, y′) by
translating a units in the x-direction and b units in the
y-direction.

We write (x′, y′) = (x +a, y +b) or, in matrix form

The translation matrix translates a given point a units in the positive


x-direction and b units in the positive y-direction.

Watch: https://www.youtube.com/watch?v=fkZ72uLULR0

21
Example:

To find the matrix of transformation for transformations other than translation, namely
reflection, rotation and dilation, we will use the most general linear transformation:
(x′, y′) =(ax + by, cx + dy).
Each point (x, y) is mapped onto its image (x′, y′) by
x′= ax + by and y′= cx + dy.

In matrix form:

Reflection
We now consider reflections in the x-axis, the y-axis and the line y = x.
1. Reflection in the x-axis

22
Consider the points (2, 3) and (–3, 0) and their images upon reflection through the x-axis.
(2, 3) (2,-3) and (-3, 0) (3, 0).

The matrix for a REFLECTION in the x-axis is

2. Reflection in the y-axis


A similar method can be used to show that:
The matrix for a REFLECTION in the y-axis is:

For example, the image of the point (2, - 4) under a reflection through the y-axis is calculated:

3. Reflection in the line y = x


Likewise it can be easily shown that the matrix for reflection in the line y = x is:

For example, the image of the point (3, 2) under a reflection through the line y = x is calculated:

23
Example:

4. Rotation
Rotation of a point on the x–y plane is achieved by treating the point as though it moves around a
circle of centre (0, 0) and radius equal to the distance of the point from the origin, a given number
of degrees or radians.

24
Example:

Watch: https://www.youtube.com/watch?v=kZhlfkOLePM
Quick Summary: https://www.youtube.com/watch?v=nNw48yWDEOk

Exercise 2.5

1. Find the translation matrix which maps:


a. (2, 4) onto (-2, 4)
b. (2, 4) onto (-2, -4)
c. (2, 4) onto (5, 1)
d. (0, 0) onto (-3, -4)

2. Find the images of the following points under the translation whose matrix is
a. (5, 3)
b. (-2, 6)
c. (0, -5)
d. (-2, 3)

25
Solutions

1.

2.

Encoding and Decoding Information using Matrices.

History has many accounts of the vital role that codes have played in protecting sensitive
information used in wars and conspiracies. Mary, Queen of Scots, sent encoded messages from
prison to Catholic supporters who planned to overthrow the Protestant Queen Elizabeth. Elizabeth
was reluctant to execute her cousin Mary without direct evidence linking her with the plot. The
charges were laid by the Principal Secretary, Sir Francis Walsingham. Unfortunately for Mary,
Walsingham was also England’s spymaster. He used an expert to break the code, and Mary was
executed.

In the past, commonly used codes replaced each letter of the alphabet with a randomly chosen
number or symbol. The intended recipient could use a list of the changes to change each number
back to a letter. The weakness in this type of code is that, in the English language, E is the most
frequently occurring letter, followed by T and then A. A table of frequencies for letters can be used
to replace numbers occurring with about the same frequency and hence to break the code.
Matrices can be used to encode words so that each letter does not have the same number
throughout the coded message. This makes the message extremely difficult to decode without
knowing the secret encoding matrix. Mary may have survived if she had read the following
example. We will use this simple table with the letters numbered in order, but use a matrix to
encode the final message.

Coding Matrices.

26
Encoding:
Step 1. Identify the encoding matrix
Step 2. Write the letters into a matrix
with 2 rows
Step 3. Use the table of letters above
to replace the letter with the
corresponding number to create the
message matrix
Step 4. Multiply the encoding matrix x
message matrix

Use your graphics calculator

Decoding:
Step 1. Identify the encoding matrix
and find the inverse
Step 2. Multiply the inverse encoding
matrix x encoded matrix
Step 3. Using the table of letters
match the numbers to the
corresponding letters
Step 4. Write the decoded message

Use your graphics calculator

Exercise 2.6

1. Encode the following messages with the encoding matrix [ ]


3 1
2 1
a. ENEMY SPY NEAR BASE
b. BEWARE CODE STOLEN
2.

27
Solutions
1.

a.

b.

2.

a.

b.

c.

Transition Matrices.

Transition matrices are used to describe the way in which transitions are made between two
states. It is used when events are more or less likely depending on the previous events.
This is best described in an example.

Application
Constructing a steady state matrix
Students have the choice of doing either Math or English during their study periods. 60% of
students who do Math during one study period, will do Math the next study period. 30% of
students who do English during one study period, will do English the next study period.
The transition matrix in this case would be:

28
where n = one state, and n+1 represents the next state.
Notice that the column adds up to 1. This is because the numbers represent probabilities and all
probabilities must be taken into account.
Interpreting a steady state matrix

In this transition matrix, the choice of the red or blue pill is influenced by a student’s previous
choice. For example, element 1,1 indicates that if a student chose a red pill at first, there is a 75%
chance that the student will choose the red pill next. Element 2,2 indicates that if a student chose
a blue pill first, there is 35% chance that the student will choose the blue pill next, again.

Making predictions with a transition matrix


By pairing a transition matrix with an initial state matrix, making predictions is simple. An initial
state matrix, , is a column matrix that represents the quantities in each state at the beginning.
Regarding the red and blue pill situation above, the following initial state matrix can be explained:

This means that initially, 68 students chose the red pill and 32 students chose the blue pill. In order
to predict the actions of the students the next week a new state matrix, , is made.

29
The next time the students choose pills, approximately 72 students will choose the red pill and 28
will choose the blue pill.
In order to find , the transition matrix must be multiplied to . One may think that finding
would be too tedious but the shorthand way to calculate would be to use powers. That
is, . To find the predicted number of students who will choose either pill, the following
formula can be used:

Steady state
As n increases, one should notice that the number of students to choose either pill begins to settle
down to a stable, unchanging number. This is referred to as the steady state solution. To find the
steady state solution, reference to the formula must be made. n in this case tends to
infinity. Using a calculator, values of n that are greater than 30 frequently give a steady state
matrix.
In order to prove a steady state, one must show that:

A Markov Chain is usually shown by a state transition diagram. Consider a Markov chain with
three possible states 1, 2, and 3 and the following transition probabilities:

[ ]
1 1 1
4 3 2
1
T= 0 0
2
1 2 1
4 3 2

The figure below shows the state transition diagram for the above Markov chain. In this diagram,
there are three possible states 1, 2, and 3, and the arrows from each state to other states show
the transition probabilities pij. When there is no arrow from state i to state j, it means that pi=0.

30
A state transition diagram is shown above.
Exercise 2.7

1. A truck distribution company has 3 depots:

Mitchell Fyshwick

City

During the period of 1 month:


 70% of trucks distributed at Mitchell return to Mitchell
 10% of trucks distributed at Mitchell go to the City
 10% of trucks distributed at Fyshwick return to Fyshwick
 50% of trucks distributed at Fyshwick go to the City
 60% of trucks distributed in the City return to the City
 30% of the trucks distributed in the City go to Fyshwick

At the beginning of the week there are 100 trucks at the Mitchell depot, 200 trucks at the
Fyshwick depot and 300 trucks at the City depot.
a. Show the transition Matrix for the information given and the Initial State Matrix
b. Calculate the number of trucks at each depot after 5 weeks.
c. Find the long term steady state

2. In the local cricket competition teams can use either of two types of ball — Kingfisher or
Best Match. At the end of each season clubs sometimes decide to change the ball they use.

31
Research suggests 80% of those using Kingfisher stay with that ball for the next season and
70% of those using Best Match continue to use that ball. At the beginning of this season
80% of clubs used Best Match and the remainder used Kingfisher.
a. Write the transition matrix and initial matrix for this system
b. What proportion of clubs will be using Kingfisher in 3 years’ time?
c. What is the long-term behaviour of the system?

Solutions

1.

[ ]
0.7 0.4 0.1
a. Transition Matrix 0.2 0.1 0.3
0.1 0.5 0.6

[ ]
100
Initial Matrix (S0) 200
300
b. 5 weeks:

[ ][ ] [ ]
5
0.7 0.4 0.1 100 240
0.2 0.1 0.3 200 = 130
0.1 0.5 0.6 300 230
Therefore Mitchell had 240 trucks, Fyshwick has 130 trucks and City had 230 trucks.
c. Long Term Steady State:

[ ][ ][ ]
50
0.7 0.4 0.1 100 247
0.2 0.1 0.3 200 = 129
0.1 0.5 0.6 300 224

[ ][ ][ ]
51
0.7 0.4 0.1 100 247
0.2 0.1 0.3 200 = 129
0.1 0.5 0.6 300 224

Therefore Mitchell will have 247 trucks, Fyshwick will have 129 trucks and City will
have 224 trucks

2.
a. Transition Matrix [ 0.8
0.2 0.7 ]
0.3

Initial Matrix (S0) [ 0.2


0.8 ]
b. Three years’ time:
32
[ ][ ] [ ]
3
0.8 0.3 0.2 0.55
= Therefore in 3 years’ time 55% of clubs will be using
0.2 0.7 0.8 0.45
Kingfisher
c. Long Term Steady State:

[ ][ ][ ]
50
0.8 0.3 0.2 0.6
=
0.2 0.7 0.8 0.4

[ ][ ][ ]
51
0.8 0.3 0.2 0.6
=
0.2 0.7 0.8 0.4
Therefore the Steady State is 60% of clubs will use Kingfisher and 40% will use Best
Match

Online Markov Chain Questions: https://brilliant.org/practice/transition-matrices/

33

You might also like