topic badge

Honors: 8.03 Operations with matrices

Lesson

Concept summary

Data may be represented in a matrix to make it easier to manipulate the data and solve problems in a given context. We can then manipulate the data sets by adding, subtracting or multiplying the matrices as necessary to solve the problem.

The solution of the problem may require the entire resulting matrix or just the elements of the resulting matrix. The final answer should be written in the context of the problem.

Matrix Addition

The process of adding corresponding elements of multiple matrices of the same order.

If A=\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} and B= \begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix} , to add A+B add each corresponding element a_{ij}+b_{ij}.

This process is shown below:

\begin{aligned} A+B &=\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}+\begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix} \\ &= \begin{bmatrix} a_{11}+b_{11} & a_{12}+b_{12} \\ b_{21}+b_{21} & a_{22}+b_{22} \end{bmatrix} \end{aligned}
Matrix Subtraction

The process of subtracting corresponding elements of multiple matrices of the same order.

If A=\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} and B= \begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix} , to subtract A-B subtract each corresponding element a_{ij}-b_{ij}.

This process is shown below:

\begin{aligned} A-B &= \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}-\begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \end{bmatrix} \\ &= \begin{bmatrix} a_{11}-b_{11} & a_{12}-b_{12} \\ b_{21}-b_{21} & a_{22}-b_{22} \end{bmatrix} \end{aligned}
Matrix Multiplication

The process of multiplying two matrices, where the ijth entry of the product matrix is the product of the ith row of the left matrix and the jth column of the right matrix.

To find the product of a row and column, we multiply the corresponding row entries and column entries together and take their sum. For example:\begin{bmatrix} a_{11} & a_{12} \end{bmatrix} \begin{bmatrix} b_{11} \\ b_{21} \end{bmatrix}=\begin{bmatrix} a_{11}b_{11}+a_{12}b_{21}\end{bmatrix}It is for this reason that the number of columns of the left matrix must be the same as the number of rows of the right matrix, otherwise we cannot multiply the rows and columns together.

If the order of the first matrix being multiplied is a\times b and the order of the second matrix being multiplied is b\times c, then the multiplication results in an a\times c matrix.

For example:

\displaystyle \begin{aligned} AB &=\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}\begin{bmatrix} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \end{bmatrix} \\ &= \begin{bmatrix} a_{11}b_{11} +a_{12}b_{21} & a_{11}b_{12} +a_{12}b_{22} & a_{11}b_{13} +a_{12}b_{23}\\ a_{21}b_{11} +a_{22}b_{21} & a_{21}b_{12} +a_{22}b_{22} & a_{21}b_{13} +a_{22}b_{23} \end{bmatrix} \end{aligned}
\bm{A}
the 2\times 2 matrix being multiplied
\bm{B}
the 2\times 3 matrix being multiplied
\bm{a_{ij}}
the element from matrix A in row i, column j
\bm{b_{ij}}
the element from matrix B in row i, column j
Scalar Multiplication

The process of multiplying a matrix, by a constant or scalar, k, where each term in the matrix is multiplied by the scalar k.

Example:

2\begin{bmatrix} 1 & -3 \\ 4 & 0 \end{bmatrix}=\begin{bmatrix} 2 & -6 \\ 8 & 0 \end{bmatrix}

Scalar

A single number or constant

For the matrix A=\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}, and the scalar k: \quad kA=\begin{bmatrix} k \cdot a_{11} & k \cdot a_{12} \\ k \cdot a_{21} & k \cdot a_{22} \end{bmatrix}.

Worked examples

Example 1

The tables below show the number of small, medium and large pizzas sold at David's two stores on Monday and Tuesday:

Monday:

SmallMediumLarge
Store 1283632
Store 2252724

Tuesday:

SmallMediumLarge
Store 1253328
Store 2262023
a

Find the total number of sales of small, medium and large pizzas for each store over Monday and Tuesday. Express your answer as a 2 \times 3 matrix.

Approach

The matrix for the sales of small, medium and large pizzas on Monday is: \begin{bmatrix} 28 & 36 & 32 \\ 25 & 27 & 24 \end{bmatrix}.

The matrix for the sales of small, medium and large pizzas on Tuesday is: \begin{bmatrix} 25 & 33 & 28 \\ 26 & 20 & 23 \end{bmatrix}.

To find the total number of sales across Monday and Tuesday, we can add the matrices for Monday and Tuesday's sales together.

If A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \end{bmatrix},\, B = \begin{bmatrix} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \end{bmatrix}then A+B = \begin{bmatrix} a_{11}+b_{11} & a_{12}+b_{12} & a_{13}+b_{13} \\ b_{21}+b_{21} & a_{22}+b_{22} & a_{23}+b_{23} \end{bmatrix}

Solution

The matrix for the total number of sales for each size of pizza at each store is: \begin{bmatrix} 28 & 36 & 32 \\ 25 & 27 & 24 \end{bmatrix}+\begin{bmatrix} 25 & 33 & 28 \\ 26 & 20 & 23 \end{bmatrix}=\begin{bmatrix} 53 & 69 & 60 \\ 51 & 47 & 47 \end{bmatrix}

Reflection

Notice that the position of the data has not changed in the resulting matrix.

  • Row 1 still corresponds to Store 1.

  • Row 2 still corresponds to Store 2.

  • Column 1 still corresponds to small pizzas.

  • Column 2 still corresponds to medium pizzas.

  • Column 3 still corresponds to large pizzas.

b

Identify the number of large pizzas that were sold at Store 2 over Monday and Tuesday.

Approach

In the previous part, we found the matrix whose entries represent the number of pizzas sold over Monday and Tuesday for each store and size.

'Store 2' corresponds to the second row of the matrix, and 'Large pizzas' correspond to the third column of the matrix. So we can find the answer at a_{23} in the matrix from part (c).

Solution

The matrix that shows the total sales over Monday and Tuesday is: \begin{bmatrix} 53 & 69 & 60 \\ 51 & 47 & 47 \end{bmatrix}.

For this matrix, a_{23}=47.

Therefore, 47 large pizzas were sold at Store 2 over Monday and Tuesday.

Example 2

Consider the following matrices:

A = \begin{bmatrix} 7 & 0 & -2 \\ -4 & 9 & -5 \end{bmatrix},\, B=\begin{bmatrix} 8 & -4 & 2 \\ -7 & 4 & 5 \end{bmatrix} \text{ and }C=\begin{bmatrix} 9 & 5 \\ -3 & 2 \\ 6 & -1 \end{bmatrix}

a

Find 3A.

Approach

To find the scalar product 3A we multiply each element of matrix A by 3.

Solution

\displaystyle A\displaystyle =\displaystyle \begin{bmatrix} 7 & 0 & -2 \\ -4 & 9 & -5 \end{bmatrix}Given
\displaystyle 3A\displaystyle =\displaystyle 3\begin{bmatrix} 7 & 0 & -2 \\ -4 & 9 & -5 \end{bmatrix}
\displaystyle \text{}\displaystyle =\displaystyle \begin{bmatrix} 3(7) & 3(0) & 3(-2) \\ 3(-4) & 3(9) & 3(-5) \end{bmatrix}Multiply each element in matrix A by 3
\displaystyle \text{}\displaystyle =\displaystyle \begin{bmatrix} 21 & 0 & -6 \\ -12 & 27 & -15 \end{bmatrix}Simplify the products
b

Find AB.

Approach

The product AB is defined only if the number of columns in the matrix A is equal to the number of rows in the matrix B.

Solution

The number of columns in A=\begin{bmatrix} 7 & 0 & -2 \\ -4 & 9 & -5 \end{bmatrix} is 3.

The number of rows in B=\begin{bmatrix} 8 & -4 & 2 \\ -7 & 4 & 5\end{bmatrix} is 2.

Since 2 \neq 3, the product AB is undefined.

c

Find AC.

Approach

The product AC is defined only if the number of columns in the matrix A is equal to the number of rows in the matrix C.

If A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \end{bmatrix} and C=\begin{bmatrix} c_{11} & c_{12} \\ c_{21} & c_{22} \\ c_{31} & c_{32} \end{bmatrix}, then AC = \begin{bmatrix} a_{11}c_{11}+a_{12}c_{21}+a_{13}c_{31} & a_{11}c_{12}+a_{12}c_{22}+a_{13}c_{32} \\ a_{21}c_{11}+a_{22}c_{21}+a_{23}c_{31} & a_{21}c_{12}+a_{22}c_{22}+a_{23}c_{32} \end{bmatrix}

Solution

The number of columns in A = \begin{bmatrix} 7 & 0 & -2 \\ -4 & 9 & -5 \end{bmatrix} is 4. The number of rows in C=\begin{bmatrix} 9 & 5 \\ -3 & 2 \\ 6 & -1 \end{bmatrix} is 4. Since they are equal, the product AC is defined.

\displaystyle AC\displaystyle =\displaystyle \begin{bmatrix} 7 & 0 & -2 \\ -4 & 9 & -5 \end{bmatrix}\begin{bmatrix} 9 & 5 \\ -3 & 2 \\ 6 & -1 \end{bmatrix}
\displaystyle =\displaystyle \begin{bmatrix} (7)(9)+(0)(-3)+(-2)(6)& ac_{12} \\ ac_{21} & ac_{22} \end{bmatrix}Multiply the first row of A by the first column of C. ac_{ij} is the element in AC in row i column j
\displaystyle =\displaystyle \begin{bmatrix} 51 & ac_{12} \\ ac_{21} & ac_{22} \end{bmatrix}Evaluate ac_{11}
\displaystyle =\displaystyle \begin{bmatrix} 51 & (7)(5)+(0)(2)+(-2)(-1) \\ ac_{21} & ac_{22} \end{bmatrix}Multiply the first row of A by the second column of C.
\displaystyle =\displaystyle \begin{bmatrix} 51 & 37 \\ ac_{21} & ac_{22} \end{bmatrix}Evaluate ac_{12}
\displaystyle =\displaystyle \begin{bmatrix} 51 & 37 \\ (-4)(9)+(9)(-3)+(-5)(6) & ac_{22} \end{bmatrix}Multiply the second row of A by the first column of C.
\displaystyle =\displaystyle \begin{bmatrix} 51 & 37 \\ -93 & ac_{22} \end{bmatrix}Evaluate ac_{21}
\displaystyle =\displaystyle \begin{bmatrix} 51 & 37 \\ -93 & (-4)(5)+(9)(2)+(-5)(-1) \end{bmatrix}Multiply the second row of A by the second column of C.
\displaystyle =\displaystyle \begin{bmatrix} 51 & 37 \\ -93 & 3 \end{bmatrix}Evaluate ac_{22}

Outcomes

MA.912.NSO.4.1

Given a mathematical or real-world context, represent and manipulate data using matrices.

MA.912.NSO.4.2

Given a mathematical or real-world context, represent and solve a system of two- or three-variable linear equations using matrices.

MA.912.NSO.4.3

Solve mathematical and real-world problems involving addition, subtraction and multiplication of matrices.

What is Mathspace

About Mathspace