A Bakery's Weekly Sales at Two Branches Written as a Matrix
A bakery has two branches, North and South. In one week North sells 40 loaves, 25 cakes and 12 pies, and South sells 35 loaves, 30 cakes and 18 pies. The sales are written as a matrix S with one row for each branch and one column for each item. (a) Write down S and state its order. What does the entry in row 2, column 3 mean? (b) The owner rewrites the same figures with one row for each item and one column for each branch. State the order of the new matrix, and give the row and the column in which the number 18 now appears.
A matrix is a table of numbers with its labels taken off. The order of a matrix is its number of rows by its number of columns, always rows first. Each entry is named by its row and its column, and the labels of that row and that column say what the number counts.
- Put North's sales in row 1 and South's in row 2, with loaves, cakes and pies in columns 1, 2 and 3: S = 402512353018.
- The order is the number of rows by the number of columns. S has 2 rows and 3 columns, so its order is 2 × 3, and it holds 2 × 3 = 6 numbers.
- (a) The entry in row 2, column 3 is 18. Row 2 is South and column 3 is pies, so it means that the South branch sold 18 pies that week.
- In the new matrix each item is a row and each branch is a column: 403525301218. It has 3 rows and 2 columns, so its order is 3 × 2.
- (b) The 18 still counts the pies sold at South. Pies are now row 3 and South is column 2, so the 18 is in row 3, column 2. Check: both matrices hold the same 6 numbers, arranged in the different orders 2 × 3 and 3 × 2.
answer(a) S = 402512353018, of order 2 × 3; the entry 18 means that South sold 18 pies; (b) order 3 × 2, with the 18 in row 3, column 2
techniqueThe Order of a Matrix
examsO-Level
Common pitfalls
- Giving the order of S as 3 × 2 because there are three items. The order is always rows first and then columns, and S has two rows, one for each branch.
- Finding the entry in row 2, column 3 by counting 2 columns across and 3 rows down. The first number always names the row, and S has no third row.
Two Weeks of Café Sales Added, and the Change from One Week to the Next
A café has two branches, Station and Park. The cups of coffee, tea and juice sold in two weeks are given by the matrices below, with one row for each branch: week 1 is A = 1204530956025 and week 2 is B = 11050351055530. (a) Find A + B, and say what the entry in row 2, column 1 means. (b) Find B − A. Which drinks sold fewer cups in week 2 than in week 1, and at which branch?
Two matrices of the same order are added or subtracted entry by entry: each entry is combined with the one in the same row and column, which here is the same branch and the same drink. A negative entry in the difference means that the number went down.
- Both matrices have order 2 × 3, with the branches in the rows and coffee, tea and juice in the columns, so they can be added and subtracted entry by entry.
- Add each entry to the one in the same place: A + B = 120 + 11045 + 5030 + 3595 + 10560 + 5525 + 30 = 230956520011555.
- (a) The entry in row 2, column 1 is 200. Row 2 is Park and column 1 is coffee, so the Park branch sold 200 cups of coffee over the two weeks.
- Subtract entry by entry: B − A = 110 − 12050 − 4535 − 30105 − 9555 − 6030 − 25 = −105510−55.
- (b) A negative entry is a fall. Station sold 10 fewer cups of coffee and Park sold 5 fewer cups of tea; every other entry is positive, so those sales rose. Check: A + (B − A) gives B again, for example 120 + (−10) = 110.
answer(a) A + B = 230956520011555; the 200 is the cups of coffee sold at Park over the two weeks; (b) B − A = −105510−55: coffee at Station fell by 10 cups and tea at Park by 5 cups
techniqueAdding, Subtracting and Scaling Matrices · The Order of a Matrix
examsO-Level
Common pitfalls
- Subtracting the wrong way round and finding A − B. The change from week 1 to week 2 is week 2 minus week 1, so that a fall comes out negative.
- Trying to add A to a matrix of a different order, such as the same figures written with one row for each drink. Matrices can be added only when they have the same order, so that each entry has a partner in the same place.
A Price Rise and Then a Discount Card Applied to a Price List
Two shops, A and B, sell school shirts, trousers and jackets. Their prices in dollars are the matrix P = 203550253040, with one row for each shop. Next term every price rises by 20%. (a) Find the matrix of new prices. (b) A parent has a card that takes 25% off every new price. Write the prices the parent pays as a single number times P, find them, and say how each compares with the price before the rise.
Multiplying a matrix by a number, a scalar, multiplies every entry by that number. A percentage rise or fall that applies to every price is exactly this, and two changes one after the other combine into one scalar.
- A rise of 20% multiplies every price by 1 + 0.2 = 1.2, so the new prices are the scalar multiple 1.2P: every entry of P is multiplied by 1.2.
- (a) 1.2P = 1.2 × 201.2 × 351.2 × 501.2 × 251.2 × 301.2 × 40 = 244260303648 dollars.
- Taking 25% off leaves 75%, so the card multiplies each new price by 0.75. The parent pays 0.75(1.2P), and the two scalars multiply together: 0.75 × 1.2 = 0.9, so the parent pays 0.9P.
- 0.9P = 0.9 × 200.9 × 350.9 × 500.9 × 250.9 × 300.9 × 40 = 1831.54522.52736 dollars: for example, the trousers at shop A cost the parent $31.50.
- (b) The parent pays 0.9P, so every price is 10% below what it was before the rise. Check on one entry: the jacket at shop B rises to 1.2 × 40 = $48, and 75% of $48 is $36, which is 0.9 × 40.
answer(a) 1.2P = 244260303648 dollars; (b) 0.9P = 1831.54522.52736 dollars, every price 10% below the price before the rise
techniqueAdding, Subtracting and Scaling Matrices
examsO-Level
Common pitfalls
- Combining the percentages as 20% − 25% = −5% and multiplying by 0.95. The discount is taken off the new, higher price, so the scalars multiply: 1.2 × 0.75 = 0.9, which is 10% off.
- Adding 20 to every entry. A 20% rise is a different amount on each item, $4 on a $20 shirt and $10 on a $50 jacket, so every entry is multiplied by 1.2 instead.
A Café's Takings as Its Orders Times Its Prices
On Saturday the Station branch of a café sells 50 coffees, 30 teas and 20 slices of cake, and the Park branch sells 40 coffees, 45 teas and 25 slices of cake. A coffee costs $3, a tea $2 and a slice of cake $4. The sales are the matrix Q = 503020404525 and the prices are the column P = 324. (a) Explain why the product QP can be found, and state its order. Why can PQ not be found? (b) Find QP, and hence the takings at each branch and in total.
A product QP can be found when the number of columns of Q equals the number of rows of P, and the product then has as many rows as Q and as many columns as P. Each entry is a row times a column: multiply the matching entries and add. Here a row of quantities times the column of prices is the money one branch takes.
- Q is 2 × 3 and P is 3 × 1. The inner numbers are both 3, one for each item, so each quantity has a price to meet and QP can be found.
- (a) The outer numbers give the order: QP is 2 × 1, one total for each branch. PQ would be 3 × 1 times 2 × 3: P has 1 column and Q has 2 rows, and 1 ≠ 2, so PQ cannot be found.
- Row 1 of Q times the column P: 50 × 3 + 30 × 2 + 20 × 4 = 150 + 60 + 80 = 290.
- Row 2 of Q times the column P: 40 × 3 + 45 × 2 + 25 × 4 = 120 + 90 + 100 = 310. So QP = 290310.
- (b) The Station branch takes $290 and the Park branch takes $310, which is $600 in total. Check: together the branches sold 90 coffees, 75 teas and 45 slices of cake, and 90 × 3 + 75 × 2 + 45 × 4 = 270 + 150 + 180 = 600.
answer(a) Q has 3 columns and P has 3 rows, so QP can be found, and it is 2 × 1; PQ cannot, as P has 1 column and Q has 2 rows; (b) QP = 290310: $290 at Station and $310 at Park, $600 in total
techniqueCombining Data with a Matrix Product · The Matrix Product · The Order of a Matrix
examsO-Level
Common pitfalls
- Multiplying entry by entry, 50 × 3, 30 × 2 and so on, and stopping with six numbers. A matrix product adds along the row, so each branch gives one sum.
- Trying to find PQ because both matrices are there. In a product the order matters: PQ needs P to have as many columns as Q has rows, and it does not.
The Parts for Bicycles and Tricycles Priced by Two Suppliers
A workshop builds bicycles and tricycles. A bicycle needs 1 frame, 2 wheels and 1 seat, and a tricycle needs 1 frame, 3 wheels and 1 seat. Supplier X charges $40 for a frame, $15 for a wheel and $10 for a seat; supplier Y charges $45, $12 and $8. (a) Write the parts as a 2 × 3 matrix N and the costs as a 3 × 2 matrix C, with one column for each supplier, and find NC. What does each entry mean? (b) The workshop has an order for 20 bicycles and 10 tricycles. Use the row matrix 2010 to find the cost of the parts from each supplier. Which supplier is cheaper, and by how much?
The labels decide the product. N goes from products to parts, and C goes from parts to suppliers, so in NC the parts meet and cancel: each entry is the cost of one product from one supplier. An order written as a row then goes from the order to the products.
- N = 121131, with bicycles and tricycles in the rows and frames, wheels and seats in the columns. C = 40451512108, with the parts in the rows and suppliers X and Y in the columns. The inner numbers of 2 × 3 and 3 × 2 match, so NC is 2 × 2.
- Row 1 of N times column 1 of C prices a bicycle's parts at supplier X: 1 × 40 + 2 × 15 + 1 × 10 = 80. Row 1 times column 2 prices them at Y: 1 × 45 + 2 × 12 + 1 × 8 = 77.
- Row 2 times column 1: 1 × 40 + 3 × 15 + 1 × 10 = 95. Row 2 times column 2: 1 × 45 + 3 × 12 + 1 × 8 = 89.
- (a) NC = 80779589. Each entry is the cost in dollars of the parts for one product from one supplier: a bicycle costs $80 from X and $77 from Y, and a tricycle costs $95 from X and $89 from Y.
- Multiply the order by NC: 201080779589 = 20 × 80 + 10 × 9520 × 77 + 10 × 89 = 25502430.
- (b) The parts cost $2550 from X and $2430 from Y, so supplier Y is cheaper by 2550 − 2430 = $120. Check: the order needs 30 frames, 70 wheels and 30 seats, and at Y that costs 30 × 45 + 70 × 12 + 30 × 8 = 1350 + 840 + 240 = 2430.
answer(a) NC = 80779589: the cost in dollars of the parts for a bicycle (row 1) and a tricycle (row 2) from supplier X (column 1) and supplier Y (column 2); (b) $2550 from X and $2430 from Y: Y is cheaper by $120
techniqueCombining Data with a Matrix Product · The Matrix Product
examsO-Level
Common pitfalls
- Choosing supplier X because its frames are cheaper. A tricycle uses three wheels, and Y's cheaper wheels and seats outweigh its more expensive frame, which only the whole product shows.
- Writing C with one row for each supplier and then finding NC anyway. N is 2 × 3 and that C would be 2 × 3 too, so the product cannot be found: the parts must run down the rows of C to meet the parts across the columns of N.
League Points from a Table of Wins, Draws and Losses
After 8 games each, three teams have these results: the Lions have 5 wins, 2 draws and 1 loss; the Hawks have 4 wins, 4 draws and 0 losses; the Sharks have 3 wins, 1 draw and 4 losses. The league gives 3 points for a win, 1 for a draw and 0 for a loss. (a) Write the results as a matrix R and the points as a column, and find each team's points. Which team is top? (b) An older rule gave 2 points for a win and 1 for a draw. Put both rules into one 3 × 2 matrix K, find RK, and say how the older rule changes the top of the table.
A team's points are its number of each result times the points for that result, added up: a row of results times a column of points. Two scoring rules written as two columns give both totals for every team in one product.
- R = 521440314, with the Lions, Hawks and Sharks in the rows and wins, draws and losses in the columns. The points are the column 310, one row for each result.
- Each team's points are its row times the column. Lions: 5 × 3 + 2 × 1 + 1 × 0 = 17. Hawks: 4 × 3 + 4 × 1 + 0 × 0 = 16. Sharks: 3 × 3 + 1 × 1 + 4 × 0 = 10.
- (a) The product is 171610, so the Lions are top with 17 points, one ahead of the Hawks.
- Put the two rules side by side as the columns of K = 321100. The first column of RK is the points above. The second column is each row times 210: Lions 10 + 2 + 0 = 12, Hawks 8 + 4 + 0 = 12 and Sharks 6 + 1 + 0 = 7.
- (b) RK = 17121612107. Under the older rule the Lions and the Hawks are level on 12 points: the Hawks' two extra draws count for as much as the Lions' extra win. Check: every team played 8 games, as 5 + 2 + 1 = 4 + 4 + 0 = 3 + 1 + 4 = 8.
answer(a) 17, 16 and 10 points: the Lions are top; (b) RK = 17121612107: under the older rule the Lions and the Hawks are level on 12 points
techniqueCombining Data with a Matrix Product · The Matrix Product
examsO-Level
Common pitfalls
- Writing the points as a row, 310, and trying to find R times it. R is 3 × 3 and a row is 1 × 3, so the product cannot be found; the points must be a 3 × 1 column.
- Putting the two rules in the rows of K. Then K is 2 × 3 and RK cannot be found: each rule is a column, so that the results in the columns of R meet the results in the rows of K.
Fruit Boxes in Two Orders, Where AB Counts the Fruit and BA Counts Nothing
A farm packs small and large fruit boxes. A small box holds 6 apples and 4 pears, and a large box holds 10 apples and 8 pears. Order 1 is 3 small boxes and 1 large box, and order 2 is 2 small boxes and 4 large boxes. Let A = 3124, with the orders in the rows and the small and large boxes in the columns, and let B = 64108, with the box sizes in the rows and apples and pears in the columns. (a) Find AB and say what it tells the farm. (b) Find BA. Show that AB ≠ BA, and explain why BA does not count anything.
In a product the columns of the first matrix meet the rows of the second, so the labels there must match. In AB the columns of A are box sizes and the rows of B are box sizes, so each entry counts one kind of fruit in one order. Both matrices are 2 × 2, so BA can also be worked out, but its labels do not match.
- In AB a row of A, one order by box size, meets a column of B, one fruit by box size. The box sizes match, so each entry of AB counts one fruit in one order.
- Row 1 times column 1: 3 × 6 + 1 × 10 = 28 apples in order 1. Row 1 times column 2: 3 × 4 + 1 × 8 = 20 pears. Row 2 gives 2 × 6 + 4 × 10 = 52 apples and 2 × 4 + 4 × 8 = 40 pears.
- (a) AB = 28205240: order 1 needs 28 apples and 20 pears, and order 2 needs 52 apples and 40 pears.
- Now multiply the other way round, a row of B times a column of A: 6 × 3 + 4 × 2 = 26, 6 × 1 + 4 × 4 = 22, 10 × 3 + 8 × 2 = 46 and 10 × 1 + 8 × 4 = 42. So BA = 26224642.
- (b) The first entries are 28 and 26, so AB ≠ BA. The first entry of BA is 6 × 3 + 4 × 2: the apples in a small box times the small boxes in order 1, plus the pears in a small box times the small boxes in order 2. It adds two kinds of fruit from two different orders, so it counts nothing. Matrices must be multiplied in the order in which their labels meet: orders to boxes, then boxes to fruit.
answer(a) AB = 28205240: order 1 needs 28 apples and 20 pears, and order 2 needs 52 apples and 40 pears; (b) BA = 26224642 ≠ AB, and its entries add fruit of two kinds from two orders, so it counts nothing
techniqueWhy AB Differs from BA · The Matrix Product
examsO-Level
Common pitfalls
- Assuming that AB = BA, as it would be for two numbers. Matrix multiplication is not commutative: here the first entries are 28 and 26.
- Reading the 46 in BA as the apples in order 2. Only a product whose inner labels match counts something; in BA the columns of B are fruit and the rows of A are orders, and those do not match.
Half-Price Bread, and the Identity Matrix That Leaves a Price List Unchanged
Two shops, A and B, sell bread, milk and eggs. Their prices in dollars are P = 435624, with one row for each shop and one column for each item. A price change is made by multiplying P on the right by a 3 × 3 matrix. (a) Find PI, where I is the 3 × 3 identity matrix, and find P − PI. What does multiplying by I do to the prices? (b) On Friday bread is half price. Find PD for D = 0.500010001, and find P − PD. What does P − PD show?
The identity matrix I has 1s down its leading diagonal and 0s everywhere else. In a product each column of I picks out one entry of a row and multiplies the others by 0, so PI = P. The zero matrix O has every entry 0. Changing one diagonal entry of I changes only the matching column of P.
- The identity is I = 100010001. P is 2 × 3 and I is 3 × 3, so PI can be found and is 2 × 3, the same order as P.
- Row 1 of P times column 1 of I: 4 × 1 + 3 × 0 + 5 × 0 = 4. Row 1 times column 2: 4 × 0 + 3 × 1 + 5 × 0 = 3. Each column of I picks out one price and multiplies the other two by 0.
- (a) Every entry comes back unchanged: PI = 435624 = P, and P − PI = O, the 2 × 3 zero matrix. Multiplying by I changes no price.
- D is I with its first 1 replaced by 0.5. Row 1 of P times column 1 of D: 4 × 0.5 + 3 × 0 + 5 × 0 = 2, and the other two columns of D pick out the prices as I does. So PD = 235324.
- (b) P − PD = 200300: it is the saving, $2 on bread at shop A and $3 on bread at shop B, and nothing on milk or eggs. Check: half of $4 is $2 and half of $6 is $3.
answer(a) PI = P, so P − PI = O: multiplying by I changes no price; (b) PD = 235324 and P − PD = 200300, the saving: $2 on bread at shop A and $3 at shop B
techniqueThe Identity and Zero Matrices · The Matrix Product
examsO-Level
Common pitfalls
- Taking the identity to be the matrix with every entry 1. That matrix would add all three prices into every entry, giving 4 + 3 + 5 = 12; only 1s on the diagonal and 0s elsewhere leave each price where it is.
- Writing IP in place of PI. With I of order 3 × 3 and P of order 2 × 3, IP cannot be found, so this identity must stand on the right of P.
Young and Adult Birds in a Reserve, Two and Three Years Ahead
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.
One year is one multiplication by M, so two years is M applied twice, which is the power M2 = MM, and three years is M3 = M2M. A power of a matrix is found by multiplying row by column, never by raising each entry to the power.
- 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.
- 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.
- (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.
- 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.
- (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.
answer(a) M2 = 2213: 20 young and 22 adults in two years; (b) M3 = 2635: 86 birds in three years
techniqueThe Matrix Product · Matrix Powers by Induction
examsO-Level
Common pitfalls
- 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.
Trees Planted by a Team of Gardeners, with a Formula for Any Number of Years Proved by Induction
A park has 40 trees and a team of 3 gardeners. Each year every gardener plants 5 trees, no tree is lost, and the team stays the same size. With the column treesgardeners, one year is multiplication by M = 1501. (a) Find M2 and M3, and suggest a formula for Mn. (b) Prove your formula by induction for every positive whole number n, and use it to find the number of trees after 10 years.
A pattern in the first few powers is only a guess until it is proved. Proof by induction has two parts: show the formula is true for n = 1, then show that if it is true for n = k it is also true for n = k + 1. Here Mk+1 = MkM, one more year after k years.
- First check the model: Mxg = 1 × x + 5 × g0 × x + 1 × g = x + 5gg for x trees and g gardeners: each gardener adds 5 trees, and the team is unchanged.
- M2 = MM: row 1 times column 1 is 1 × 1 + 5 × 0 = 1, row 1 times column 2 is 1 × 5 + 5 × 1 = 10, and row 2 gives 0 and 1. So M2 = 11001, and in the same way M3 = M2M = 11501.
- (a) The top right entry goes up by 5 with each power, so the formula to suggest is Mn = 15n01.
- Prove it by induction. For n = 1 the formula gives 1501, which is M, so it is true. Now assume that it is true for n = k, so that Mk = 15k01.
- Then Mk+1 = MkM = 1 × 1 + 5k × 01 × 5 + 5k × 10 × 1 + 1 × 00 × 5 + 1 × 1 = 15(k + 1)01, which is the formula for n = k + 1. It is true for n = 1, and whenever it is true for k it is true for k + 1, so it is true for every positive whole number n.
- (b) By the formula, M10 = 15001, and M10403 = 40 + 50 × 33 = 1903: after 10 years there are 190 trees. Check: the 3 gardeners plant 15 trees a year, and 40 + 10 × 15 = 190.
answer(a) M2 = 11001, M3 = 11501, and Mn = 15n01; (b) proved by induction; 190 trees after 10 years
techniqueMatrix Powers by Induction · The Matrix Product
examsO-Level
Common pitfalls
- Stopping after checking n = 1, 2 and 3. A pattern seen in three cases is only a guess; the inductive step is what shows that it holds for every n.
- Finding Mk+1 as Mk times Mk. That is M2k, not one more year; Mk+1 is Mk times M.