← Back to course
2/6
Week 11 · Matrices

Tuesday

A row meets a column
// The lane card grid
⏱ about 20 min

Tuesday: A Row Meets a Column

"Kestrel ran the short course 3 times and the long course 2 times," Wren reads from the log.

"Heron ran them 1 and 4. That is a 2 by 2 matrix of runs."

"A short run is 2 laps and 1 buoy turn," Comet says. "A long run is 5 laps and 3 turns."

"Another 2 by 2," Wren says. "How many laps did Kestrel row altogether?"

Comet works it out. "3 × 2 + 2 × 5 = 16. A row of runs times a column of laps."

Nova projects the row sliding across the column. "Would you like a hint? Multiply pair by pair, then add."

"What do you notice?" Wren says. "Four of those gives a whole new matrix. Runs times per-run equals totals."

Multiplying matrices

To multiply A × B, each entry of the answer comes from one row of A and one column of B.

Lay the row on the column, multiply pair by pair, and add the products. That sum is one entry.

The entry in row i, column j of AB uses row i of A and column j of B.

The sizes must fit: the number of columns of A equals the number of rows of B. A 2 by 2 times a 2 by 2 is a 2 by 2.

Way one: one entry at a time

Runs R = [3 2; 1 4] (rows Kestrel, Heron; columns short, long). Per run P = [2 1; 5 3] (rows short, long; columns laps, turns).

Kestrel's laps: row 1 of R on column 1 of P: 3 × 2 + 2 × 5 = 16.

Kestrel's turns: row 1 of R on column 2 of P: 3 × 1 + 2 × 3 = 9.

Heron's laps: 1 × 2 + 4 × 5 = 22. Heron's turns: 1 × 1 + 4 × 3 = 13.

So RP = [16 9; 22 13]: rows are boats, columns are total laps and total turns.

Way two: the labels tell you the meaning

Before multiplying, read the labels. R's columns are courses. P's rows are courses. They match, so the product makes sense.

The answer keeps R's row labels (boats) and P's column labels (laps, turns). The shared label, courses, is summed away.

Try it the other way, P × R. P's columns are laps and turns, but R's rows are boats. The labels do not match.

The numbers still multiply, PR = [7 8; 18 22], but the entries mean nothing. AB and BA are different matrices.

ProductRow labelColumn labelEntry (row 1, column 1)
R × Pboatlaps or turns3 × 2 + 2 × 5 = 16
P × Rcoursecourse2 × 3 + 1 × 1 = 7

Zero and identity

The zero matrix [0 0; 0 0] adds nothing. A + 0 = A, just as a + 0 = a for numbers.

The identity matrix I = [1 0; 0 1] has 1s on the diagonal and 0s elsewhere. A × I = A and I × A = A, like a × 1 = a.

Check: [3 2; 1 4] × [1 0; 0 1] = [3 2; 1 4]. Each row meets a column with a single 1, and the entry survives.

MULTIPLY MATRICES
  • Read the question.
  • Tap your answer.
Runs [3 2; 1 4] times per-run [2 1; 5 3] gives total laps and turns per boat. What is the product?
Multiply [1 2; 3 4] × [0 1; 1 0].
Multiply [3 2; 1 4] by the identity [1 0; 0 1]. What comes out?
With A = [3 2; 1 4] and B = [2 1; 5 3], is AB equal to BA?
FIND ROW 2, COLUMN 1 OF R × P, IN ORDER
  • ?Write the sum, 22, in row 2, column 1 of the answer
  • ?Take column 1 of P, the laps column
  • ?Multiply pair by pair: first with first, second with second
  • ?Take row 2 of R, the Heron row
  • ?Add the two products
WHY THIS EXERCISEEvery entry of every product is found by these same five moves.
What is row 1, column 2 of [3 2; 1 4] × [2 1; 5 3]? Type the number.
The square matrix with 1s on the diagonal and 0s elsewhere is the this matrix. Type one word.
For the product AB to exist, the columns of A must match the rows of B in this. Type one word.
StatementTrue or false?
Each entry of AB comes from a row of A and a column of B.?
3 × 2 + 2 × 5 = 16?
AB and BA are always equal.?
A × I = A for the identity matrix I.?
A 2 by 3 matrix times a 2 by 3 matrix is allowed.?
WHY THIS EXERCISEThe order rule is the one surprise in matrix arithmetic, and Thursday proves why it happens.
In R × P = [16 9; 22 13], how many laps did Heron row in total? Type the number.
WHY THIS EXERCISEReading the product back in words is how you know the multiplication meant something.
Try it
Write two 2 by 2 matrices of your own. Multiply them in both orders.
Circle any entries that match and any that differ. Then multiply one of them by the identity.

Excellent. Tomorrow the boat cutout goes on the grid and a matrix stretches, flips and shears it in the Boathouse Lab.

← Monday