3.6 Multiplying Matrices

When a matrix product is defined and what its dimensions are, the row-by-column recipe for each element, computing a full product, why matrix multiplication is not commutative, and modelling a cost calculation as a matrix product.

Subject: Algebra 2 · 69 slides · symbolic lesson

Open the interactive version of this deck

What this lesson covers

The lesson, slide by slide

1. Multiply Matrices

Title

Algebra 2 · Lesson 3.6

Every entry of the answer is one whole row meeting one whole column

2. What this lesson gives you

Objectives

Lesson 3.5 gave you three operations that all worked the same way: line the two matrices up, do something to each pair of matching entries, and write the result in the same position. Adding, subtracting and multiplying by a scalar are all like that.

Matrix multiplication is not like that, and this is the one lesson in the chapter where guessing by analogy will let you down. The answer is not built position by position, and it need not even be the same shape as either matrix you started with.

The reason this rule exists, rather than a simpler one, is that it answers many questions at once. By the end of the deck one multiplication will price two teams' equipment lists, total two nights of ticket sales, and turn five students' marks into five final grades.

So a warning and a promise. The rule looks arbitrary the first time you meet it, and most people who dislike matrices learned it as a ritual. Every entry in this deck gets drawn, so that you can see where it came from rather than taking it on trust.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — Before, Now, Why and the Key Vocabulary

3. First, what you already do entry by entry

Warm-up

Warm up on Lesson 3.5, because the contrast is the point. Write your answers down before you read on, and pay attention to the shape of each answer as well as its entries.

\[ \begin{bmatrix}1 & 4\\3 & -2\end{bmatrix} + \begin{bmatrix}5 & -7\\9 & 6\end{bmatrix} \qquad 3\begin{bmatrix}1 & 4\\3 & -2\end{bmatrix} \]

Discussion prompt

Work out the sum and the scalar multiple. Then say, in one sentence each, what rule decided every entry of your answers and what rule decided their dimensions.

Notice how little thinking the position rule asked of you. Top left plus top left gives top left. You could do a hundred of these without once looking at a different row.

Hold on to that, because it is exactly what changes. In a product, the entry in the top left corner is built out of an entire row and an entire column, so six numbers can be involved in producing one.

One more thing worth recalling from 3.5. Addition demanded that the two matrices have identical dimensions. Multiplication will make a demand too, but a different and looser one, and telling the two demands apart is the first job of this lesson.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.5, p. 187 — adding, subtracting and scalar multiplication

4. When a product exists

Section

Part 1

5. A product is not built entry by entry

Concept

Here is the rule, stated before it is justified, because you need something concrete to argue with. The product of two matrices is defined only when the number of columns in the first equals the number of rows in the second.

the product AB — Defined when the number of columns in A equals the number of rows in B. If A is m by n and B is n by p, then AB is m by p.

Read that twice and notice what it does not say. It does not ask the two matrices to be the same shape. It does not ask either of them to be square. It asks for one single agreement, between the columns of the first and the rows of the second.

\[ A: 4 \times 3, \quad B: 3 \times 2 \quad \Longrightarrow \quad AB: 4 \times 2 \]

The answer above is a shape neither matrix had. That alone tells you the answer is not being assembled position by position, because there are positions in it that have no counterpart in either starting matrix.

The reason for the rule is not bureaucracy, and the next slide takes it apart. In one sentence: each entry of the answer comes from pairing off a row of the first matrix with a column of the second, and two lists can only be paired off when they are the same length.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the definition of a matrix product

6. Why the inner numbers have to agree

Intuition

Take a row out of A and a column out of B and lay them beside each other. A row of a 4 by 3 matrix holds three numbers. A column of a 3 by 2 matrix also holds three numbers. That is the only coincidence the definition asks for.

\[ \text{row of } A: \; (a_1, a_2, a_3) \qquad \text{column of } B: \; (b_1, b_2, b_3) \]

You are going to pair them up, first with first, second with second, third with third, multiply each pair, and add. Three pairs, three products, one sum. Nothing is left over and nothing goes unmatched.

\[ a_1b_1 + a_2b_2 + a_3b_3 \]

Now suppose the row had four numbers and the column only three. You could pair three of them and then find yourself holding a fourth number with nothing to multiply it by. There is no sensible answer, which is why the product is simply undefined rather than fudged.

This also explains why the two numbers that had to agree then disappear from the answer. They were used up in the pairing. What survives is how many rows the first matrix had, because that is how many different rows you can choose, and how many columns the second had, because that is how many different columns you can choose.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the Key Concept box

7. The two dimension pairs, written side by side

Picture it

Write the two pairs of dimensions next to each other in order and the rule reads itself off the page. This is worth doing on paper every time until it becomes automatic.

Figure (svg): Two boxes side by side reading 4 by 3 and 3 by 2. A curve above joins the two threes and is labelled as the pair that must match. Arrows from the outer 4 and the outer 2 run down to a third box reading AB is 4 by 2.

The inner numbers only have to agree; they then disappear. The outer numbers are the ones that come through to the answer.

The inner two numbers touch, and they have to be equal. Once they agree they are spent: they do not appear anywhere in the answer, because they were only ever counting how many pairings each entry needed.

The outer two numbers are the ones that reach the answer. The 4 on the far left counts the rows of A, which is how many different rows you could choose. The 2 on the far right counts the columns of B, which is how many different columns you could choose.

Four choices of row times two choices of column is eight entries to compute, and eight is exactly how many cells a 4 by 2 matrix has. The shape of the answer is a count of the questions you can ask.

Try it on a pair where the inner numbers are equal but nothing else is. A 1 by 7 matrix times a 7 by 1 matrix is defined, and the answer is 1 by 1: a single number, built out of fourteen numbers. Nothing in the rule requires the answer to be big.

8. Reading the dimension rule piece by piece

Notation

The book compresses the whole rule into one line of subscripts. Take it apart before you trust it, because every letter in it is doing a specific job.

Annotate

On: \( A_{m \times n} \, B_{n \times p} = (AB)_{m \times p} \)

  • The number of rows in A, and therefore the number of rows in the answer. It is how many different rows you have to choose from, and each choice produces one row of the answer.
  • The columns of A and the rows of B. They are written with the same letter because the rule only makes sense when they are the same number. If you cannot write them with one letter, there is no product.
  • The number of columns in B, and therefore the number of columns in the answer. Each column of B you choose produces one column of the answer.
  • A is written first and B second, and that is part of the statement. Swapping them gives you B times A, which asks whether the columns of B match the rows of A instead, and may well be undefined.
  • There is no requirement that m equals p, that either matrix be square, or that the two matrices look anything alike. Lesson 3.5 needed identical dimensions; this lesson needs one agreement only.

The single most useful habit from this slide is writing the two pairs down before you write anything else. Two seconds spent checking the inner numbers saves you from a page of arithmetic that was never going to lead anywhere.

Say the line aloud once: an m by n times an n by p is an m by p. Once you can chant that sentence you will make almost no dimension errors for the rest of the chapter, and the lessons on determinants and inverses lean on it heavily.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the dimension diagram in the Key Concept box

9. Example 1: is the product defined, and what shape?

Worked example

Two pairs of matrices, and no entries given at all. That is deliberate: the question of whether a product exists is settled entirely by the dimensions, so you can answer it without knowing a single number.

Write part (a) as two pairs in order

Why: A is 4 by 3 and B is 3 by 2, so write the four numbers in the order the matrices are multiplied.

\[ \underbrace{4 \times \;3}_{A} \qquad \underbrace{3\; \times 2}_{B} \]

Now look only at the two numbers in the middle. Everything about whether this product exists is decided there, and the outer numbers have nothing to say about it.

Compare the inner numbers

Why: the columns of A number 3 and the rows of B number 3, so every row of A can be paired off with every column of B.

\[ 3 = 3 \quad \text{so } AB \text{ is defined} \]

Read the outer numbers for the shape

Why: 4 rows to choose from and 2 columns to choose from, so there are 8 entries to work out.

\[ AB \text{ is } 4 \times 2 \]

Now write part (b) as two pairs

Why: A is 3 by 4 and B is 3 by 2 this time, so the middle numbers are 4 and 3.

\[ \underbrace{3 \times \;4}_{A} \qquad \underbrace{3\; \times 2}_{B} \]

Figure (svg): Two boxes reading 3 by 4 and 3 by 2, with the inner 4 and inner 3 joined by a crossed-out curve, and below them the words no product AB in red.

Four numbers cannot be paired off with three. The rule is not a convention: there is literally nothing to multiply the fourth number by.

The picture shows what goes wrong, and it is worth more than the rule. A row of this A holds four numbers, a column of this B holds three, and the fourth number of the row has nothing to be multiplied by.

Check the failure by trying to build one entry

Why: pair the first three numbers of the row with the three numbers of the column and you are left holding a fourth number, so no entry can be completed and the product does not exist.

\[ 4 \ne 3 \quad \text{so } AB \text{ is not defined} \]

Notice that part (b) is not a harder version of part (a); it is a question with no answer. Writing down some product anyway is the commonest thing to go wrong in this whole lesson.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — Example 1

10. Exercise 9: the dimensions the answer must have

Worked example

The book turns this into a multiple-choice question, which tells you it expects a particular wrong answer. Work out the right one first, then look at what the tempting mistakes would be.

\[ A: 2 \times 3, \qquad B: 3 \times 3 \]

Line the dimensions up in order

Why: A first because it is written first in the product AB.

\[ 2 \times \underline{3} \qquad \underline{3} \times 3 \]

Check the inner pair

Why: the columns of A number 3 and the rows of B number 3, so the product exists.

\[ 3 = 3 \]

Take the outer pair for the answer

Why: 2 rows from A and 3 columns from B.

\[ AB \text{ is } 2 \times 3 \]

Two of the offered answers are 3 by 3 and 3 by 2, and both come from the same slip: reading the inner numbers, which are the ones that get used up, instead of the outer ones.

Check by counting entries a different way

Why: there are 2 choices of row and 3 choices of column, so 6 entries have to be computed, and 2 times 3 is the only offered shape with 6 cells.

\[ 2 \times 3 = 6 \text{ entries} \]

Counting entries is a genuinely independent check, because it uses the meaning of the rule rather than the shape of the formula. When the two agree you can move on.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 9

11. Defined, or not defined?

Sorting

Eight pairs of dimensions from the book's exercise set and its two Guided Practice checkpoints. For each one, write the four numbers in order and look only at the middle two. Do not compute anything.

Sort into buckets

Sort each pair by whether the product AB is defined.

AB is defined
A: 2 × 2, B: 2 × 2; A: 3 × 4, B: 4 × 2; A: 1 × 2, B: 2 × 3; A: 2 × 1, B: 1 × 5; A: 5 × 2, B: 2 × 2
AB is not defined
A: 2 × 1, B: 2 × 2; A: 4 × 3, B: 2 × 3; A: 3 × 2, B: 3 × 2
yes
In each of these the columns of A and the rows of B are the same number, so every row of A pairs off exactly with every column of B. Their answers are 2 by 2, 3 by 2, 1 by 3, 2 by 5 and 5 by 2 respectively: the outer numbers, in order.
no
Here the inner numbers disagree, so a row of A and a column of B are lists of different lengths. Notice that the last of these has two matrices of identical dimensions, which would be fine for adding and is useless for multiplying.

The pair of 3 by 2 matrices is the one to look at twice. Identical dimensions is exactly the condition Lesson 3.5 wanted, and here it fails. Two numbers agreeing is not the same as the right two numbers agreeing.

The 2 by 1 times 1 by 5 pair is worth a second look as well. Only one number lies between the two matrices, so each entry of the answer comes from a single product with nothing to add, and the answer is a 2 by 5 matrix: ten entries out of seven numbers.

If you found yourself hesitating, the cure is mechanical rather than conceptual. Write the four numbers in a line, put your finger over the outer two, and read what is left.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercises 3 to 8 and Guided Practice 1 and 2

12. Fill in the shape of AB, and of BA

Comparison

Now do it in both directions. For each pair of matrices, give the dimensions of AB and the dimensions of BA, writing not defined where the product does not exist.

Comparison matrix

A isB isAB isBA is
2 × 33 × 22 by 23 by 3
4 × 33 × 24 by 2not defined
2 × 11 × 52 by 5not defined
3 × 33 × 33 by 33 × 3
1 × 44 × 11 by 14 by 4

Read down the last two columns and the headline of Part 4 arrives early. In the first row both products exist and they are not even the same size, so they cannot possibly be the same matrix. In the second row one of them does not exist at all.

The fourth row is the comfortable case: two square matrices of the same size, where both products exist and both are that same size. Comfortable is not the same as equal, though, and you will see them disagree before the deck is over.

The last row is the one worth enjoying. A single row times a single column gives one number; the same two lists in the other order give a 4 by 4 matrix with sixteen entries. Nothing was added or removed, only reordered.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the dimension rule, applied in both orders

13. Can a product work one way round only?

Prediction

Before the answer, commit to one. A is 4 by 3 and B is 3 by 2, so you already know AB exists and is 4 by 2. The question is about the other order.

Predict first

For A of size 4 by 3 and B of size 3 by 2, which of these is true of BA?

  • BA is not defined at all
  • BA is defined and is 4 by 2, the same as AB
  • BA is defined and is 3 by 3
  • BA is defined and is 2 by 4

Correct: BA is not defined at all

Why: Writing B first puts its dimensions on the left: 3 by 2 followed by 4 by 3. The inner numbers are now 2 and 4, and they disagree, so no entry of BA can be built. The order in which you write two matrices decides which numbers end up next to each other, and therefore whether there is anything to compute.

\[ B: 3 \times \underline{2}, \quad A: \underline{4} \times 3 \quad \Longrightarrow \quad 2 \ne 4 \]

This is the first hint of the big idea in Part 4. With ordinary numbers, if you can work out one product you can work out the other, and they agree. With matrices you may not even be allowed to ask the second question.

It also gives you a fast sanity check on any expression somebody hands you. If a matrix expression is written in a particular order, that order is usually not decoration: reversing it often produces something meaningless.

Notice how the check worked. You did not need any entries, or any arithmetic. You wrote four numbers in the new order, looked at the middle two, and were finished. That is the whole of Part 1 in one move.

14. Trap: demanding that the dimensions match

Trap

The trap

Asked whether a 3 by 2 matrix can be multiplied by another 3 by 2 matrix, a very common answer is yes:

\[ 3 \times 2 \quad \text{and} \quad 3 \times 2 \]

The reasoning behind it is honest. Lesson 3.5 spent a whole lesson insisting that the dimensions had to be identical, and here they are identical.

The same instinct produces the opposite error too: refusing to multiply a 1 by 2 matrix by a 2 by 3 one, because those dimensions plainly are not the same.

The fix

Adding needs matching positions, so it needs identical dimensions. Multiplying needs matching list lengths, which is a different demand: the columns of the first against the rows of the second.

\[ 3 \times \underline{2}, \; \underline{3} \times 2: \; 2 \ne 3 \]

So this product does not exist, even though the sum does. A row of the first matrix holds two numbers and a column of the second holds three.

\[ 1 \times \underline{2}, \; \underline{2} \times 3: \; \text{defined} \]

And that product does exist, even though the two matrices look nothing alike. The answer is 1 by 3. Keep the two conditions in separate drawers: same shape for adding, inner numbers equal for multiplying.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercises 5 and 6, which contrast exactly these two cases

15. One entry at a time

Section

Part 2

16. Pair a row with a column, then add

Concept

Here is the rule the whole lesson turns on, in the book's own words. To find the entry in the ith row and jth column of AB, multiply each entry in the ith row of A by the corresponding entry in the jth column of B, and add the products.

Figure (svg): The row a b drawn as a one by two matrix, and the column e g drawn as a two by one matrix, with curved arrows pairing a with e and b with g, and the result a e plus b g written to the right.

Two pairings, two products, one sum. Everything in the lesson is this picture repeated once for every entry of the answer.

Corresponding is the word carrying the weight. First entry of the row with first entry of the column, second with second, and so on down the list. You are not free to pair them any other way.

Then you add. That single addition is why the answer is one number rather than a list, and it is why an entry of a product can be large even when every entry involved is small.

\[ \begin{bmatrix}a & b\\c & d\end{bmatrix}\begin{bmatrix}e & f\\g & h\end{bmatrix} = \begin{bmatrix}ae + bg & af + bh\\ce + dg & cf + dh\end{bmatrix} \]

Look at where each letter of the answer came from. Every entry in the top row of the answer contains a and b, which are the top row of the first matrix. Every entry in the left column contains e and g, which are the left column of the second.

So the answer's row number is inherited from the first matrix and its column number from the second. That asymmetry is not a quirk of the notation; it is the reason Part 4 exists.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the Key Concept box, Words and Algebra

17. Reading the address of one entry

Notation

Mathematicians name the entry in row i and column j of a matrix by hanging both numbers off the letter as subscripts. Once you can read that notation, the rule fits on one line.

Annotate

On: \( c_{11} = a_{11}b_{11} + a_{12}b_{21} \)

  • The entry of the answer you are building: row 1, column 1. Row always comes first and column second, exactly as in Lesson 3.5. The letter c is just a name for the product matrix.
  • Read them along a row. Both start with 1, so both entries come from row 1 of A, and the second subscript walks across: column 1, then column 2.
  • Read them down a column. Both end in 1, so both entries come from column 1 of B, and the first subscript walks down: row 1, then row 2.
  • The second subscript of a and the first subscript of b move together: 1 with 1, then 2 with 2. That matching pair is the pairing off, written in symbols.
  • It stops when the row of A runs out, which is also when the column of B runs out, because those two counts are the numbers the dimension rule forced to be equal.

You do not have to use this notation to do the arithmetic, and the book mostly does not. It is worth reading fluently anyway, because the definition of a determinant and of an inverse in later lessons are both written this way.

One practical use right now. If a question asks only for the entry in row 2, column 3, you do not compute the whole product. You take row 2 of A, take column 3 of B, pair them off and add, and you are done.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the ith row and jth column wording

18. Row one meets column one

Picture it

Now the same pairing on real numbers. These are the two matrices from the book's Example 2, and this is the first of the four entries of their product, drawn move by move.

Figure (svg): The two by two matrices of Example 2 with row 1 of A shaded, column 1 of B shaded, and the entry in row 1, column 1 of the product ringed. Beside them a running tally gives the two products and their sum, 41.

Row 1 travels across column 1: two products, added, and the single number 41 drops into the one cell where that row and that column cross.

The shaded row of A holds 1 and 4. The shaded column of B holds 5 and 9. Pair them off in order: 1 with 5, then 4 with 9, because those are the first entries of each list and then the second entries of each.

The two products are 5 and 36. Add them and you have 41, and 41 goes in exactly one place: the cell where the shaded row and the shaded column cross, which is row 1, column 1.

Trace the shading with a finger once. The row runs across A, the column runs down B, and the answer sits at the crossing. Every entry you compute for the rest of this lesson is that same gesture with a different row and a different column.

Notice how many numbers went into producing one. Four of the eight numbers in the two matrices were involved, and the other four had nothing to do with this entry. That is why a product cannot be built position by position.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — Example 2, Step 1

19. Example 2: the remaining three entries, and the finished product

Worked example

The first entry is done. Work the other three the same way, changing one thing at a time: first move along to the next column of B, then drop to the next row of A.

\[ A = \begin{bmatrix}1 & 4\\3 & -2\end{bmatrix}, \qquad B = \begin{bmatrix}5 & -7\\9 & 6\end{bmatrix} \]

Multiply row 1 of A by column 2 of B

Why: same row as before, next column along, so the answer lands in row 1, column 2.

\[ 1(-7) + 4(6) = -7 + 24 = 17 \]

Figure (svg): The two by two matrices of Example 2 with row 1 of A shaded, column 2 of B shaded, and the entry in row 1, column 2 of the product ringed. Beside them a running tally gives the two products and their sum, 17.

Row 1 travels across column 2: two products, added, and the single number 17 drops into the one cell where that row and that column cross.

Watch the signs in that one. The first product is negative because 7 is subtracted in B, and the second is positive, so the two partly cancel and leave 17 rather than the 31 you would get from the digits alone.

Multiply row 2 of A by column 1 of B

Why: now drop to the second row of A and go back to the first column of B, so the answer lands in row 2, column 1.

\[ 3(5) + (-2)(9) = 15 - 18 = -3 \]

Figure (svg): The two by two matrices of Example 2 with row 2 of A shaded, column 1 of B shaded, and the entry in row 2, column 1 of the product ringed. Beside them a running tally gives the two products and their sum, −3.

Row 2 travels across column 1: two products, added, and the single number −3 drops into the one cell where that row and that column cross.

Here the cancelling goes the other way and the entry comes out negative, even though both matrices have plenty of positive entries in them. An entry of a product tells you nothing about the sizes of the numbers that made it.

Multiply row 2 of A by column 2 of B

Why: the last row and the last column, which fills the bottom right corner.

\[ 3(-7) + (-2)(6) = -21 - 12 = -33 \]

Figure (svg): The two by two matrices of Example 2 with row 2 of A shaded, column 2 of B shaded, and the entry in row 2, column 2 of the product ringed. Beside them a running tally gives the two products and their sum, −33.

Row 2 travels across column 2: two products, added, and the single number −33 drops into the one cell where that row and that column cross.

Two negatives added here, with no cancelling at all, which is why this is the largest entry in the answer. Keep the brackets round the negative entries while you work: 3 times minus 7 is easy to misread without them.

Simplify the product matrix

Why: collect the four numbers into their four positions, in the order you found them.

\[ AB = \begin{bmatrix}1(5) + 4(9) & 1(-7) + 4(6)\\3(5) + (-2)(9) & 3(-7) + (-2)(6)\end{bmatrix} = \begin{bmatrix}41 & 17\\-3 & -33\end{bmatrix} \]

Check one entry by pairing the other way round

Why: the entry in row 2, column 2 should use row 2 of A and column 2 of B and nothing else; reading it off the two matrices independently gives the same minus 33, so the placement is right.

\[ \text{row 2 of } A = (3, -2), \; \text{col 2 of } B = (-7, 6): \; -21 - 12 = -33 \]

Checking a product means checking one entry properly rather than glancing at all four. Pick the entry with the messiest signs, rebuild it from the two matrices, and compare.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — Example 2, Steps 1 to 5

20. Guided Practice 3: which numbers pair with which?

Fill the middle

New matrices, same gesture. The entry you are asked for is in row 2, column 1, so it uses row 2 of the first matrix and column 1 of the second, and nothing else from either.

\[ A = \begin{bmatrix}-3 & 3\\1 & -2\end{bmatrix}, \qquad B = \begin{bmatrix}1 & 5\\-3 & -2\end{bmatrix} \]

Fill in the blanks

c_1 = 1(-3) + (-2)(7) = ___

Why: Row 2 of A is 1 and minus 2, which is already written for you. Column 1 of B is 1 and minus 3, read downwards. Pair them in order: 1 with 1 and minus 2 with minus 3, giving 1 plus 6, which is 7. The commonest wrong answer uses 1 and 5, which is row 1 of B rather than column 1.

The numbers you had to supply were read down a column, not across a row. If you found yourself reaching for 1 and 5, you read along the top row of B, and that is the single most common error in this lesson.

The full product, worked the same way four times, is 12 and 21 both negative on the top row, then 7 and 9 on the bottom. Work out the other three entries now if you want the practice; the entry you just built is the hardest of the four because of the two negatives.

Notice that minus 2 times minus 3 gave a positive 6, which then added to the 1 rather than eating into it. Two negative entries in the right places make an entry of a product bigger, not smaller.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — Guided Practice 3

21. Find the error: a row paired with a row

Error analysis

This is the book's own error-analysis exercise, and the mistake in it is the one worth being able to name. Work out the correct first entry yourself before opening the notes.

\[ \begin{bmatrix}3 & -1\\6 & 2\end{bmatrix}\begin{bmatrix}7 & 0\\1 & -6\end{bmatrix} \]

Annotate

On: \( 3(7) + (-1)(0) = 21 \)

  • This part is right. The 3 is the first entry of row 1 of A, the 7 is the first entry of column 1 of B, and they are a genuine pair.
  • Here is the error. The 0 is the second entry of the first ROW of B, not of its first column. The second entry of column 1 of B is the 1 sitting underneath the 7.
  • Both matrices are written out in rows, so reading across is what your eye already does. Pairing a row with a row feels symmetrical and produces a tidy answer, which is exactly why it goes unnoticed.
  • Pair 3 with 7 and minus 1 with 1, which gives 21 minus 1, so the entry is 20 rather than 21. One number out of place moved the answer by only 1, which is another reason this slips through.
  • Say out loud which way you are reading each matrix: across for the first, down for the second. Better still, run a finger across A and down B, as in the drawn figures.

\[ 3(7) + (-1)(1) = 21 - 1 = 20 \]

Notice how small the damage looks. The wrong answer is 21 and the right one is 20, so nothing about the size of the number warns you. Errors of method often produce plausible numbers, which is why the method has to be checked rather than the answer.

The full correct product here is 20 and 6 on the top row and 44 and minus 12 on the bottom. If you want to test yourself on the method rather than the arithmetic, work out the bottom left entry and say aloud which row and which column you used.

One general lesson. Every entry of a product is made from a row of the first matrix and a column of the second, always in that combination. A row with a row, or a column with a column, is never part of the rule.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 19

22. Trap: taking the first number out of each matrix

Trap

The trap

Asked for the entry in row 1, column 1 of a product, here is a very common first line:

\[ 2(4) + 1(-8) = 0 \]

The matrices were 2 and 1 over 5 and 7, times 4 and minus 8 over 3 and minus 1. The 2 and the 1 are right: they are row 1 of the first matrix.

Then the 4 and the minus 8 were taken, which are the first two numbers written in the second matrix. The answer comes out as a clean 0, which feels like a good sign.

The fix

The second matrix has to be read downwards. Column 1 holds the 4 and, below it, the 3. The minus 8 belongs to column 2 and has no business in this entry at all.

\[ 2(4) + 1(3) = 8 + 3 = 11 \]

So the entry is 11, not 0. The clean zero was a coincidence produced by the wrong numbers, and a tidy answer is never evidence that a method was right.

A quick guard: count the columns you touch in the second matrix. For one entry of the answer you should have touched exactly one.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 20

23. Exercise 13: fill the product in, one entry at a time

Comparison

Four entries, four pairings. The rows and columns are named for you in the table, so all that is left is to pair each row off against each column and add.

\[ \begin{bmatrix}9 & -3\\0 & 2\end{bmatrix}\begin{bmatrix}0 & 1\\4 & -2\end{bmatrix} \]

Comparison matrix

column 1 of B is 0 and 4column 2 of B is 1 and −2
row 1 of A is 9 and −3-1215
row 2 of A is 0 and 28-4

The top left entry is 9 times 0 plus minus 3 times 4, which is 0 minus 12. A zero in one of the matrices does not make the entry zero; it only silences one of the two products.

The bottom left entry is 0 times 0 plus 2 times 4, which is 8. The two zeros there are in different matrices and are pulling on different products, so one of them survives.

Reading the finished table as a matrix, the product is 12 negative and 15 positive on the top row, then 8 and minus 4 on the bottom. Laying it out as a grid of rows against columns like this is worth doing whenever the signs are getting away from you.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 13

24. Where each entry lives: rows across, columns down

Picture it

This layout is worth learning as a piece of stationery. Write the second matrix above the answer and the first matrix to its left, and every entry of the answer sits where its own row and its own column cross.

Figure (svg): Matrix B drawn above the answer matrix and matrix A drawn to its left, so every entry of the answer sits where its row of A and its column of B cross. Row 2 of A is shaded across, column 1 of B is shaded downwards, and the entry 8 where they meet is ringed.

Laid out this way the answer needs no remembering. Slide your finger along a row of A and down a column of B, and the cell they cross is where their number belongs.

The shaded band running across is row 2 of the first matrix. The shaded band running down is column 1 of the second. They overlap in exactly one cell of the answer, and that cell is the 8.

Laid out this way the addresses cannot be forgotten, because they are geometry rather than memory. You do not ask yourself where the answer goes; you look at where the bands cross.

It also makes the dimension rule visible. The first matrix has to be as wide as the second is tall, or the bands would not line up along their shared edge, and there would be nothing to pair off.

Use it when a product is bigger than 2 by 2 and you are losing track. The answer here is 3 by 2, so there are six crossings to fill, and the layout tells you at a glance which ones you have not done yet.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 15, laid out row against column

25. How much arithmetic is one product?

Estimation

Before you meet bigger matrices, get a feel for the size of the job. Every entry of the answer needs its own row-and-column pairing, so the work grows with the answer, not with the matrices.

\[ A: 4 \times 3, \qquad B: 3 \times 5 \]

Predict first

How many separate multiplications does the whole product AB take?

  • Twelve
  • Fifteen
  • Sixty
  • Six hundred

Correct: Sixty

Why: The answer is 4 by 5, so there are twenty entries to find. Each one pairs a row of three numbers with a column of three numbers, so each needs three multiplications, and twenty lots of three is sixty. There are also forty additions, two for every entry.

Twenty entries, three multiplications each. The arithmetic you do is the number of entries multiplied by the length of the pairing, which is the three outer and inner numbers all multiplied together.

This is why the exercises stay small and why calculators exist for the rest. The book's own graphing calculator activity for Lesson 3.5 is there for exactly this reason, and nothing about the method changes when a machine does the adding.

It also tells you when to compute a single entry rather than a whole product. If a question asks what one entry means, doing all sixty multiplications is throwing away fifty-seven of them.

One more use for the count. If you finish a product suspiciously fast, count the entries you actually built. A 4 by 5 answer with only twelve numbers in it is missing eight.

26. Products of other shapes

Section

Part 3

27. The answer's shape is a count of the questions

Concept

Every product so far has been two by two, which hides the interesting part: the answer usually has a shape of its own. Where does that shape come from? From how many rows you can choose and how many columns you can choose.

\[ A: m \times n, \quad B: n \times p \quad \Longrightarrow \quad AB: m \times p \]

Each entry of the answer is the result of one choice of row from A and one choice of column from B. So the answer has one cell for every such pair of choices, which is m rows of cells and p columns of cells.

That is why the inner numbers vanish and the outer ones survive. The inner number counted how many terms each entry needed, not how many entries there were, and it is spent inside every single entry.

\[ A: 3 \times 2, \quad B: 2 \times 2 \quad \Longrightarrow \quad AB: 3 \times 2 \]

In that example the answer keeps the first matrix's shape, which happens whenever the second matrix is square. It is a coincidence of the numbers, not a rule, and the next two slides show shapes that behave nothing like it.

The extreme cases are the ones worth carrying in your head. A single row times a single column gives one number. A single column times a single row gives a whole rectangle. Same lists, opposite orders, and completely different answers.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the m by n and n by p statement

28. Exercise 10: a row times a column gives one number

Worked example

The smallest interesting product in the exercise set. A 1 by 2 matrix times a 2 by 1 matrix, which by the rule is 1 by 1: a matrix with exactly one entry in it.

\[ \begin{bmatrix}3 & -1\end{bmatrix}\begin{bmatrix}5\\7\end{bmatrix} \]

Check the dimensions first

Why: the columns of the first matrix number 2 and the rows of the second number 2, so the product exists and is 1 by 1.

\[ 1 \times \underline{2}, \; \underline{2} \times 1 \quad \Longrightarrow \quad 1 \times 1 \]

Only one row to choose from and only one column to choose from, so there is only one entry to compute. All the work of this product goes into a single number.

Pair the row off against the column

Why: first with first and second with second: 3 with 5 and minus 1 with 7.

\[ 3(5) + (-1)(7) \]

Multiply and add

Why: two products, then one addition.

\[ 15 - 7 = 8 \]

Check by counting what went in and what came out

Why: four numbers went in, two products came out, and one sum remains, so the answer is the single entry 8 and the brackets round it are not optional.

\[ \begin{bmatrix}3 & -1\end{bmatrix}\begin{bmatrix}5\\7\end{bmatrix} = \begin{bmatrix}8\end{bmatrix} \]

A 1 by 1 matrix behaves almost exactly like the number inside it, and this particular pairing turns up so often in later mathematics that it has its own name, the dot product. For now it is simply the smallest possible product.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 10

29. Exercise 11: the same two lists, the other way round

Worked example

Now reverse the order: a column times a row. Nothing about the numbers has changed, and the rule is about to give an answer of a completely different size.

\[ \begin{bmatrix}1\\4\end{bmatrix}\begin{bmatrix}-2 & 1\end{bmatrix} \]

Check the dimensions

Why: 2 by 1 followed by 1 by 2: the inner numbers are 1 and 1, so the product exists and the outer numbers make it 2 by 2.

\[ 2 \times \underline{1}, \; \underline{1} \times 2 \quad \Longrightarrow \quad 2 \times 2 \]

Two rows to choose from and two columns to choose from, so four entries. And each row of the first matrix holds only one number, so each entry is a single product with nothing to add.

Multiply row 1 by each column

Why: the row is just the number 1, so each entry is that 1 times the entry of the corresponding column.

\[ 1(-2) = -2, \qquad 1(1) = 1 \]

Multiply row 2 by each column

Why: the row is just the number 4.

\[ 4(-2) = -8, \qquad 4(1) = 4 \]

Figure (svg): Two panels. In the first, a one by two row times a two by one column gives a single number, 8. In the second, a two by one column times a one by two row gives a two by two matrix. Dimension labels under each matrix show how the inner numbers vanish and the outer ones survive.

Swapping the order of the very same two lists changes a single number into a four-entry matrix. The outer numbers of the dimensions are the shape of the answer.

Put the two exercises side by side and the point lands. The first gave one number out of four; the second gives four numbers out of the same four. The order decided which of the dimensions met in the middle and were used up.

Check the shape against the rule and one entry against the pairing

Why: the answer is 2 by 2 as predicted, and its bottom right entry should use row 2 of the first matrix and column 2 of the second, which is 4 times 1, so 4 is correct.

\[ \begin{bmatrix}1\\4\end{bmatrix}\begin{bmatrix}-2 & 1\end{bmatrix} = \begin{bmatrix}-2 & 1\\-8 & 4\end{bmatrix} \]

Notice that every row of this answer is a multiple of the row you multiplied by. That is worth remembering: a column times a row always produces a matrix whose rows are all multiples of one another.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercises 10 and 11

30. Exercise 15: a 3 by 2 matrix times a 2 by 2 matrix

Worked example

Six entries this time, which is enough that bookkeeping starts to matter. Work down the rows, and within each row work across the columns, so you never have to wonder what you have already done.

\[ \begin{bmatrix}5 & 2\\0 & -4\\1 & 6\end{bmatrix}\begin{bmatrix}3 & 7\\-2 & 0\end{bmatrix} \]

Check the dimensions

Why: 3 by 2 then 2 by 2, so the inner numbers are 2 and 2 and the answer is 3 by 2.

\[ 3 \times \underline{2}, \; \underline{2} \times 2 \quad \Longrightarrow \quad 3 \times 2 \]

Multiply row 1 by both columns

Why: row 1 is 5 and 2; column 1 is 3 and minus 2, column 2 is 7 and 0.

\[ 5(3) + 2(-2) = 11, \qquad 5(7) + 2(0) = 35 \]

The 0 in the second column of the second matrix silences the second product but not the first, so that entry is simply 35. Zeros make an entry smaller, never automatically zero.

Multiply row 2 by both columns

Why: row 2 is 0 and minus 4.

\[ 0(3) + (-4)(-2) = 8, \qquad 0(7) + (-4)(0) = 0 \]

The bottom of the second column is genuinely 0 here, and it happened by accident: a zero in the row met a zero in the column. Do not read anything into it; the next row is nowhere near zero.

Multiply row 3 by both columns

Why: row 3 is 1 and 6.

\[ 1(3) + 6(-2) = -9, \qquad 1(7) + 6(0) = 7 \]

Collect the six entries

Why: each one goes in the row of A and the column of B it was built from.

\[ \begin{bmatrix}5 & 2\\0 & -4\\1 & 6\end{bmatrix}\begin{bmatrix}3 & 7\\-2 & 0\end{bmatrix} = \begin{bmatrix}11 & 35\\8 & 0\\-9 & 7\end{bmatrix} \]

Check the second column against the second column of B

Why: every entry of the answer's second column used the column 7 and 0, so each is 7 times the first entry of its row of A: 7 times 5 is 35, 7 times 0 is 0, and 7 times 1 is 7, which matches all three.

\[ 7(5) = 35, \; 7(0) = 0, \; 7(1) = 7 \]

That check is stronger than recomputing, because it tests all three entries at once using a pattern you had not used when you built them. Look for a column of the second matrix with a zero in it; it hands you a check for free.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 15

31. Before multiplying anything: two questions

Step zero

Two exercises from the book that punish anyone who starts calculating straight away. Answer the dimension question first, every time, and one of these turns out to need no work at all.

\[ \text{(i)} \; \begin{bmatrix}-1 & 0\\5 & 4\end{bmatrix}\begin{bmatrix}4 & -6\end{bmatrix} \qquad \text{(ii)} \; \begin{bmatrix}0 & -4\\2 & 5\\4 & 0\end{bmatrix}\begin{bmatrix}2 & 8\\3 & 0\\-5 & -2\end{bmatrix} \]

Discussion prompt

For each of these two products, write down the two pairs of dimensions in order and decide whether the product is defined. Where it is not, say exactly which pairing runs out of numbers.

The habit is cheap and it never fails. Four numbers, in order, cover the outer two, check the middle two. Ten seconds, and it tells you whether the next five minutes are worth spending.

The second of these is the trap from Part 1 wearing a disguise, because the matrices look so suitable. Equal dimensions is the condition for adding, and it is close to the worst possible condition for multiplying a non-square pair.

There is a useful reflex hiding here too. If a product is undefined one way round, check the other way: the second one becomes defined the moment you swap the two matrices, since 3 by 2 times 2 by 3 works and gives a 3 by 3 answer.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercises 12 and 16

32. Match each pair of shapes to the shape of its product

Matching

No entries again, just shapes. For each pair, write the four numbers in order, check the middle two, and read the outer two. One of these pairs is a trick.

Match the pairs

  • a. A is 2 × 3 and B is 3 × 4
  • b. A is 3 × 1 and B is 1 × 3
  • c. A is 1 × 3 and B is 3 × 1
  • d. A is 4 × 2 and B is 4 × 2
  • w. AB is 2 × 4
  • x. AB is 3 × 3
  • y. AB is 1 × 1, a single number
  • z. AB is not defined

Why: Each answer is the outer pair of numbers, once the inner pair has been checked. The pair of 4 by 2 matrices is the trick: their shapes are identical, which is the condition for adding and not for multiplying, since the inner numbers are 2 and 4. The two pairs built from a single row and a single column are the extreme cases, giving a 3 by 3 matrix one way round and one number the other.

The 3 by 1 and 1 by 3 pairing is worth dwelling on. Six numbers go in and nine come out, which feels like getting something for nothing until you notice that the nine entries are all built from those same six and are therefore heavily related to each other.

The reverse pairing takes the same six numbers and returns one. Whatever a product does, it is not conserving the amount of information: the inner dimension is where information gets combined and lost.

If you matched the identical shapes to a product, go back to Part 1's trap slide. That one confusion, between the condition for adding and the condition for multiplying, is responsible for more lost marks in this chapter than any arithmetic slip.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercises 3 to 8, in a different form

33. Exercise 14: two entries missing

Fill the middle

Two entries are given and two are missing. Work out which row and which column each missing entry needs before you multiply anything.

Fill in the blanks

\begin-155 & 0\\-4 & 1\end-6\begin___-3 & 2\\6 & 2\end___ = \begin______ & 10\\18 & ___\end___

Why: The top left entry needs row 1 of the first matrix, which is 5 and 0, with column 1 of the second, which is minus 3 and 6. That gives minus 15 plus 0, so minus 15. The bottom right entry needs row 2, which is minus 4 and 1, with column 2, which is 2 and 2, giving minus 8 plus 2, so minus 6. Notice that the 0 in the first row silenced the 6 entirely.

The zero in the first matrix is doing something specific: it deletes the contribution of the whole bottom row of the second matrix from both entries of the answer's top row. A zero is not nothing; it is a switch.

Check the two entries you were given while you are here. The 10 is 5 times 2 plus 0 times 2, and the 18 is minus 4 times minus 3 plus 1 times 6, which is 12 plus 6. Both of those use the same pairing rule and are worth reconstructing.

If your bottom right entry came out as minus 10, you paired minus 4 with 2 and then 1 with something other than the 2 below it. Run a finger down the second column and count: two entries, both of them 2.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 14

34. Put the moves of a whole product in order

Ranking

You now know every individual move. Putting them in the right order is what makes a big product manageable, and it is also what stops you doing five minutes of arithmetic on a product that does not exist.

Put in order

Order these moves for computing a product from scratch.

  1. Write the two pairs of dimensions in order and compare the inner numbers
  2. Read the outer numbers to see how many entries the answer has
  3. Take one row of the first matrix and one column of the second
  4. Pair them off in order, multiply each pair, and add the products
  5. Put that single number in the row and column it came from
  6. Repeat until every cell of the answer is filled, then check one entry

Why: The dimension check comes first because it can end the problem, and reading the outer numbers comes next because it tells you how many entries to expect and therefore when you have finished. Only then does any arithmetic happen: choose a row and a column, pair and add, place the result at their crossing, and repeat. Checking one entry at the end is the step people skip, and it is the only one that can catch a misread column.

The step that people leave out is the second one, and leaving it out costs more than it looks. If you do not know the answer is 3 by 2, you have no way of noticing that you stopped after four entries instead of six.

Notice that the middle three moves are a single loop. There is no new idea after the first entry: whatever your answer's shape, you are doing the same three things once per cell.

The final check is worth building into the loop rather than saving up. Rebuild the entry with the ugliest signs immediately after you write it, while the row and column you used are still fresh.

35. Why a single number needs brackets

Intuition

Exercise 10 gave an answer of 8 written inside brackets, and it is fair to ask whether the brackets matter. They do, and the reason is worth a slide.

\[ \begin{bmatrix}8\end{bmatrix} \quad \text{against} \quad 8 \]

A 1 by 1 matrix is a matrix, and it obeys the dimension rule. It may be multiplied by a 1 by n matrix and by nothing else. The number 8 may be used as a scalar and multiplied into any matrix at all.

So the two objects behave differently even though they hold the same information, and the difference shows up as soon as you try to use them. That is the same distinction Lesson 3.5 drew between scalar multiplication and matrix operations.

In practice, once a product has collapsed to one entry, almost everybody writes the number and moves on, and no harm comes of it. Know why it is technically a matrix, and then be relaxed about it.

There is a real use for this. The grading exercise later in the deck turns each student's three marks into a 1 by 1 total, and reading that single entry as an ordinary number is exactly what you want to do with it.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 199 — Exercise 10, whose answer is written as a matrix

36. Order matters

Section

Part 4

37. AB and BA are two different questions

Concept

With ordinary numbers, 3 times 7 and 7 times 3 are the same thing, and you have relied on that since primary school. It is called the commutative property, and matrices do not have it.

Look at the rule and you can see why in advance. The rows of the answer come from the first matrix and its columns from the second, so swapping the two matrices swaps which one supplies the rows.

\[ AB: \; \text{rows from } A, \text{ columns from } B \]

\[ BA: \; \text{rows from } B, \text{ columns from } A \]

Those are not the same instruction, so there is no reason at all for them to produce the same answer, and in general they do not. You met the extreme version of this in Part 1, where one order was defined and the other was not.

The book puts a warning beside Example 2 for exactly this reason: order is important when multiplying matrices, and to find AB you write A on the left and B on the right. Not because of a convention about reading, but because the left matrix supplies the rows.

Everything in this part is one idea with three consequences. You may not swap the factors, you may not cancel a matrix, and a product of two matrices can be zero without either of them being zero.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — the Avoid Errors note beside Example 2

38. Example 2 reversed: the product BA

Worked example

Same two matrices, opposite order. Both products exist here, because both matrices are 2 by 2, so this is the fairest possible comparison: nothing is undefined and nothing changes shape.

\[ B = \begin{bmatrix}5 & -7\\9 & 6\end{bmatrix}, \qquad A = \begin{bmatrix}1 & 4\\3 & -2\end{bmatrix} \]

Be careful about which matrix is now supplying the rows. The rows come from B, so the pairs of numbers you pick up first are 5 and minus 7, then 9 and 6.

Multiply row 1 of B by column 1 of A

Why: row 1 of B is 5 and minus 7; column 1 of A is 1 and 3.

\[ 5(1) + (-7)(3) = 5 - 21 = -16 \]

Multiply row 1 of B by column 2 of A

Why: same row, next column: column 2 of A is 4 and minus 2.

\[ 5(4) + (-7)(-2) = 20 + 14 = 34 \]

Multiply row 2 of B by column 1 of A

Why: row 2 of B is 9 and 6.

\[ 9(1) + 6(3) = 9 + 18 = 27 \]

Multiply row 2 of B by column 2 of A

Why: the last crossing, bottom right.

\[ 9(4) + 6(-2) = 36 - 12 = 24 \]

Now compare with the earlier answer before reading on. AB was 41 and 17 on top, then minus 3 and minus 33. Not one of those four numbers appears here.

Collect and compare with AB

Why: the four entries of BA are all positive or all sign-reversed compared with AB, and no entry agrees.

\[ BA = \begin{bmatrix}-16 & 34\\27 & 24\end{bmatrix} \ne \begin{bmatrix}41 & 17\\-3 & -33\end{bmatrix} = AB \]

Check the top left entry of each independently

Why: for AB it is row 1 of A against column 1 of B, so 1 times 5 plus 4 times 9, which is 41; for BA it is row 1 of B against column 1 of A, so 5 times 1 plus minus 7 times 3, which is minus 16. Different rows and different columns, so different answers.

\[ 41 \ne -16 \]

The check is the whole point of the example. The two calculations use the same eight numbers and pair them up differently, and the pairing is what the order controls.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — the BA calculation printed under Example 2

39. AB beside BA, entry for entry

Picture it

The two answers, drawn together, from the same pair of matrices. Look at how completely they disagree before reading the commentary.

Figure (svg): Two rows of matrices. The top row multiplies A by B and gives 41, 17, minus 3, minus 33. The bottom row multiplies B by A and gives minus 16, 34, 27, 24. No entry is shared between the two answers.

Not one of the four entries survives the swap. Order is part of the question, not a detail of how you write it down.

Four entries, four disagreements, and not even a shared sign pattern. AB has two negative entries in its bottom row; BA has none at all.

Notice what is the same in the two rows of the picture: the matrices. Nothing was changed except which one was written first, and the answer changed entirely.

This is the single most important slide in the deck for avoiding errors later in the chapter. Whenever you are given a matrix expression, the order in it is information, and rearranging it is not a tidying-up move you are entitled to make.

It is worth asking what would have to be true for the two answers to agree. Every entry would have to come out the same, which is four separate coincidences, so agreement is the surprising case rather than the expected one.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — the comparison of AB and BA

40. Why the recipe itself forces the order to matter

Socratic

You have now seen that the two orders disagree. It is much more useful to be able to say why, from the rule alone, without doing any arithmetic.

Discussion prompt

Explain, using only the row-times-column rule, why the entry in row 1, column 2 of AB is generally not the entry in row 1, column 2 of BA. Name the row and the column each one uses.

This is worth being able to say out loud, because it converts a fact you have to remember into a consequence you can rebuild. The asymmetry is built into the rule: rows always come from the left matrix and columns from the right.

Contrast it with adding. In a sum, the entry in row 1, column 2 pairs the entry in row 1, column 2 of one matrix with the entry in the same position of the other, and swapping them swaps two numbers that are then added. Addition does commute, for exactly that reason.

So the two operations differ in a way you can point at. Adding treats the two matrices symmetrically; multiplying gives them different jobs.

41. Trap: swapping the factors to make the arithmetic easier

Trap

The trap

Asked for AB, and finding that B has the friendlier numbers, it is tempting to multiply the other way round and write the answer down as AB.

\[ 5(1) + (-7)(3) = -16 \]

That line is a perfectly correct calculation. It is the top left entry of BA, computed from row 1 of B and column 1 of A.

The trouble is only that the question asked for AB, whose top left entry uses row 1 of A and column 1 of B instead.

The fix

Written in the order the question asked for, the first row you pick up is 1 and 4, from A, and the first column is 5 and 9, from B.

\[ 1(5) + 4(9) = 41 \]

So the entry is 41, and the swapped calculation was answering a different question. With numbers this shortcut is free; with matrices it changes the answer.

The guard is a sentence, not a technique. Before the first multiplication, say which matrix is supplying the rows. If it is not the one written on the left, start again.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 196 — the Avoid Errors note

42. Two matrices that are not zero, with a zero product

Counterexample

Here is a second habit from ordinary numbers that matrices break. If a product of two numbers is zero, one of them has to be zero, and you have used that every time you solved a quadratic by factoring.

Figure (svg): A two by two matrix with a single 1 in the top left multiplied by a two by two matrix with a single 1 in the bottom right, giving a matrix of four zeros.

Each row of the left matrix is aimed at a column of zeros in the right one. Nothing about either matrix is zero, and yet every pairing collapses.

Discussion prompt

Multiply these two matrices out yourself, entry by entry, and then say which fact about ordinary numbers has just failed and why the row-and-column rule allows it to.

The practical consequence is worth stating plainly. If you ever reach a matrix equation of the form one matrix times another equals the zero matrix, you may not conclude that either matrix is zero.

The same failure kills cancelling. From one number times a equalling one number times b you may divide by the number and conclude a equals b. With matrices that reasoning is not available, because the thing you wanted to divide by may behave like the matrices above.

You will meet the repair in Lesson 3.8. Some square matrices do have an inverse, and those are the ones you may cancel; the two matrices drawn here do not, which is exactly why they can conspire to give zero.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 200 — Exercise 35, on matrices that behave unexpectedly under multiplication

43. Can AB ever equal BA?

Prediction

Not commutative means not always equal, which is a weaker statement than never equal. The book sets an exercise asking you to find two different matrices whose two products do agree, so it is worth deciding what you expect first.

Predict first

Is it possible to find two different matrices A and B for which AB and BA are exactly the same matrix?

  • Yes, and one easy way is to make one of them a multiple of the identity pattern
  • No, the two products can never agree
  • Only when both matrices have all their entries equal
  • Only when one of the matrices is the zero matrix

Correct: Yes, and one easy way is to make one of them a multiple of the identity pattern

Why: Take A with 2 on the main diagonal and 0 elsewhere, and let B be any two by two matrix at all. Multiplying either way simply doubles every entry of B, so the two products agree. The zero matrix works too, but it is not the only case, and equal entries is neither necessary nor sufficient.

\[ A = \begin{bmatrix}2 & 0\\0 & 2\end{bmatrix}, \; B = \begin{bmatrix}3 & 1\\0 & 3\end{bmatrix} \; \Longrightarrow \; AB = BA = \begin{bmatrix}6 & 2\\0 & 6\end{bmatrix} \]

Work the two products through if you want to be convinced. Every row of that A holds a 2 and a 0, so every pairing keeps one entry of B and discards the other, and the effect is simply to double B.

So the honest statement of the rule is that matrix multiplication is not commutative in general. Particular pairs may commute, and you have just met a whole family of them, but you may never assume it of a pair you were handed.

Lesson 3.8 makes this family respectable. The matrix with 1 on the diagonal and 0 elsewhere leaves every matrix unchanged from either side, and it is called the identity matrix for that reason.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 200 — Exercise 35

44. The properties that do survive

Concept

Losing commutativity does not mean losing everything. Three of the properties you know from ordinary numbers hold perfectly well for matrices, and the book collects them in a Concept Summary.

Read the two distributive laws carefully and notice that there are two of them. For numbers one statement would do, because you may swap the factors; here the side the single matrix sits on has to be recorded, so the two cases are separate laws.

That is the pattern for everything in this chapter. What survives is every property that does not require swapping two matrices, and what fails is every property that does.

The associative law is the one you use without noticing. It is what lets you write a chain of matrices with no brackets at all, and it is why the repeated multiplications in the rotation exercise later on are unambiguous.

The scalar law is the most generous of the four. A number may be multiplied into either factor or applied to the finished product, and all three routes agree, because a scalar multiplies every entry and does not care about rows or columns.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 197 — the Concept Summary, Properties of Matrix Multiplication

45. Example 3(a): A times the sum of B and C

Worked example

The book checks the left distributive law on real numbers rather than asserting it. This is the first route: add the two matrices first, then multiply once.

\[ A = \begin{bmatrix}4 & 3\\-1 & -2\\2 & 0\end{bmatrix}, \; B = \begin{bmatrix}-3 & 0\\1 & -2\end{bmatrix}, \; C = \begin{bmatrix}1 & 4\\-3 & -1\end{bmatrix} \]

Add B and C first

Why: they are both 2 by 2, so add entry by entry as in Lesson 3.5.

\[ B + C = \begin{bmatrix}-3 + 1 & 0 + 4\\1 - 3 & -2 - 1\end{bmatrix} = \begin{bmatrix}-2 & 4\\-2 & -3\end{bmatrix} \]

Check the shape before going on. A is 3 by 2 and the sum is 2 by 2, so the inner numbers are 2 and 2 and the product will be 3 by 2, which is six entries.

Multiply row 1 of A by both columns of the sum

Why: row 1 of A is 4 and 3; the columns of the sum are minus 2 and minus 2, then 4 and minus 3.

\[ 4(-2) + 3(-2) = -14, \qquad 4(4) + 3(-3) = 7 \]

Multiply row 2 of A by both columns

Why: row 2 of A is minus 1 and minus 2, so watch the double negatives.

\[ (-1)(-2) + (-2)(-2) = 6, \qquad (-1)(4) + (-2)(-3) = 2 \]

Multiply row 3 of A by both columns

Why: row 3 is 2 and 0, so the second number of each column is switched off.

\[ 2(-2) + 0(-2) = -4, \qquad 2(4) + 0(-3) = 8 \]

Collect the six entries

Why: each at the crossing of its row of A and its column of the sum.

\[ A(B + C) = \begin{bmatrix}-14 & 7\\6 & 2\\-4 & 8\end{bmatrix} \]

Check the third row against the zero in A

Why: row 3 of A is 2 and 0, so every entry of the answer's third row must be twice the first entry of its column: twice minus 2 is minus 4, and twice 4 is 8, which is what came out.

\[ 2(-2) = -4, \; 2(4) = 8 \]

A zero in a row of the first matrix is a gift, because it turns that row of the answer into a simple multiple and gives you a check that costs nothing.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 197 — Example 3(a)

46. Example 3(b): AB plus AC gives the same six numbers

Worked example

Now the other route, on the same three matrices. Multiply A by each of B and C separately, and add the two products at the end.

Multiply A by B

Why: three rows of A against the two columns of B, six entries.

\[ AB = \begin{bmatrix}4 & 3\\-1 & -2\\2 & 0\end{bmatrix}\begin{bmatrix}-3 & 0\\1 & -2\end{bmatrix} = \begin{bmatrix}-9 & -6\\1 & 4\\-6 & 0\end{bmatrix} \]

Check one of those before moving on. The top left is 4 times minus 3 plus 3 times 1, which is minus 12 plus 3, so minus 9. The bottom right is 2 times 0 plus 0 times minus 2, which really is 0.

Multiply A by C

Why: the same three rows, now against the two columns of C.

\[ AC = \begin{bmatrix}4 & 3\\-1 & -2\\2 & 0\end{bmatrix}\begin{bmatrix}1 & 4\\-3 & -1\end{bmatrix} = \begin{bmatrix}-5 & 13\\5 & -2\\2 & 8\end{bmatrix} \]

Add the two products

Why: both are 3 by 2, so this is an ordinary entry-by-entry sum.

\[ AB + AC = \begin{bmatrix}-9 - 5 & -6 + 13\\1 + 5 & 4 - 2\\-6 + 2 & 0 + 8\end{bmatrix} = \begin{bmatrix}-14 & 7\\6 & 2\\-4 & 8\end{bmatrix} \]

Figure (svg): A flow diagram with two routes from the matrices A, B and C to the same answer. The upper route adds B and C first and then multiplies by A once. The lower route multiplies A by B and A by C separately and then adds the two products.

The left distributive property says these two routes always agree. The upper one is less work, which is the only reason to know the property.

Two routes, the same six numbers. The property is not a curiosity: it says you may collect matrices inside a bracket before multiplying, which is usually far less arithmetic.

Check the two routes agree entry by entry

Why: the six entries of A times the sum were minus 14 and 7, then 6 and 2, then minus 4 and 8, and the six entries of AB plus AC are the same in the same positions, so the left distributive property holds here.

\[ A(B + C) = AB + AC \]

Count the work as well as the answers. The first route did one multiplication of six entries; this route did two, and then an addition. Same answer, roughly twice the arithmetic, which is the practical reason to know the law.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 197 — Example 3(b) and the note that follows it

47. Which properties survive the move to matrices?

Comparison

Fill in the right-hand column from what you have seen. Everything in the middle column is true of ordinary numbers, and the question is which of them you may still rely on.

Comparison matrix

propertytrue for numberstrue for matrices
a(bc) = (ab)cyesyes
a(b + c) = ab + acyesyes
k(ab) = (ka)byesyes
ab = bayesno
if ab = 0 then a = 0 or b = 0yesno

The two failures are the two that need the factors swapped or divided, and they are the two you have seen broken with concrete matrices earlier in this part.

Read the surviving three again and notice what they have in common. Each one keeps every matrix on the side it started on, and only moves brackets or a scalar. That is a reliable test for whether a manipulation is allowed.

The last row has a consequence for solving. You cannot solve a matrix equation by factoring and setting each factor to zero, so the whole technique from Chapter 5 will not transfer. Lesson 3.8 supplies a different tool.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 197 — the Concept Summary

48. Guided Practice 4 and 5: distributing over a subtraction

Worked example

The checkpoint asks for both routes again, this time with a subtraction in the middle. The law holds for subtraction as well, because subtracting is adding a negative.

\[ A = \begin{bmatrix}-1 & 2\\-3 & 0\\4 & 1\end{bmatrix}, \; B = \begin{bmatrix}3 & 2\\-2 & -1\end{bmatrix}, \; C = \begin{bmatrix}-4 & 5\\1 & 0\end{bmatrix} \]

Subtract C from B

Why: entry by entry, and mind the signs: 3 minus minus 4 is 7.

\[ B - C = \begin{bmatrix}3 + 4 & 2 - 5\\-2 - 1 & -1 - 0\end{bmatrix} = \begin{bmatrix}7 & -3\\-3 & -1\end{bmatrix} \]

Multiply A by the difference

Why: three rows against two columns, so six entries; row 1 of A is minus 1 and 2.

\[ A(B - C) = \begin{bmatrix}-13 & 1\\-21 & 9\\25 & -13\end{bmatrix} \]

Work the top row through to see where those came from. Minus 1 times 7 plus 2 times minus 3 is minus 7 minus 6, so minus 13; and minus 1 times minus 3 plus 2 times minus 1 is 3 minus 2, so 1.

Now take the other route and compute AB

Why: three rows of A against the two columns of B.

\[ AB = \begin{bmatrix}-7 & -4\\-9 & -6\\10 & 7\end{bmatrix} \]

Compute AC as well

Why: the same three rows against the two columns of C.

\[ AC = \begin{bmatrix}6 & -5\\12 & -15\\-15 & 20\end{bmatrix} \]

Subtract AC from AB

Why: entry by entry, taking care with the negatives on the right.

\[ AB - AC = \begin{bmatrix}-7 - 6 & -4 + 5\\-9 - 12 & -6 + 15\\10 + 15 & 7 - 20\end{bmatrix} = \begin{bmatrix}-13 & 1\\-21 & 9\\25 & -13\end{bmatrix} \]

Check that both routes agree

Why: all six entries match the answer from the first route, so the distributive law has held over a subtraction as well as over a sum.

\[ A(B - C) = AB - AC \]

The checkpoint also asks for minus a half times AB, which is just the scalar rule: halve every entry of AB and change its sign, giving three and a half and 2 on the top row. No new multiplication is needed.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 197 — Guided Practice 4, 5 and 6

49. A quarter turn, done by a matrix

Picture it

Here is a use of matrix multiplication that has nothing to do with lists of numbers, and it makes the order question vivid. Put the coordinates of a triangle's three vertices in the columns of a matrix, and multiply on the left by a particular 2 by 2 matrix.

Figure (svg): A pair of axes with the original triangle drawn in blue at minus seven four, minus four eight and minus four two, and the rotated triangle drawn in orange at minus four minus seven, minus eight minus four and minus two minus four.

The same triangle, turned a quarter of a way round the origin. One matrix multiplication moved all three vertices at once.

The blue triangle is the one the book draws, with vertices at minus seven and four, minus four and eight, and minus four and two. The orange one is what a single multiplication does to it.

Every vertex has moved a quarter of a turn anticlockwise about the origin, and all three moved in one multiplication, because each was sitting in its own column of the matrix.

Look at what the columns of the answer are. The multiplication acted on each column separately, which is why one product can transform a whole shape: each column of the second matrix produces one column of the answer, independently of the others.

Order matters here in a way you can picture. Turning a shape and then reflecting it does not usually land where reflecting and then turning would, and the matrices for those two operations multiply in the corresponding two orders.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 202 — Exercise 45

50. Exercise 45: turning a triangle by multiplying

Worked example

Now do the arithmetic behind the picture. The rotation matrix goes on the left, and the matrix of vertices goes on the right, one vertex per column.

\[ A = \begin{bmatrix}0 & -1\\1 & 0\end{bmatrix}, \qquad B = \begin{bmatrix}-7 & -4 & -4\\4 & 8 & 2\end{bmatrix} \]

Check the dimensions

Why: 2 by 2 then 2 by 3, so the inner numbers are 2 and 2 and the answer is 2 by 3: three vertices again, as it must be.

\[ 2 \times \underline{2}, \; \underline{2} \times 3 \quad \Longrightarrow \quad 2 \times 3 \]

Multiply row 1 of A by each column of B

Why: row 1 of A is 0 and minus 1, so each entry is minus the second number of its column.

\[ 0(-7) + (-1)(4) = -4, \; 0(-4) + (-1)(8) = -8, \; 0(-4) + (-1)(2) = -2 \]

Multiply row 2 of A by each column of B

Why: row 2 of A is 1 and 0, so each entry is the first number of its column, unchanged.

\[ 1(-7) + 0(4) = -7, \; 1(-4) + 0(8) = -4, \; 1(-4) + 0(2) = -4 \]

Read what those two rows say. The new first coordinate is minus the old second coordinate, and the new second coordinate is the old first. That is exactly the quarter-turn rule you can check on graph paper.

Collect the answer and read off the vertices

Why: each column of the answer is one rotated vertex.

\[ AB = \begin{bmatrix}-4 & -8 & -2\\-7 & -4 & -4\end{bmatrix} \]

Check one vertex on the drawing

Why: the first column says the vertex at minus seven and four has moved to minus four and minus seven, which is where the orange triangle's lowest corner sits, and the distance from the origin is unchanged because a turn cannot stretch anything.

\[ (-7, 4) \; \longmapsto \; (-4, -7) \]

Multiplying by this matrix twice gives a half turn, and the book asks for that too: the vertices become 7 and minus 4, 4 and minus 8, and 4 and minus 2, which is the original triangle reflected through the origin.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 202 — Exercise 45

51. Modelling with a product

Section

Part 5

52. Quantities times prices, and the entry is a bill

Concept

Everything so far has been arithmetic. Here is the reason the rule was worth inventing: when one matrix holds quantities and the other holds prices, every entry of the product is a total cost, and one multiplication produces all of them.

Think about what a single entry does. It pairs a whole shopping list against a whole price list, multiplies each quantity by the matching price, and adds. That is exactly how you would work out a bill by hand.

\[ \begin{bmatrix}\text{inventory}\end{bmatrix} \begin{bmatrix}\text{cost per item}\end{bmatrix} = \begin{bmatrix}\text{total cost}\end{bmatrix} \]

The dimensions carry the meaning too. If the inventory is m by n, then m counts the customers or teams or nights, and n counts the kinds of item. The cost matrix must then be n by 1, one price per kind of item, and the answer is m by 1: one bill per customer.

So the row-and-column rule was not designed to be awkward. Pairing a row against a column is what totalling a bill is, and the fact that the answer keeps one row per customer is what makes a single multiplication do everybody's bill at once.

Watch for this shape whenever a problem gives you a two-way table and a list of rates. Ticket prices, profit per car, weights for a grade and interest rates all behave the same way, and the next few slides work through four of them.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 198 — the Cost Matrices note

53. The labels have to meet in the middle

Picture it

There is one extra condition in a real problem that the dimension rule alone does not catch. It is not enough for the numbers to fit; the labels have to line up as well.

Figure (svg): An inventory matrix with column labels sticks, pucks and uniforms and row labels for the two teams, beside a cost matrix whose three rows carry the same three labels, joined by dashed lines, and the resulting total cost column labelled dollars.

The three item labels appear twice, once across and once down, and the multiplication cancels them. What is left is teams down and dollars across.

The inventory matrix has its items written across the top, as column labels. The cost matrix must then have those same items written down the side, as row labels, and in the same order.

Look at what the multiplication does to the labels. Each item label is used once from each matrix and then disappears, exactly as the inner dimensions do. What survives is teams down the side and dollars across.

If the order of the labels disagreed, the arithmetic would still work and the answer would be nonsense: you would be charging stick prices for pucks. The dimensions cannot protect you from that, so checking the labels is a separate job.

This is the practical test for whether you have set a word problem up correctly. Write the labels on your matrices before any numbers, and make sure the ones across the first matrix match the ones down the second.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 198 — the note on matching column and row labels

54. Example 4: pricing two hockey teams' equipment

Worked example

Two hockey teams hand in their equipment lists for the season. Each stick costs 60 dollars, each puck 2 dollars and each uniform 35 dollars, and the question is what each team's equipment will cost.

Write the quantities as a matrix with the items across

Why: one row per team and one column per kind of item, so the labels will be able to meet.

\[ \begin{bmatrix}14 & 30 & 18\\16 & 25 & 20\end{bmatrix} \]

The first row is the women's team: 14 sticks, 30 pucks and 18 uniforms. The second is the men's team. Nothing has been calculated yet; this is just the table, written in brackets.

Write the prices as a matrix with the items down

Why: the same three items in the same order, one price each, so this matrix is 3 by 1.

\[ \begin{bmatrix}60\\2\\35\end{bmatrix} \]

Check the dimensions and the labels

Why: the equipment matrix is 2 by 3 and the cost matrix is 3 by 1, so the inner numbers are 3 and 3, and both threes are the three items.

\[ 2 \times \underline{3}, \; \underline{3} \times 1 \quad \Longrightarrow \quad 2 \times 1 \]

Figure (svg): The women's team equipment row 14, 30, 18 drawn above labels for sticks, pucks and uniforms, beside the cost column 60, 2, 35, with arrows pairing each quantity to its price and a tally giving 840 plus 60 plus 630 equals 1530 dollars.

Follow the arrows and every product is a quantity times a price, so it is money. The entry of the answer is a bill, not just a number.

The picture is the first entry, drawn. Each arrow pairs a quantity with its own price, and each product is money, so the sum is money: a bill of 1530 dollars.

Multiply each row of quantities by the column of prices

Why: two rows, one column, so two entries, one bill per team.

\[ \begin{bmatrix}14 & 30 & 18\\16 & 25 & 20\end{bmatrix}\begin{bmatrix}60\\2\\35\end{bmatrix} = \begin{bmatrix}14(60) + 30(2) + 18(35)\\16(60) + 25(2) + 20(35)\end{bmatrix} \]

Work out the two entries

Why: three products and two additions each.

\[ = \begin{bmatrix}840 + 60 + 630\\960 + 50 + 700\end{bmatrix} = \begin{bmatrix}1530\\1710\end{bmatrix} \]

Check the answer against common sense and against a rough total

Why: the men's team buys more of the two expensive items, so its bill should be the larger, and it is; roughly, both teams buy about 15 sticks at 60 dollars and about 19 uniforms at 35, which is about 900 plus 665, so a total near 1600 dollars is the right size.

\[ 1530 \text{ dollars and } 1710 \text{ dollars} \]

Label the answer before you leave it: the women's team costs 1530 dollars and the men's 1710 dollars. A matrix answer with no labels is a grid of numbers that nobody can use.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 198 — Example 4

55. Trap: writing the cost matrix first

Trap

The trap

The question asks for the cost, so it feels natural to start from the prices and write the cost matrix on the left.

\[ \begin{bmatrix}60\\2\\35\end{bmatrix}\begin{bmatrix}14 & 30 & 18\\16 & 25 & 20\end{bmatrix} \]

The intention is right and the matrices are the right ones. Only the order is wrong.

\[ 3 \times \underline{1}, \; \underline{2} \times 3 \]

The inner numbers are now 1 and 2, which disagree, so this product does not exist at all.

The fix

The matrix supplying the rows has to be the one whose rows you want in the answer. You want one row per team, so the equipment matrix goes on the left.

\[ 2 \times \underline{3}, \; \underline{3} \times 1 \]

Now the threes meet, and they are the three items, which is the label check passing as well.

Use the answer to decide the order. Ask what the answer should look like, one bill per team, then put the matrix with the teams in its rows on the left.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 198 — the order of the inventory and cost matrices

56. Guided Practice 7: the same lists, new prices

Fill the middle

Suppose a stick now costs 75 dollars, a puck 1 dollar and a uniform 45 dollars. The equipment lists have not changed, so nothing about the setting up has to be done again.

\[ \begin{bmatrix}14 & 30 & 18\\16 & 25 & 20\end{bmatrix}\begin{bmatrix}75\\1\\45\end{bmatrix} \]

Fill in the blanks

\begin189014(75) + 30(1) + 18(45)\\16(75) + 25(1) + 20(45)\end2125 = \begin______\\___\end___

Why: The women's team gives 1050 plus 30 plus 810, which is 1890 dollars. The men's team gives 1200 plus 25 plus 900, which is 2125 dollars. Both bills have gone up by more than 350 dollars, almost all of it from the dearer sticks and uniforms, and the cheaper pucks barely register.

This is the saving the matrix form buys. Only the price column changed, so the setting up, the label check and the dimension check were all done once and reused.

Compare the two answers with the originals, 1530 and 1710 dollars. Both bills rose by about 400 dollars, and the reason is visible in the price list: sticks went up 15 dollars each and uniforms 10 dollars each, while pucks fell by only 1.

If a question gives you several price lists, there is an even better move. Put each price list in its own column of a single cost matrix, and one multiplication gives you every team's bill under every price list at once.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 198 — Guided Practice 7

57. Slide the prices, watch one bill

Tweak it

One entry of that product is a bill, and a bill is a straightforward function of the prices. Watching it move is the quickest way to see which item a budget is actually sensitive to.

Parameter explorer

Slide the uniform price. With sticks at 60 dollars and uniforms at 35, read the women's team total off the curve, then say which item the total depends on most steeply and why.

\[ \text{total} = 14x + 30(2) + 18({u}) \]

  • u — from 20 to 60: price of a uniform

The line is straight because every price enters the total multiplied by a fixed quantity and then added. That is what a row-times-column pairing is: a weighted sum, and a weighted sum of a price is linear in that price.

Its steepness is the quantity, not the price. Sticks cost the most each, but the team buys 14 of them and 18 uniforms, so a dollar on a uniform costs this team more than a dollar on a stick.

That is a genuinely useful way to read a cost matrix. The entries of the quantity row are the sensitivities of the bill: the bigger the quantity, the more a price rise on that item hurts.

Notice how little the pucks matter. Thirty of them at 2 dollars is 60 dollars out of more than 1500, so a puck crisis is not a budget crisis, and the slider makes that obvious in a way the finished number never could.

58. Exercise 39: two nights of ticket sales

Worked example

Tickets to the senior class play cost 2 dollars for students, 5 for adults and 4 for senior citizens. On Friday 120 students, 150 adults and 40 senior citizens came; on Saturday it was 192, 215 and 54.

Write the attendances with the categories across

Why: one row per night, one column per category, because you want one total per night.

\[ \begin{bmatrix}120 & 150 & 40\\192 & 215 & 54\end{bmatrix} \]

Write the prices with the categories down

Why: the same three categories in the same order, so this is 3 by 1.

\[ \begin{bmatrix}2\\5\\4\end{bmatrix} \]

Check the labels as well as the numbers. Students, adults and senior citizens run across the first matrix and down the second, in that order in both, so the pairing will charge each group its own price.

Check the dimensions

Why: 2 by 3 then 3 by 1, so the answer is 2 by 1: one income figure per night.

\[ 2 \times \underline{3}, \; \underline{3} \times 1 \quad \Longrightarrow \quad 2 \times 1 \]

Multiply each row by the price column

Why: three products and two additions per night.

\[ \begin{bmatrix}120(2) + 150(5) + 40(4)\\192(2) + 215(5) + 54(4)\end{bmatrix} = \begin{bmatrix}240 + 750 + 160\\384 + 1075 + 216\end{bmatrix} \]

Add up the two entries

Why: and label them, because a bare column of numbers answers nothing.

\[ = \begin{bmatrix}1150\\1675\end{bmatrix} \]

Check the Saturday figure a second way

Why: Saturday had 62 percent more people than Friday but a similar mix, so its income should be roughly 62 percent up on 1150, which is about 1860; the actual 1675 is a little lower because the extra crowd was proportionally more students, who pay the least.

\[ 1150 \text{ dollars on Friday}, \; 1675 \text{ dollars on Saturday} \]

That kind of rough check is worth more than recomputing, because it tests whether the answer makes sense as money and not just whether you added correctly.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 200 — Exercise 39

59. Exercise 42: a weighted grade is a matrix product

Real world

Your overall grade is a weighted average: homework counts for 20 percent, quizzes for 30 percent and tests for 50 percent. Five students' marks are in the table, and the whole class can be graded in one multiplication.

studenthomeworkquizzestests
Jean828886
Ted928890
Pat827381
Al747578
Matt889290

Discussion prompt

Set this up as a matrix product: say what each matrix is, what its dimensions are, and what the dimensions of the answer must be. Then work out Jean's overall grade and say what the three numbers in the weight matrix have to add to, and why.

Notice that this is the cost-matrix shape with different words. Quantities have become marks and prices have become weights, and the pairing is still a quantity times a rate, added up.

The weights are where this idea earns its keep. Change the weighting policy and only the 3 by 1 matrix changes; every student is regraded by repeating one multiplication, which is precisely what a spreadsheet does when you edit a weight.

It also shows what the answer's shape means in a real setting. One row per student in, one row per student out, and the three components are used up in the middle, exactly like the item labels in the hockey problem.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 201 — Exercise 42

60. Exercise 41: only one of the two orders is defined

Worked example

Matrix S gives how many cars of three types two dealers sold in February, with the types down the side and the dealers across. Matrix P gives the profit on each type as a single row. The question is which of the two products exists.

\[ S = \begin{bmatrix}21 & 16\\40 & 33\\15 & 19\end{bmatrix}, \qquad P = \begin{bmatrix}650 & 825 & 1050\end{bmatrix} \]

Test the order S first, then P

Why: S is 3 by 2 and P is 1 by 3, so the inner numbers are 2 and 1.

\[ 3 \times \underline{2}, \; \underline{1} \times 3: \; 2 \ne 1 \]

Now test the order P first, then S

Why: P is 1 by 3 and S is 3 by 2, so the inner numbers are 3 and 3, and both threes count the three types of car.

\[ 1 \times \underline{3}, \; \underline{3} \times 2 \quad \Longrightarrow \quad 1 \times 2 \]

So the answer must be PS, not SP, and the reason is the labels as much as the numbers. The three car types run across P and down S, which is the arrangement the pairing needs.

Multiply the profit row by each column of S

Why: the first column is dealer A's sales, the second is dealer B's.

\[ 650(21) + 825(40) + 1050(15) = 13650 + 33000 + 15750 \]

Work out both entries

Why: one dealer per column, so the answer is a single row of two totals.

\[ PS = \begin{bmatrix}62\,400 & 57\,575\end{bmatrix} \]

Read what those entries mean before checking them. Each is one dealer's total February profit across all three types of car, in dollars, and the compact, mid-size and full-size labels have been used up in the multiplication.

Check the comparison against the sales figures

Why: dealer A sold more of every type than dealer B except full-size cars, so dealer A's profit should be the bigger, and 62,400 dollars against 57,575 dollars agrees; dealer B's extra four full-size cars at 1050 dollars each, 4200 dollars, was not enough to close the gap.

\[ 62\,400 > 57\,575 \]

The book asks you to say what the elements represent, and that is the part of the answer worth most. A matrix of numbers with no interpretation has not answered a word problem.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 201 — Exercise 41

61. Exercise 43: commuters changing their habits

Real world

A last application, and a surprising one, because nothing here is a price. Each year 20 percent of those who drive to the city switch to public transport, and 5 percent of those using public transport switch to driving.

\[ T = \begin{bmatrix}1 - p & q\\p & 1 - q\end{bmatrix} \quad \text{with } p = 0.2, \; q = 0.05 \]

Discussion prompt

Write out this transition matrix with the numbers in, then multiply it by the column of 5000 drivers and 8000 public-transport users to get next year's figures. Say what the entries of the answer mean, and predict what happens if you keep multiplying.

The row-and-column rule is doing something different here. Each entry of the answer gathers everyone who ends up in one group, from every group they might have come from, which is exactly a row of proportions paired against a column of populations.

Notice that the two entries of every answer still add to 13,000. Nobody leaves the suburb; they only change how they travel, and the columns of the transition matrix each add to 1 precisely to guarantee that.

Repeated multiplication by the same matrix is a powerful idea and the reason the associative property matters. Four years on is the fourth power of the transition matrix applied to the starting column, and the brackets may go anywhere.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 201 — Exercise 43

62. Putting it together

Section

Part 6

63. Pattern: multiplying two matrices

Pattern

Everything in this lesson is one procedure with a gate in front of it. The gate is the dimension check, and it decides whether there is anything to do at all.

  1. Write the four dimension numbers in order and compare the inner two. If they differ, the answer is that the product is not defined, and that is the whole answer.
  2. Read the outer two numbers to get the shape of the answer, and so how many entries you owe.
  3. For each entry, take a row of the left matrix and a column of the right one. Rows always come from the left, columns always from the right.
  4. Pair them off in order, multiply each pair, add the products, and put the single number where that row and that column cross.
  5. Check one entry by rebuilding it, and in a word problem check the labels and put units on the answer.

The gate is worth respecting because it is the only step that can save you from all the others. Two seconds of dimension checking has ended several of the exercises in this lesson outright.

Inside the loop, the only thing that ever changes is which row and which column you have picked up. If you can do one entry you can do every entry, whatever the size of the matrices.

And one thing you may never do at any stage: swap the two matrices, or cancel one from both sides of an equation. Order is part of the question, and Part 4 showed what it costs to forget that.

McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices §3.6, p. 195 — the Key Concept box, as a procedure

64. Check: is the product defined, and what shape?

Check

Back to the gate. Write the four numbers in order, cover the outer pair, and compare what is left.

Check your understanding

A is a 5 by 2 matrix and B is a 2 by 2 matrix. Which statement about the product AB is true?

  • A. AB is defined and is 5 by 2 (correct)
  • B. AB is defined and is 2 by 5
  • C. AB is defined and is 2 by 2
  • D. AB is not defined, because the matrices are different shapes

Answer: A

Why: Writing the dimensions in order gives 5 by 2 then 2 by 2. The inner numbers are both 2, so the product exists, and the outer numbers give the shape: 5 rows from A and 2 columns from B, so AB is 5 by 2 and has ten entries to compute.

Why B tempts people
The outer numbers have been read in the wrong order. The row count always comes from the matrix on the left, which has 5 rows.
Why C tempts people
This is the shape of the second matrix, not of the product. The answer has one row for every row of A, and A has five.
Why D tempts people
Different shapes is the condition that would stop you adding these two matrices. Multiplying only needs the columns of the first to match the rows of the second, and here both are 2.

Two of the wrong options are real habits rather than random answers: one reads the dimensions backwards, and one reaches for the rule from Lesson 3.5 about matrices having to match.

Confirm the answer by counting entries. Five rows to choose from and two columns to choose from is ten pairings, and only a 5 by 2 matrix has ten cells.

Notice how little you needed. No entries were given, and none were required, because whether a product exists and what shape it takes are settled entirely by four numbers.

The version of this question to watch for in a test gives you the matrices rather than their dimensions. Count the rows and columns first and write the four numbers down; do not start multiplying from the page.

65. Check: one entry of a product

Check

This is the book's multiple-choice exercise, narrowed to a single entry. Decide which row and which column you need before you look at the numbers.

\[ \begin{bmatrix}1 & -4\\3 & -2\end{bmatrix}\begin{bmatrix}4 & -1\\0 & -3\end{bmatrix} \]

Check your understanding

What is the entry in row 1, column 2 of this product?

  • A. 11 (correct)
  • B. 12
  • C. 8
  • D. −13

Answer: A

Why: Row 1 of the left matrix is 1 and minus 4. Column 2 of the right matrix, read downwards, is minus 1 and minus 3. Pairing them gives 1 times minus 1 plus minus 4 times minus 3, which is minus 1 plus 12, so the entry is 11.

Why B tempts people
This uses row 2 of the right matrix, 0 and minus 3, instead of its second column. Reading the right matrix across instead of down is the error the book's own error-analysis exercises are about.
Why C tempts people
This pairs row 1 with row 1 of the right matrix, 4 and minus 1, giving 4 plus 4. Again the right matrix has been read across rather than down.
Why D tempts people
Both products were treated as negative. Minus 4 times minus 3 is positive 12, not negative, so the two terms partly cancel instead of piling up.

Every wrong option here comes from reading the second matrix along a row. That single confusion accounts for most wrong entries in this lesson, and the cure is physical: run a finger down the column.

The full product is 4 and 11 on the top row, then 12 and 3 on the bottom. Work out the bottom left entry as well if you want the practice; it uses row 2 of the left matrix and column 1 of the right.

Notice that you were asked for one entry out of four, and that computing all four would have been four times the work for no extra marks. Read what a question wants before starting.

Two of the offered numbers, 12 and 8, do appear somewhere in the arithmetic of this product, which is why plausible-looking distractors are dangerous. Naming the row and the column first is what protects you.

66. Check: what does order do?

Check

The last check is about the idea rather than the arithmetic. Each statement is about two square matrices of the same size, so nothing here is undefined.

Check your understanding

A and B are both 3 by 3 matrices. Which statement is always true?

  • A. AB and BA are both defined and are both 3 by 3, but they need not be equal (correct)
  • B. AB and BA are both defined and are always equal
  • C. AB is defined but BA is not
  • D. AB equals BA whenever neither matrix is the zero matrix

Answer: A

Why: Both products exist, because in either order the inner numbers are 3 and 3, and both are 3 by 3. They need not agree, though, because the rows of AB come from A while the rows of BA come from B, so the two calculations pair up different lists of numbers.

Why B tempts people
This is the commutative property, and matrices do not have it. The two products of the pair in Example 2 disagree in all four of their entries.
Why C tempts people
Both products are defined here, since both matrices are square and the same size. One order being undefined happens when the matrices are not square, as with a 4 by 3 and a 3 by 2.
Why D tempts people
Being nonzero is not what makes two matrices commute. Example 2's matrices are both nonzero and their two products are completely different.

The word doing the work in the right answer is need not. Some pairs of matrices do commute, including any matrix paired with a multiple of the identity pattern, so the claim is not that they never agree.

Say the reason to yourself once more, because it is the reason for everything in Part 4. Rows come from the matrix on the left and columns from the matrix on the right, so swapping them swaps the jobs.

Being square and the same size is exactly what makes this a fair comparison. It removes the dimension excuse and leaves only the arithmetic, and the arithmetic still disagrees.

Carry this into Lesson 3.8. There you will solve matrix equations, and every move you make will have to respect which side each matrix sits on, for precisely this reason.

67. Say the rule in your own words

Explain it to yourself

One idea has carried the whole lesson, and writing it out in your own sentences is what makes it stick. Do that before reading the version below.

Discussion prompt

In three or four sentences, explain to somebody who has only done Lesson 3.5 how a matrix product is built, why the two matrices must have a particular pair of dimensions in common, and why the order in which you write them matters. Do not use the word corresponding.

If your explanation talked about entries in the same position, go back to the warm-up slide. Same position is Lesson 3.5's rule, and it is the one thing multiplication does not do.

A good test of your own version: could somebody follow it without the textbook and get the right answer for a 3 by 2 times a 2 by 4? If they would not know how many entries to produce, add the sentence about where the shape comes from.

The instruction to avoid the word corresponding is deliberate. It is the book's word and it is exact, but it lets you say the rule without having understood which list is being read across and which is being read down.

68. Exit ticket

Exit ticket

One question using all three habits from the lesson: check the dimensions, build each entry from a row and a column, and say what the answer means.

\[ \begin{bmatrix}2 & 0 & 1\\-1 & 3 & 4\end{bmatrix}\begin{bmatrix}1 & 2\\0 & -1\\3 & 1\end{bmatrix} \]

Discussion prompt

Give the dimensions of this product before computing anything, then find all of its entries. Finally, say whether the product in the other order is defined and what its dimensions would be.

The two entries of the top row both came out as 5, which is a coincidence of these numbers and not a pattern. If it made you doubt your work, rebuild the second one: 4 plus 0 plus 1.

The bottom left entry is the one to check carefully, because it is the only one where all three products are nonzero. Minus 1 plus 0 plus 12 is 11, and getting 13 there means the minus sign on the first term was dropped.

The last part of the question is the one worth most. Two products can both exist and be different sizes, which is the strongest possible statement that they are different questions.

69. What you can do now

Recap

Four things, and they are in the order you should do them. Check, count, build, interpret.

the questionwhat decides itexample from this lesson
Does AB exist?the inner numbers: columns of A against rows of Ba 4 by 3 and a 3 by 2 work; a 3 by 4 and a 3 by 2 do not
What shape is AB?the outer numbers, in ordera 2 by 3 times a 3 by 1 gives a 2 by 1
What is one entry?a row of A paired with a column of B, then added1(5) + 4(9) = 41
Does order matter?yes: rows come from the left, columns from the rightAB was 41, 17, −3, −33 and BA was −16, 34, 27, 24
What does an entry mean?the labels used up in the middlequantities across, prices down, so dollars per team

The row against the column is the whole lesson. Every entry, in every example here, came from one row of the left matrix and one column of the right one, paired off in order and added.

The two habits worth keeping are the cheap ones. Write the four dimension numbers before anything else, and rebuild one entry when you have finished. Between them they catch almost every mistake this topic offers.

The thing to unlearn is the instinct from Lesson 3.5. Adding worked position by position and needed identical shapes; multiplying works row against column and needs one agreement in the middle. Keep the two rules in separate drawers.

Lesson 3.7 uses products to evaluate determinants, and Lesson 3.8 uses them to solve systems of equations by finding an inverse. Both lean on the order rule from Part 4, so the care you take over which matrix sits on the left starts paying off immediately.

OpenStax Algebra and Trigonometry 2e, §11.5 Matrices and Matrix Operations §11.5 — the same row-by-column rule, with the properties proved rather than checked

Sources

  1. McDougal Littell Algebra 2 (Texas Edition), Ch. 3 Linear Systems and Matrices — Lesson 3.6 Multiply Matrices — Larson, Boswell, Kanold & Stiff, McDougal Littell / Houghton Mifflin, 2007, pp. 195-201
  2. OpenStax Algebra and Trigonometry 2e, §11.5 Matrices and Matrix Operations
  3. OpenStax College Algebra 2e, §7.5 Matrices and Matrix Operations

Want this taught 1-on-1? Alexander tutors Algebra 2 — $55/session, free consultation.

Book on Wyzant · Text (657) 465-8108