VM - Add and Subtract Matrices Lesson
Add and Subtract Matrices
In order to add and subtract matrices, they must have the same dimensions - or the same number of rows and columns. If two matrices have that, then you may add or subtract corresponding entries.
A=[1−2504−1]B=[2043−15]
Matrices A and B are both size 2 x 3 so I can add or subtract them. Let's try adding them:
A+B=[1−2504−1]+[2043−15]=[1+2−2+05+40+34+−1−1+5]=[3−29334]
Let's try subtracting them:
A−B=[1−2504−1]−[2043−15]=[1−2−2−05−40−34−−1−1−5]=[−1−21−35−6]
Let's try a few:
A=[−479032]B=[368−1−20]C=[10542−27−31]D=[7−205336−14]
Notice up above that A + B = B + A. This means that matrix addition (like addition with real numbers) is commutative!
Application:
The A-Plus auto parts store chain has two outlets, one in Vancouver and one in Quebec. Among other things, it sells wiper blades, windshield cleaning fluid, and floor mats. The monthly sales of these items at the two stores for two months are given in the following tables:
Vancouver | Quebec | |
Wiper Blades | 20 | 15 |
Changing Fluid (bottles | 10 | 12 |
Floor Mats | 8 | 4 |
Vancouver | Quebec | |
Wiper Blades | 23 | 12 |
Changing Fluid (bottles | 8 | 12 |
Floor Mats | 4 | 5 |
Use matrix arithmetic to calculate the change in sales of each product in each store from January to February.
Let's organize the data into matrices:
To compute the change in sales of each product for both stores, we want to subtract corresponding entries in these two matrices. In other words, we want to compute the difference of the two matrices:
Thus, the change in sales of each product is the following:
Vancouver | Quebec | |
Wiper Blades | 3 | -3 |
Changing Fluid (bottles | -2 | 0 |
Floor Mats | -4 | 1 |
Resource Links to an external site.
[CC BY-NC-SA 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION - INTENDED ONLY FOR USE WITHIN LESSON.