Learning Intention and Success
Criteria
 Learning Intention: Students will understand the
rules that define matrix multiplication and their
reasons for being
 Success Criteria: You will be determine the possibility
of multiplying two matrices by one another, and where
possible will be able to multiply a matrix by another
matrix
Matrix Multiplication
Requirements
 Not all matrices can be multiplied together, just as not
all matrices can be added
 The ability to multiply is dependent on the order of the
matrices
 If 𝐴 has order 𝑚 × 𝑛 (𝑚 rows and 𝑛 columns) and 𝐵
has order 𝑝 × 𝑟 (𝑝 rows and 𝑟 columns), we can
multiply 𝐴 × 𝐵 only if 𝑛 = 𝑝. The resultant matrix will
have order 𝑚 × 𝑟
 We say the product is undefined if the matrices
cannot be multiplied
Matrix Multiplication
Requirements
 That is, to multiply two matrices with orders
𝑚 × 𝑛 × (𝑝 × 𝑟)
 Note that 𝐴 × 𝐵 might be defined, but 𝐵 × 𝐴
undefined.
 Another way to say if multiplication is possible is: “The
number of columns in the first matrix must be equal to
the number of rows in the second matrix”
Must be the same
Order of resultant matrix
Examples
 If 𝐴 is a 3 × 2 matrix, 𝐵 is a 2 × 4 matrix and 𝐶 is a 3 ×
3 matrix, which of the following products will be
defined? If they are defined, what will the order of
their product be?
a) 𝐴 × 𝐵
b) 𝐵 × 𝐴
c) 𝐶 × 𝐵
d) 𝐶 × 𝐶
e) 𝐴 × 𝐴
f) 𝐵 × 𝐵 𝑇
Examples
 𝐴 → 3 × 2, 𝐵 → 2 × 4, 𝐶 → 3 × 3
a) 𝐴 × 𝐵
3 × 2 × 2 × 4
Can be multiplied.
Resultant order is 3 × 4
b) 𝐵 × 𝐴
2 × 4 × 3 × 2
Inside numbers do not match.
Product is undefined
Examples
 𝐴 → 3 × 2, 𝐵 → 2 × 4, 𝐶 → 3 × 3
c) 𝐶 × 𝐵
3 × 3 × 2 × 4
Inside numbers do not match.
Product is undefined
d) 𝐶 × 𝐶
3 × 3 × 3 × 3
Can be multiplied.
Resultant order is 3 × 3
Examples
 𝐴 → 3 × 2, 𝐵 → 2 × 4, 𝐶 → 3 × 3
e) 𝐴 × 𝐴
3 × 2 × 3 × 2
Inside numbers do not match.
Product is undefined
f) 𝐵 × 𝐵 𝑇
(recall that in 𝐵 𝑇
, row and columns are
swapped)
2 × 4 × 4 × 2
Inside numbers match. Can be multiplied
Resultant order is 2 × 2
How to multiply matrices
 Rule: Let 𝐴 and 𝐵 be matrices whose product, 𝐴 × 𝐵, is
defined as 𝐶.
 To calculate the value of element 𝑐𝑖,𝑗, we combine the 𝑖 𝑡ℎ
row of matrix 𝐴 and the 𝑗 𝑡ℎ column of matrix 𝐵.
𝑎1,1 𝑎1,2
𝑎2,1 𝑎2,2
𝑎3,1 𝑎3,2
×
𝑏1,1 𝑏1,2
𝑏2,1 𝑏2,2
=
𝑐1,1 𝑐1,2
𝑐2,1 𝑐2,2
𝑐3,1 𝑐3,2
A combination of the 2nd row of 𝐴 and the 1st column of
𝐵 gives the element in the 2nd row and 1st column of 𝐶.
How to multiply matrices
 How do we actually combine the elements of the row and
column?
 Consider both the row and column as a list of numbers
 Multiply the corresponding elements in each list together
 Add the results of these products together
Example:
1 2 3 ×
−2
4
0
= 1 × −2 + 2 × 4 + 3 × 0
= −2 + 8 + 0
= [6]
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
=
Row 1
Column 1
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
=
Row 1
Column 1
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
= 1 × −1 + 2 × 2
Cell 1,1
Row 1
Column 1
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
= 3Row 1
Column 2
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
= 3Row 1
Column 2
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
= 3 1 × −3 + 2 × 4Row 1
Column 2
Cell 1,2
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
= 3 5
Cell 1,3: 1 × −5 + 2 × 6
Cell 2,1: 3 × −1 + 4 × 2
Cell 2,2: 3 × −3 + 4 × 4
Cell 2,3: 3 × −5 + 4 × 6
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
= 3 5
Cell 1,3: 7
Cell 2,1: 5
Cell 2,2: 7
Cell 2,3: 9
How to multiply matrices (cont)
 If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by
combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix
𝐵.
Example:
1 2
3 4
×
−1 −3 −5
2 4 6
=
3 5 7
5 7 9
Cell 1,3: 7
Cell 2,1: 5
Cell 2,2: 7
Cell 2,3: 9
Matrix Product Applications
 Juline's Noodle House sells Pad Thai for $10.40, Nasi
Goreng for $11.50 and Spring Rolls for $6.
This is represented with the cost matrix
10.40 11.50 6.00 .
 Her sales of those three items over one week are
represented in a matrix, where each column represents
a weekday, and each row represents a menu item.
5 6 4
2 1 4
12 9 7
7 15
5 9
15 21
Applications Example continued
a) How many Pad Thai’s were sold on Thursday
 Element at address 1,4 → 7 Pad Thais
b) Write a matrix product to calculate the amount of
money made each day, and calculate the product:
10.40 11.50 6.00 ×
5 6 4 7 15
2 1 4 5 9
12 9 7 15 21
= 147.00 127.90 129.60 220.30 385.50
Special Case: Multiplying By the
Identity Matrix
 When multiplying a matrix by the identity matrix
(either before or after), the original matrix does not
change.
 Ex.
1 2
3 4
×
1 0
0 1
=
1 × 1 + 2 × 0 1 × 0 + 2 × 1
3 × 1 + 4 × 0 3 × 0 + 4 × 1
= [
1 2
3 4
]

Lesson 3 - matrix multiplication

  • 2.
    Learning Intention andSuccess Criteria  Learning Intention: Students will understand the rules that define matrix multiplication and their reasons for being  Success Criteria: You will be determine the possibility of multiplying two matrices by one another, and where possible will be able to multiply a matrix by another matrix
  • 3.
    Matrix Multiplication Requirements  Notall matrices can be multiplied together, just as not all matrices can be added  The ability to multiply is dependent on the order of the matrices  If 𝐴 has order 𝑚 × 𝑛 (𝑚 rows and 𝑛 columns) and 𝐵 has order 𝑝 × 𝑟 (𝑝 rows and 𝑟 columns), we can multiply 𝐴 × 𝐵 only if 𝑛 = 𝑝. The resultant matrix will have order 𝑚 × 𝑟  We say the product is undefined if the matrices cannot be multiplied
  • 4.
    Matrix Multiplication Requirements  Thatis, to multiply two matrices with orders 𝑚 × 𝑛 × (𝑝 × 𝑟)  Note that 𝐴 × 𝐵 might be defined, but 𝐵 × 𝐴 undefined.  Another way to say if multiplication is possible is: “The number of columns in the first matrix must be equal to the number of rows in the second matrix” Must be the same Order of resultant matrix
  • 5.
    Examples  If 𝐴is a 3 × 2 matrix, 𝐵 is a 2 × 4 matrix and 𝐶 is a 3 × 3 matrix, which of the following products will be defined? If they are defined, what will the order of their product be? a) 𝐴 × 𝐵 b) 𝐵 × 𝐴 c) 𝐶 × 𝐵 d) 𝐶 × 𝐶 e) 𝐴 × 𝐴 f) 𝐵 × 𝐵 𝑇
  • 6.
    Examples  𝐴 →3 × 2, 𝐵 → 2 × 4, 𝐶 → 3 × 3 a) 𝐴 × 𝐵 3 × 2 × 2 × 4 Can be multiplied. Resultant order is 3 × 4 b) 𝐵 × 𝐴 2 × 4 × 3 × 2 Inside numbers do not match. Product is undefined
  • 7.
    Examples  𝐴 →3 × 2, 𝐵 → 2 × 4, 𝐶 → 3 × 3 c) 𝐶 × 𝐵 3 × 3 × 2 × 4 Inside numbers do not match. Product is undefined d) 𝐶 × 𝐶 3 × 3 × 3 × 3 Can be multiplied. Resultant order is 3 × 3
  • 8.
    Examples  𝐴 →3 × 2, 𝐵 → 2 × 4, 𝐶 → 3 × 3 e) 𝐴 × 𝐴 3 × 2 × 3 × 2 Inside numbers do not match. Product is undefined f) 𝐵 × 𝐵 𝑇 (recall that in 𝐵 𝑇 , row and columns are swapped) 2 × 4 × 4 × 2 Inside numbers match. Can be multiplied Resultant order is 2 × 2
  • 9.
    How to multiplymatrices  Rule: Let 𝐴 and 𝐵 be matrices whose product, 𝐴 × 𝐵, is defined as 𝐶.  To calculate the value of element 𝑐𝑖,𝑗, we combine the 𝑖 𝑡ℎ row of matrix 𝐴 and the 𝑗 𝑡ℎ column of matrix 𝐵. 𝑎1,1 𝑎1,2 𝑎2,1 𝑎2,2 𝑎3,1 𝑎3,2 × 𝑏1,1 𝑏1,2 𝑏2,1 𝑏2,2 = 𝑐1,1 𝑐1,2 𝑐2,1 𝑐2,2 𝑐3,1 𝑐3,2 A combination of the 2nd row of 𝐴 and the 1st column of 𝐵 gives the element in the 2nd row and 1st column of 𝐶.
  • 10.
    How to multiplymatrices  How do we actually combine the elements of the row and column?  Consider both the row and column as a list of numbers  Multiply the corresponding elements in each list together  Add the results of these products together Example: 1 2 3 × −2 4 0 = 1 × −2 + 2 × 4 + 3 × 0 = −2 + 8 + 0 = [6]
  • 11.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = Row 1 Column 1
  • 12.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = Row 1 Column 1
  • 13.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 1 × −1 + 2 × 2 Cell 1,1 Row 1 Column 1
  • 14.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 3Row 1 Column 2
  • 15.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 3Row 1 Column 2
  • 16.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 3 1 × −3 + 2 × 4Row 1 Column 2 Cell 1,2
  • 17.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 3 5 Cell 1,3: 1 × −5 + 2 × 6 Cell 2,1: 3 × −1 + 4 × 2 Cell 2,2: 3 × −3 + 4 × 4 Cell 2,3: 3 × −5 + 4 × 6
  • 18.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 3 5 Cell 1,3: 7 Cell 2,1: 5 Cell 2,2: 7 Cell 2,3: 9
  • 19.
    How to multiplymatrices (cont)  If 𝐶 = 𝐴 × 𝐵, then each element 𝑐𝑖,𝑗 is found by combining row 𝑖 from matrix 𝐴 and column 𝑗 of matrix 𝐵. Example: 1 2 3 4 × −1 −3 −5 2 4 6 = 3 5 7 5 7 9 Cell 1,3: 7 Cell 2,1: 5 Cell 2,2: 7 Cell 2,3: 9
  • 20.
    Matrix Product Applications Juline's Noodle House sells Pad Thai for $10.40, Nasi Goreng for $11.50 and Spring Rolls for $6. This is represented with the cost matrix 10.40 11.50 6.00 .  Her sales of those three items over one week are represented in a matrix, where each column represents a weekday, and each row represents a menu item. 5 6 4 2 1 4 12 9 7 7 15 5 9 15 21
  • 21.
    Applications Example continued a)How many Pad Thai’s were sold on Thursday  Element at address 1,4 → 7 Pad Thais b) Write a matrix product to calculate the amount of money made each day, and calculate the product: 10.40 11.50 6.00 × 5 6 4 7 15 2 1 4 5 9 12 9 7 15 21 = 147.00 127.90 129.60 220.30 385.50
  • 22.
    Special Case: MultiplyingBy the Identity Matrix  When multiplying a matrix by the identity matrix (either before or after), the original matrix does not change.  Ex. 1 2 3 4 × 1 0 0 1 = 1 × 1 + 2 × 0 1 × 0 + 2 × 1 3 × 1 + 4 × 0 3 × 0 + 4 × 1 = [ 1 2 3 4 ]