A row times a column
Each entry of a matrix product comes from one row of the left matrix and one column of the right. To find the entry in row i, column j of AB, take row i of A and column j of B, multiply their entries in matching pairs, the first with the first, the second with the second, and add the products.
That is the dot product of a row and a column. For A = (2 3; 4 1) and B = (5 4; 1 0), row 1 of A is 2, 3 and column 1 of B is 5, 1, so the top left entry of AB is 2 × 5 + 3 × 1 = 10 + 3 = 13.
Row 1 of A with column 2 of B, which is 4, 0, gives the top right entry: 2 × 4 + 3 × 0 = 8 + 0 = 8.
The bottom row
Row 2 of A is 4, 1. With column 1 of B it gives 4 × 5 + 1 × 1 = 20 + 1 = 21, and with column 2 it gives 4 × 4 + 1 × 0 = 16. So AB = (13 8; 21 16).
Each row of A makes one row of the product, and each column of B makes one column, so a 2 × 2 times a 2 × 2 has four entries to find, one for each pairing of a row with a column.
Row 2 of A meets column 1 of B: 4 × 5 + 1 × 1 = 21, the bottom left entry of AB.
The finished product. The 21 sits in row 2, column 1, because it came from row 2 of A and column 1 of B.
When a product can be found
A row of A and a column of B can only be paired up if they hold the same number of entries. A row of A holds as many entries as A has columns, and a column of B holds as many as B has rows. So AB can be found only when A has as many columns as B has rows.
Write the two orders side by side. A matrix of order m × n times a matrix of order n × p needs the two inner numbers, n and n, to match, and the product has the order of the outer numbers, m × p: one row for each row of A and one column for each column of B.
So a 2 × 3 times a 3 × 2 is a 2 × 2, and a 3 × 2 times a 2 × 4 is a 3 × 4. A 2 × 3 times another 2 × 3 cannot be found: a row of the first holds 3 entries and a column of the second holds only 2.
A 2 × 3 times a 3 × 2
Take A = (2 3 1; 4 0 2), a 2 × 3, and B = (5 4; 1 0; 3 2), a 3 × 2. The inner numbers are both 3, so each row of A has three entries to pair with the three entries of a column of B, and AB is 2 × 2.
Row 1 with column 1: 2 × 5 + 3 × 1 + 1 × 3 = 10 + 3 + 3 = 16. Row 1 with column 2: 2 × 4 + 3 × 0 + 1 × 2 = 8 + 0 + 2 = 10.
Row 2 with column 1: 4 × 5 + 0 × 1 + 2 × 3 = 20 + 0 + 6 = 26. Row 2 with column 2: 4 × 4 + 0 × 0 + 2 × 2 = 16 + 0 + 4 = 20. So AB = (16 10; 26 20).
Row 1 of A holds three entries and column 1 of B holds three, so they pair up: 2 × 5 + 3 × 1 + 1 × 3 = 16, the top left entry of AB.
A matrix times a column
A column vector is a matrix with one column, so a 2 × 2 times a 2 × 1 is a 2 × 1, another column. With A = (2 3; 4 1) and the column (1; 2), the top entry is 2 × 1 + 3 × 2 = 8 and the bottom entry is 4 × 1 + 1 × 2 = 6, so the product is the column (8; 6).
A 2 × 2 times a 2 × 1 is a 2 × 1. The top entry is row 1 of A with the column: 2 × 1 + 3 × 2 = 8.
Squaring a matrix
means A × A, worked row by column like any other product, so only a square matrix can be squared. For A = (2 3; 4 1): the top row is 2 × 2 + 3 × 4 = 16 and 2 × 3 + 3 × 1 = 9, and the bottom row is 4 × 2 + 1 × 4 = 12 and 4 × 3 + 1 × 1 = 13. So is the matrix (16 9; 12 13).
Squaring each entry gives (4 9; 16 1), which is a different matrix.
The usual mistakes
Stopping after one pair. The top left entry of AB is 2 × 5 + 3 × 1 = 13, not 2 × 5 = 10: every pair along the row is multiplied and the products are added.
Reading across B instead of down. Row 1 of A with row 1 of B gives 2 × 5 + 3 × 4 = 22, which is not an entry of AB; a product always pairs a row of the left with a column of the right.
Multiplying entry by entry. (2 3; 4 1) times (5 4; 1 0) is not (10 12; 4 0).
Giving the inner numbers as the order. A 4 × 3 times a 3 × 2 is a 4 × 2, not a 3 × 3.
Thinking that only square matrices can be multiplied. A 2 × 3 times a 3 × 2 works, because a row of the first and a column of the second both hold 3 entries.
A population, year by year
In the application below, one year in a bird reserve is multiplication by a 2 × 2 matrix M acting on a column of young and adult birds. Two years is and three years is , each found row by column and checked against the year before.
Worked example: Young and Adult Birds in a Reserve, Two and Three Years Ahead
Question A nature reserve counts the young and the adult birds of one species each spring. Over the next few years, each adult raises 2 young that survive, each young bird becomes an adult, and every adult survives. So if there are y young and a adults this year, next year there are 2a young and y + a adults, and the column youngadults is multiplied by M = 0211 each year. This spring there are 4 young and 6 adults. (a) Find M2, and use it to find the numbers of young and adults in two years' time. (b) Find M3, and the total number of birds in three years' time.
1.Write this spring's birds as the column 46. One year later: M46 = 0 × 4 + 2 × 61 × 4 + 1 × 6 = 1210: 12 young and 10 adults.
One year: M46 = 1210, so next spring there are 12 young and 10 adults. 2.Two years is M2 = MM. Row 1 times column 1: 0 × 0 + 2 × 1 = 2. Row 1 times column 2: 0 × 2 + 2 × 1 = 2. Row 2 gives 1 × 0 + 1 × 1 = 1 and 1 × 2 + 1 × 1 = 3. So M2 = 2213.
Two years is M2 = MM = 2213, found row by column. 3.(a) M246 = 2 × 4 + 2 × 61 × 4 + 3 × 6 = 2022: in two years there are 20 young and 22 adults. Check from next year's birds: 2 × 10 = 20 young and 12 + 10 = 22 adults.
(a) M246 = 2022: 20 young and 22 adults in two years. 4.Three years is M3 = M2M: 2 × 0 + 2 × 1 = 2, 2 × 2 + 2 × 1 = 6, 1 × 0 + 3 × 1 = 3 and 1 × 2 + 3 × 1 = 5. So M3 = 2635.
Three years is M3 = M2M = 2635. 5.(b) M346 = 2 × 4 + 6 × 63 × 4 + 5 × 6 = 4442, so in three years there are 44 + 42 = 86 birds. Check from the two-year figures: 2 × 22 = 44 young and 20 + 22 = 42 adults.
(b) M346 = 4442: 86 birds in three years.
Answer: (a) M2 = 2213: 20 young and 22 adults in two years; (b) M3 = 2635: 86 birds in three years
Common mistakes
- Squaring each entry of M to get 0411. M2 means M times M, row by column, and it gives 2213.
- Multiplying M2 by next year's birds, 1210, for the two-year figures. That applies M three times and gives the birds in three years; M2 goes with this spring's count.