Adding and Subtracting Matrices
How to add and subtract matrices of the same order, element by element; the zero matrix; finding unknown elements and an unknown matrix; and what a sum or a difference means in a setting.
Before you start
In lesson 4.1 you wrote information as a matrix and gave its order, rows × columns: the food stall's matrix S, with a row for each of 2 days and a column for each of 3 dishes, is .
Two matrices are equal when they have the same order and their corresponding elements, the elements in the same position, are equal.
You will also need Secondary 1's rules for negative numbers: , , .
Adding and Subtracting, Element by Element
Adding and subtracting matrices
Two matrices can be added or subtracted only when they have the same order.
To add them, add their corresponding elements. To subtract, subtract each element of the second from the corresponding element of the first.
The answer is a matrix of the same order.
It helps to write the working inside the brackets, one element at a time, and then work out each element. Put a negative number in brackets when it comes after a sign: , .
Example 1: A Sum and Two Differences
Find A + B, A − B and B − A.
| 3 | −2 | ||
| 5 | 0 |
| 4 | 6 | ||
| −1 | 7 |
Solution
Both are , so they can be added and subtracted. Add corresponding elements:
| 3 + 4 | −2 + 6 | ||
| 5 + (−1) | 0 + 7 |
| 7 | 4 | ||
| 4 | 7 |
Subtract each element of B from the element of A in the same position. Mind the signs:
| 3 − 4 | −2 − 6 | ||
| 5 − (−1) | 0 − 7 |
| −1 | −8 | ||
| 6 | −7 |
Now the other way round:
| 4 − 3 | 6 − (−2) | ||
| −1 − 5 | 7 − 0 |
| 1 | 8 | ||
| −6 | 7 |
B − A has every element of A − B with its sign changed.
| 7 | 4 | ||
| 4 | 7 |
| −1 | −8 | ||
| 6 | −7 |
| 1 | 8 | ||
| −6 | 7 |
Which comes first?
For addition it does not matter which matrix comes first: A + B = B + A, because and are the same, element by element.
For subtraction it does: A − B and B − A have the same elements with every sign changed (a 0 stays 0). Always subtract the matrices as the question writes them, the first minus the second.
Same Order Only
If two matrices have different orders, some elements have no partner in the other matrix, so the sum and the difference cannot be found. Do not fill the gaps with zeros.
Example 2: Which Can Be Added?
With A from Example 1 and the matrices C and D below, find C + D and C − D, and say whether A + C can be found.
| 4 | −3 | 0 | ||
| 1 | 7 | −5 |
| −2 | 5 | 6 | ||
| 3 | −4 | 2 |
Solution
C and D are both :
| 4 + (−2) | −3 + 5 | 0 + 6 | ||
| 1 + 3 | 7 + (−4) | −5 + 2 |
| 2 | 2 | 6 | ||
| 4 | 3 | −3 |
| 4 − (−2) | −3 − 5 | 0 − 6 | ||
| 1 − 3 | 7 − (−4) | −5 − 2 |
| 6 | −8 | −6 | ||
| −2 | 11 | −7 |
A + C cannot be found, as the orders are different.
| 2 | 2 | 6 | ||
| 4 | 3 | −3 |
| 6 | −8 | −6 | ||
| −2 | 11 | −7 |
The Zero Matrix
The zero matrix
A matrix whose elements are all 0 is a zero matrix, written O (it is also called the null matrix). There is one of each order.
Adding O changes nothing: A + O = A.
A matrix minus itself is the zero matrix of its order: A − A = O.
| 0 | 0 | ||
| 0 | 0 |
| 3 | −2 | ||
| 5 | 0 |
| 3 − 3 | −2 − (−2) | ||
| 5 − 5 | 0 − 0 |
| 0 | 0 | ||
| 0 | 0 |
Unknown Elements and Unknown Matrices
When a sum or a difference contains unknowns, work out each element of the left-hand side and equate it to the corresponding element of the right-hand side, as for equal matrices in 4.1.
When a whole matrix X is unknown, as in P + X = Q, take P from both sides, as you would with numbers: X = Q − P.
Example 3: Unknowns in a Sum
(a) Find and . (b) Find the matrix X for which P + X = Q.
(a)
| 2x | 5 | ||
| −3 | 4 |
| 3 | y | ||
| 1 | −2 |
| 13 | 1 | ||
| −2 | 2 |
(b)
| 3 | 4 | ||
| −2 | 6 |
| 5 | −1 | ||
| 2 | 8 |
Solution
(a) Add the left-hand side element by element:
| 2x | 5 | ||
| −3 | 4 |
| 3 | y | ||
| 1 | −2 |
| 2x + 3 | 5 + y | ||
| −3 + 1 | 4 + (−2) |
| 2x + 3 | y + 5 | ||
| −2 | 2 |
| 13 | 1 | ||
| −2 | 2 |
Row 1, column 1: , so and . Row 1, column 2: , so .
Check the other two elements: and . They agree.
(b) X = Q − P:
| 5 − 3 | −1 − 4 | ||
| 2 − (−2) | 8 − 6 |
| 2 | −5 | ||
| 4 | 2 |
| 3 | 4 | ||
| −2 | 6 |
| 2 | −5 | ||
| 4 | 2 |
| 5 | −1 | ||
| 2 | 8 |
The last line is the check: P + X gives Q.
(a) , (b)
| 2 | −5 | ||
| 4 | 2 |
What a Sum or a Difference Means
When two matrices hold the same kind of information with the same labels, their sum is the total for each position, and their difference is how many more (or, if negative, how many fewer) there are in the first than in the second.
Example 4: Two Days' Sales
A bubble tea shop has outlets at Bugis and Serangoon. The matrices A and B show the cups of each size sold at each outlet on Saturday and on Sunday. (a) Find A + B and say what it shows. How many large cups did the Serangoon outlet sell over the weekend? (b) Find how many more cups of each size each outlet sold on Sunday than on Saturday.
| small | medium | large | |||
|---|---|---|---|---|---|
| Bugis | 52 | 80 | 35 | ||
| Serangoon | 47 | 66 | 41 |
| small | medium | large | |||
|---|---|---|---|---|---|
| Bugis | 61 | 95 | 40 | ||
| Serangoon | 58 | 72 | 50 |
Solution
(a) Both are with the same labels:
| 52 + 61 | 80 + 95 | 35 + 40 | ||
| 47 + 58 | 66 + 72 | 41 + 50 |
| small | medium | large | |||
|---|---|---|---|---|---|
| Bugis | 113 | 175 | 75 | ||
| Serangoon | 105 | 138 | 91 |
Each element is the number of cups of one size sold at one outlet over the two days. The element in row 2, column 3 is 91: the Serangoon outlet sold 91 large cups over the weekend.
(b) "How many more on Sunday than on Saturday" is Sunday's sales minus Saturday's, B − A (not A − B):
| 61 − 52 | 95 − 80 | 40 − 35 | ||
| 58 − 47 | 72 − 66 | 50 − 41 |
| small | medium | large | |||
|---|---|---|---|---|---|
| Bugis | 9 | 15 | 5 | ||
| Serangoon | 11 | 6 | 9 |
Every element is positive, so each outlet sold more cups of every size on Sunday. For example, the Bugis outlet sold 15 more medium cups.
(a) A + B is below: the cups of each size sold at each outlet over the weekend; 91 large cups at Serangoon. (b) B − A is below: every element is positive.
(a)
| 113 | 175 | 75 | ||
| 105 | 138 | 91 |
(b)
| 9 | 15 | 5 | ||
| 11 | 6 | 9 |
Common Mistakes
- Adding or subtracting matrices of different orders, often by filling the missing places with 0. A and a matrix cannot be added.
- Signs in subtraction: , not ; .
- Adding all the elements into one number. The sum of two matrices is a matrix of the same order.
- Working out A − B when the question asks how many more there are in B than in A: that is B − A.
Practice
Try each question before you open its solution. Questions 8 and 10 are word problems.
Question 1
Find P + Q and P − Q.
| 5 | −3 | ||
| 0 | 2 |
| −1 | 4 | ||
| 6 | −2 |
ShowHide solution
| 5 + (−1) | −3 + 4 | ||
| 0 + 6 | 2 + (−2) |
| 4 | 1 | ||
| 6 | 0 |
| 5 − (−1) | −3 − 4 | ||
| 0 − 6 | 2 − (−2) |
| 6 | −7 | ||
| −6 | 4 |
P + Q and P − Q:
| 4 | 1 | ||
| 6 | 0 |
| 6 | −7 | ||
| −6 | 4 |
Question 2
Work out each of these.
(a)
| 2 | −1 | 0 | ||
| 4 | 3 | −5 |
| −3 | 1 | 2 | ||
| 0 | −4 | 5 |
(b)
| 7 | ||
| −2 | ||
| 0 |
| 3 | ||
| −5 | ||
| 4 |
(c)
| 6 | −2 | 9 |
| −1 | 4 | 9 |
ShowHide solution
(a)
| 2 | −1 | 0 | ||
| 4 | 3 | −5 |
| −3 | 1 | 2 | ||
| 0 | −4 | 5 |
| 2 + (−3) | −1 + 1 | 0 + 2 | ||
| 4 + 0 | 3 + (−4) | −5 + 5 |
| −1 | 0 | 2 | ||
| 4 | −1 | 0 |
(b)
| 7 | ||
| −2 | ||
| 0 |
| 3 | ||
| −5 | ||
| 4 |
| 7 − 3 | ||
| −2 − (−5) | ||
| 0 − 4 |
| 4 | ||
| 3 | ||
| −4 |
(c)
| 6 | −2 | 9 |
| −1 | 4 | 9 |
| 6 − (−1) | −2 − 4 | 9 − 9 |
| 7 | −6 | 0 |
Each answer has the order of the two matrices.
| 2 | −1 | 0 | ||
| 4 | 3 | −5 |
| −3 | 1 | 2 | ||
| 0 | −4 | 5 |
| −1 | 0 | 2 | ||
| 4 | −1 | 0 |
| 7 | ||
| −2 | ||
| 0 |
| 3 | ||
| −5 | ||
| 4 |
| 4 | ||
| 3 | ||
| −4 |
| 6 | −2 | 9 |
| −1 | 4 | 9 |
| 7 | −6 | 0 |
Question 3
Which two of these matrices can be added to each other? Find their sum, and say why no other pair can be added.
| 1 | 0 | ||
| −2 | 3 |
| 4 | 1 | −1 | ||
| 0 | 2 | 5 |
| −3 | 2 | ||
| 2 | 6 |
| 2 | 1 | ||
| 0 | −4 | ||
| 7 | 3 |
ShowHide solution
The orders: E , F , G , H . Only E and G have the same order.
| 1 + (−3) | 0 + 2 | ||
| −2 + 2 | 3 + 6 |
| −2 | 2 | ||
| 0 | 9 |
F () and H () hold the same number of elements, but their orders are different, so they cannot be added. No other pair has the same order either.
Only E and G can be added:
| −2 | 2 | ||
| 0 | 9 |
Question 4
Find A + B, B + A, A − B and B − A. What do you notice?
| 4 | −1 | ||
| 2 | 3 |
| 1 | 5 | ||
| −2 | 0 |
ShowHide solution
| 5 | 4 | ||
| 0 | 3 |
| 5 | 4 | ||
| 0 | 3 |
| 4 − 1 | −1 − 5 | ||
| 2 − (−2) | 3 − 0 |
| 3 | −6 | ||
| 4 | 3 |
| 1 − 4 | 5 − (−1) | ||
| −2 − 2 | 0 − 3 |
| −3 | 6 | ||
| −4 | −3 |
A + B = B + A. A − B and B − A are different: each element of one is the other's with its sign changed.
The sums are equal; the differences have opposite signs, element by element.
Question 5
Find the matrix X for which (a) A + X = B, (b) X − A = B.
| 2 | −3 | ||
| 1 | 4 |
| 5 | 0 | ||
| −2 | 6 |
ShowHide solution
(a) Take A from both sides: X = B − A.
| 5 − 2 | 0 − (−3) | ||
| −2 − 1 | 6 − 4 |
| 3 | 3 | ||
| −3 | 2 |
| 2 + 3 | −3 + 3 | ||
| 1 + (−3) | 4 + 2 |
| 5 | 0 | ||
| −2 | 6 |
(b) Add A to both sides: X = B + A.
| 5 + 2 | 0 + (−3) | ||
| −2 + 1 | 6 + 4 |
| 7 | −3 | ||
| −1 | 10 |
| 7 − 2 | −3 − (−3) | ||
| −1 − 1 | 10 − 4 |
| 5 | 0 | ||
| −2 | 6 |
In each part the second line is the check.
(a) X = B − A (b) X = B + A
| 3 | 3 | ||
| −3 | 2 |
| 7 | −3 | ||
| −1 | 10 |
Question 6
Find the matrix X for which A + X = O.
| 2 | −3 | ||
| 1 | 4 |
ShowHide solution
X = O − A: each element of X is 0 minus the element of A, so every sign is changed.
| 0 − 2 | 0 − (−3) | ||
| 0 − 1 | 0 − 4 |
| −2 | 3 | ||
| −1 | −4 |
| 0 | 0 | ||
| 0 | 0 |
X has every element of A with its sign changed:
| −2 | 3 | ||
| −1 | −4 |
Question 7
Find and in (a) and in (b).
(a)
| x | 4 | ||
| −1 | 3 |
| 2 | y | ||
| 5 | −6 |
| 7 | −1 | ||
| 4 | −3 |
(b)
| 3x | 2 | ||
| y | 5 |
| 4 | −1 | ||
| 6 | 2 |
| 11 | 3 | ||
| −8 | 3 |
ShowHide solution
(a)
| x | 4 | ||
| −1 | 3 |
| 2 | y | ||
| 5 | −6 |
| x + 2 | y + 4 | ||
| 4 | −3 |
| 7 | −1 | ||
| 4 | −3 |
Row 1, column 1: , so . Row 1, column 2: , so . Check: and .
(b)
| 3x | 2 | ||
| y | 5 |
| 4 | −1 | ||
| 6 | 2 |
| 3x − 4 | 2 − (−1) | ||
| y − 6 | 5 − 2 |
| 11 | 3 | ||
| −8 | 3 |
Row 1, column 1: , so and . Row 2, column 1: , so . Check: and .
(a) , (b) ,
Question 8
A convenience store has branches at Bedok and Yishun. The matrices show the bottles of water and of juice each branch had at the start of a week (K), the bottles delivered during the week (D) and the bottles sold (S). (a) Find K + D − S. (b) What does the element in row 2, column 2 of your answer mean?
| water | juice | |||
|---|---|---|---|---|
| Bedok | 30 | 24 | ||
| Yishun | 18 | 40 |
| water | juice | |||
|---|---|---|---|---|
| Bedok | 20 | 15 | ||
| Yishun | 25 | 10 |
| water | juice | |||
|---|---|---|---|---|
| Bedok | 35 | 28 | ||
| Yishun | 30 | 45 |
ShowHide solution
(a) Work from left to right: first K + D, the bottles each branch had in all, then take away S.
| 30 + 20 | 24 + 15 | ||
| 18 + 25 | 40 + 10 |
| 50 | 39 | ||
| 43 | 50 |
| 50 | 39 | ||
| 43 | 50 |
| 35 | 28 | ||
| 30 | 45 |
| 50 − 35 | 39 − 28 | ||
| 43 − 30 | 50 − 45 |
| 15 | 11 | ||
| 13 | 5 |
(b) Each element is the number of bottles left at the end of the week. Row 2 is Yishun and column 2 is juice: the Yishun branch had 5 bottles of juice left.
(a) K + D − S is below. (b) The Yishun branch had 5 bottles of juice left at the end of the week.
(a)
| 15 | 11 | ||
| 13 | 5 |
Question 9
(a) Siti adds P and Q by writing a 0 in the empty places of P. Explain her mistake. (b) Ravi works out the difference in (b) and gets 4 and 0 in row 1, −4 and 0 in row 2. Find his mistake and correct it.
(a)
| 1 | 2 | ||
| 3 | 4 |
| 5 | 6 | 7 | ||
| 8 | 9 | 1 |
(b)
| 5 | 2 | ||
| 0 | −3 |
| −1 | 2 | ||
| 4 | −3 |
ShowHide solution
(a) P is and Q is . Matrices of different orders cannot be added, so the sum cannot be found. Writing 0s changes P into a different matrix.
(b) Row 1, column 1 should be not 4: subtracting a negative number adds it.
| 5 | 2 | ||
| 0 | −3 |
| −1 | 2 | ||
| 4 | −3 |
| 5 − (−1) | 2 − 2 | ||
| 0 − 4 | −3 − (−3) |
| 6 | 0 | ||
| −4 | 0 |
(a) The orders differ: the sum cannot be found. (b) The first element is 6, not 4.
Question 10
A school canteen has two drinks stalls. The matrices show the hot and cold drinks each stall sold in the first week (F) and the second week (W) of a term. (a) Find the drinks of each kind each stall sold in the two weeks together. (b) Find how many more drinks of each kind each stall sold in the second week than in the first. What does the negative element mean?
| hot | cold | |||
|---|---|---|---|---|
| Stall 1 | 120 | 85 | ||
| Stall 2 | 64 | 150 |
| hot | cold | |||
|---|---|---|---|---|
| Stall 1 | 135 | 80 | ||
| Stall 2 | 70 | 172 |
ShowHide solution
(a) The total is the sum:
| 120 + 135 | 85 + 80 | ||
| 64 + 70 | 150 + 172 |
| 255 | 165 | ||
| 134 | 322 |
(b) How many more in the second week than in the first is W − F:
| 135 − 120 | 80 − 85 | ||
| 70 − 64 | 172 − 150 |
| 15 | −5 | ||
| 6 | 22 |
The element −5 is in row 1, column 2: Stall 1 sold 5 fewer cold drinks in the second week than in the first.
(a) F + W and (b) W − F are below. In (b), −5 means Stall 1 sold 5 fewer cold drinks in week 2 than in week 1.
(a)
| 255 | 165 | ||
| 134 | 322 |
(b)
| 15 | −5 | ||
| 6 | 22 |
Key Points
- Only matrices of the same order can be added or subtracted; otherwise the sum or difference cannot be found.
- Add or subtract corresponding elements. The answer has the same order.
- A + B = B + A, but A − B and B − A are in general different: each element of one is the other's with its sign changed.
- The zero matrix O has every element 0: A + O = A and A − A = O.
- Find unknown elements by equating corresponding elements; find an unknown matrix as with numbers: if P + X = Q, then X = Q − P.
- In a setting, a sum is a total and a difference is how many more (a negative element: how many fewer).