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.

LaTeX: A=\begin{bmatrix}
1 & -2 & 5\\
0 & 4 & -1
\end{bmatrix}
B=
\begin{bmatrix}
2 & 0 & 4\\
3 & -1 & 5
\end{bmatrix}A=[125041]B=[204315]

Matrices A and B are both size 2 x 3 so I can add or subtract them. Let's try adding them:

LaTeX: A+B=\begin{bmatrix}
1 & -2 & 5\\
0 & 4 & -1
\end{bmatrix}
+
\begin{bmatrix}
2 & 0 & 4\\
3 & -1 & 5
\end{bmatrix}
=
\begin{bmatrix}
1+2 & -2+0 & 5+4\\
0+3 & 4+-1 & -1+5
\end{bmatrix}
=
\begin{bmatrix}
3 & -2 & 9\\
3 & 3 & 4
\end{bmatrix}A+B=[125041]+[204315]=[1+22+05+40+34+11+5]=[329334]

Let's try subtracting them:

LaTeX: A-B=\begin{bmatrix}
1 & -2 & 5\\
0 & 4 & -1
\end{bmatrix}
-
\begin{bmatrix}
2 & 0 & 4\\
3 & -1 & 5
\end{bmatrix}
=
\begin{bmatrix}
1-2 & -2-0 & 5-4\\
0-3 & 4--1 & -1-5
\end{bmatrix}
=
\begin{bmatrix}
-1 & -2 & 1\\
-3 & 5 & -6
\end{bmatrix}AB=[125041][204315]=[122054034115]=[121356]

Let's try a few:

LaTeX: A=\begin{bmatrix}
-4 & 7 & 9\\
0 & 3 & 2
\end{bmatrix}
B=
\begin{bmatrix}
3 & 6 & 8\\
-1 & -2 & 0
\end{bmatrix}
C=\begin{bmatrix}
1 & 0 & 5\\
4 & 2 & -2\\
7 & -3 & 1
\end{bmatrix}
D=
\begin{bmatrix}
7 & -2 & 0\\
5 & 3 & 3\\
6 & -1 & 4
\end{bmatrix}A=[479032]B=[368120]C=[105422731]D=[720533614]

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:

January Sales
Vancouver Quebec
Wiper Blades 20 15
Changing Fluid (bottles 10 12
Floor Mats 8 4

 

February Sales
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:

data for January and February in 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:

Illustration of February minus January

Thus, the change in sales of each product is the following:

Change in Sales for Each Product
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.