You are on page 1of 11

MATH1031 Mathematics for Life Sciences

Term 3, 2021

Matrix Applications

Dr. Joshua Capel


Red Centre Room 5107

Based on the slides provided by Dr. Chi Mak

School of Mathematics and Statistics


University of New South Wales
j.capel@unsw.edu.au

Joshua Capel (UNSW) MATH1031 1 / 11


Matrix Applications

This lecture, we will look more closely at matrix multiplication, and work
through some simple applications.

Review problem.
Discuss how matrix multiplication is not commutative.
Some matrix applications

Joshua Capel (UNSW) Matrix Applications 2 / 11


Review Problem

Example.
   
6 0 2 4  
2 3 2
A =  −3 3  , B =  1 −5  , C=
0 1 4
2 3 2 6

1 State the order of each matrix.


2 Calculate A + C and B T + C .
3 Calculate 2B.
4 Calculate AB, AC and CB.

“calculate if defined”

Joshua Capel (UNSW) Matrix Applications 3 / 11


Answer to review problem

Solutions.
1 Both A and B are 3 × 2, but C is 2 × 3.

2 A + C is not defined because they do not have the same size.


     
2 1 2 2 3 2 4 4 4
BT + C = + = .
4 −5 6 0 1 4 4 −4 10

   
2 4 4 8
3 2B = 2 1 −5 = 2 −10.
2 6 4 12

Joshua Capel (UNSW) Matrix Applications 4 / 11


Answer to review problem

4 AB is undefined because the number of columns of A is not equal to


the number of rows of B.
   
6 0   12 18 12
2 3 2
AC = −3 3  = −6 −6 6 .
0 1 4
2 3 4 9 16
 
  2 4  
2 3 2  11 5
CB = 1 −5 =  .
0 1 4 9 19
2 6

Joshua Capel (UNSW) Matrix Applications 5 / 11


Is Matrix Multiplication Commutative?

Recall that for regular numbers, 2 × 3 = 3 × 2, or in general ab = ba.


Multiplication of numbers is COMMUTATIVE.

Is matrix multiplication commutative also? Let’s look at an example.


 
2 
Suppose that H =  −1  , J = 1 4 −5 . Is HJ = JH?
3

Joshua Capel (UNSW) Matrix Applications 6 / 11


Is Matrix Multiplication Commutative?
   
2  2 8 −10
HJ =  −1  1 4 −5 =  −1 −4 5 
3 | {z
1×3
} 3 12 −15
| {z } | {z }
3×1 3×3
 
 2 
JH = 1 4 −5  −1  = 1 × 2 + 4 × −1 + −5 × 3 = (−17)
| {z
1×3
} 3 | {z
1×1
}
| {z }
3×1
Here HJ and JH are not the same, nor even the same order. One or the
other may not even exist! In general they will be the same order only if H
and J are square. Even then HJ 6= JH in general.

Matrix Multiplication is NOT Commutative.

Joshua Capel (UNSW) Matrix Applications 7 / 11


Example
Example.
   
−3 2 2 0
K= , L=
1 1 1 4

KL =

LK =

We can see that, as L and K are square, LK and KL are both of order
2 × 2, but that LK 6= KL, and the multiplication of the matrices is not
commutative.
Joshua Capel (UNSW) Matrix Applications 8 / 11
Some matrix applications

Example.
A chain of greengrocer’s shops operates in Armidale, Guyra and Uralla.
In a particular week the shop in Armidale requires 20 crates of oranges and
30 crates of apples; in Guyra 16 of oranges and 30 of apples; in Uralla 8 of
oranges and 20 of apples.
Oranges cost $10.40 per crate and apples cost $8.52 per crate.
Set up and solve the matrix problem to find the total bill for each shop.

Joshua Capel (UNSW) Matrix Applications 9 / 11


Some matrix applications

Example.
In a year 7 class of 25 students, 15 buy “Dolly” and 10 buy “Ralph”. In a
year 8 class of 26 students; 6 buy “Dolly” and 20 buy “Ralph”.
In each copy of “Dolly” there are 2 free offers and 5 competitions; each
copy of “Ralph” contains 3 free offers and 4 competitions.
Assume that every student sends off for all the free offers and enters all
the competitions of the magazine they buy.
Set up and solve the matrix problem to find out:
1 How many free offers do Year 7 students send for?
2 How many competition forms do Year 8 students send in?

Joshua Capel (UNSW) Matrix Applications 10 / 11


Some matrix applications

Example. In a particular environment there are three species of


carnivorous animals, C1, C2 and C3, three types of herbivorous animals,
H1, H2 and H3, which are eaten by the carnivores and four species of
plants, P1, P2, P3 and P4 which are eaten by the herbivores. Each day C2
eats two H3 etc as given by
 
2 1 1
A= 0 1 2 
1 1 2
Similarly each herbivore eats a certain number of each plant per day as
given by
 
6 2 0 0
B= 2 3 3 2 
1 0 3 4
Multiply A and B and interpret the results to find how many of each plant
type each carnivore needs (indirectly) per day.

Joshua Capel (UNSW) Matrix Applications 11 / 11

You might also like