Algebra 2 by Richard Wright

Previous LessonTable of Contents Next Lesson

Are you not my student and
has this helped you?

1-05 Multiply Matrices (12.2)

Mr. Wright teaches the lesson.

Objectives:

SDA NAD Content Standards (2018): AII.4.1

Figure 1: Spaghetti. (Pixabay/Divily)

Matrix multiplication can be used to calculate costs for several people. One matrix would contain quantity of items purchased and the second matrix would contain the cost of each item. Multiplying the matrices gives a matrix of total costs. See the example at the end of the lesson.

The last lesson was all about matrices and how to add and subtract them. But how do you multiply or divide matrices? This lesson is about multiplying matrices, but not dividing. It turns out, that division by a matrix is undefined.

Matrix Multiplication

Matrix multiplication can only happen if the number of columns of the first matrix is the same as the number of rows on the second matrix. If the dimensions of the matrices are written side by side, the middle numbers need to be the same. It is possible to multiply a 3×5 matrix with a 5×2 matrix.

5 · 5×2 Notice the middle numbers are the same.

The outer numbers will be the dimensions of the product. So, 3×2 will be the dimensions of the product.

Because of this, order does matter! Matrix multiplication does NOT have the commutative property. The first matrix must be first and the second matrix must be second.

Matrix Multiplication

To multiply two matrices,

  1. Verify that the number of columns in the first matrix equals the number of rows in the second matrix.
  2. Choose a row in the first matrix and a column in the second matrix.
  3. Multiply the first entries in that row and column.
  4. Put a plus sign and multiply the second entries in that row and column.
  5. Continue adding plus signs and the products of the entries in that row and column until the end of the row and column is reached.
  6. Repeat steps 2-5 for all combinations of rows and columns. The results go in the answer matrix in the same location as the chosen row and column. For example, multiplying the 2nd row and 1st column gives a result for the element in the 2nd row 1st column of the answer matrix.
  7. Simplify each element of the answer.

Example 1

Simplify \(\left[\begin{matrix}2&-1\\3&0\end{matrix}\right]\left[\begin{matrix}-2&4\\-3&5\end{matrix}\right]\).

Solution

This a 2×2 · 2×2. The middle numbers are the same, so the number of columns of the first matrix equals the number of rows of the second matrix. They can be multiplied.

Choose a row and column such as the 1st row and 1st column.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}2&-1\end{matrix}$} \\ \begin{matrix}3&0\end{matrix} \end{matrix}\right]\left[\begin{matrix}\fbox{$\begin{matrix}-2\\-3\\\end{matrix}$}&\begin{matrix}4\\5\end{matrix}\end{matrix}\right] $$

Multiply the first elements of that row and column. It goes in the 1st row 1st column of the answer.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}\mathbf{2}&-1\end{matrix}$} \\ \begin{matrix}3&0\end{matrix}\end{matrix}\right]\left[\begin{matrix}\fbox{$\begin{matrix}-\mathbf{2}\\-3 \end{matrix}$}&\begin{matrix}4\\5\end{matrix} \end{matrix}\right]=\left[\begin{matrix}-4&\\& \end{matrix}\right] $$

Put a + and multiply the second elements of that row and column.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}2&-\mathbf{1}\end{matrix}$} \\ \begin{matrix}3&0\end{matrix} \end{matrix}\right]\left[\begin{matrix}\fbox{$\begin{matrix}-2\\-\mathbf{3} \end{matrix}$}&\begin{matrix}4\\5 \end{matrix} \end{matrix}\right]=\left[\begin{matrix}-4+\mathbf{3}&\\&\\\end{matrix}\right] $$

That is the end of that row and column, so choose another row and column such as 1st row and 2nd column.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}2&-1\end{matrix}$} \\ \begin{matrix}3&0\end{matrix} \end{matrix}\right]\left[\begin{matrix}\begin{matrix}-2\\-3\end{matrix}&\fbox{$\begin{matrix}4\\5\end{matrix}$} \end{matrix}\right]=\left[\begin{matrix}-4+3&\\&\end{matrix}\right] $$

Multiply the first elements of that row and column. The product goes in the 1st row 2nd column of the answer.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}\mathbf{2}&-1 \end{matrix}$} \\ \begin{matrix}3&0 \end{matrix} \end{matrix}\right]\left[\begin{matrix}\begin{matrix}-2\\-3 \end{matrix}&\fbox{$\begin{matrix}\mathbf{4}\\5 \end{matrix}$} \end{matrix}\right]=\left[\begin{matrix}-4+3&\mathbf{8}\\& \end{matrix}\right] $$

Put a + and multiply the second elements of that row and column.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}2&-\mathbf{1}\\\end{matrix}$}\\\begin{matrix}3&0\\\end{matrix}\\\end{matrix}\right]\left[\begin{matrix}\begin{matrix}-2\\-3\\\end{matrix}&\fbox{$\begin{matrix}4\\\mathbf{5}\\\end{matrix}$}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+(-\mathbf{5})\\&\\\end{matrix}\right] $$

That is the end of that row and column, so choose another row and column such as 2nd row and 1st column.

$$ \left[\begin{matrix}\begin{matrix}2&-1\\\end{matrix}\\\fbox{$\begin{matrix}3&0\\\end{matrix}$}\\\end{matrix}\right]\left[\begin{matrix}\fbox{$\begin{matrix}-2\\-3\\\end{matrix}$}&\begin{matrix}4\\5\\\end{matrix}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+\left(-5\right)\\&\\\end{matrix}\right] $$

Multiply the first elements of that row and column. The product goes in the 1st row 2nd column of the answer.

$$ \left[\begin{matrix}\begin{matrix}2&-1\\\end{matrix}\\\fbox{$\begin{matrix}\mathbf{3}&0\\\end{matrix}$}\\\end{matrix}\right]\left[\begin{matrix}\fbox{$\begin{matrix}-\mathbf{2}\\-3\\\end{matrix}$}&\begin{matrix}4\\5\\\end{matrix}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+\left(-5\right)\\-\mathbf{6}&\\\end{matrix}\right] $$

Put a + and multiply the second elements of that row and column.

$$ \left[\begin{matrix}\begin{matrix}2&-1\\\end{matrix}\\\fbox{$\begin{matrix}3&\mathbf{0}\\\end{matrix}$}\\\end{matrix}\right]\left[\begin{matrix}\fbox{$\begin{matrix}-2\\-\mathbf{3}\\\end{matrix}$}&\begin{matrix}4\\5\\\end{matrix}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+\left(-5\right)\\-6+\mathbf{0}&\\\end{matrix}\right] $$

That is the end of that row and column, so choose another row and column such as 2nd row and 2nd column.

$$ \left[\begin{matrix}\begin{matrix}2&-1\\\end{matrix}\\\fbox{$\begin{matrix}3&0\\\end{matrix}$}\\\end{matrix}\right]\left[\begin{matrix}\begin{matrix}-2\\-3\\\end{matrix}&\fbox{$\begin{matrix}4\\5\\\end{matrix}$}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+\left(-5\right)\\-6+0&\\\end{matrix}\right] $$

Multiply the first elements of that row and column. The product goes in the 1st row 2nd column of the answer.

$$ \left[\begin{matrix}\begin{matrix}2&-1\\\end{matrix}\\\fbox{$\begin{matrix}\mathbf{3}&0\\\end{matrix}$}\\\end{matrix}\right]\left[\begin{matrix}\begin{matrix}-2\\-3\\\end{matrix}&\fbox{$\begin{matrix}\mathbf{4}\\5\\\end{matrix}$}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+\left(-5\right)\\-6+0&\mathbf{12}\\\end{matrix}\right] $$

Put a + and multiply the second elements of that row and column.

$$ \left[\begin{matrix}\begin{matrix}2&-1\\\end{matrix}\\\fbox{$\begin{matrix}3&\mathbf{0}\\\end{matrix}$}\\\end{matrix}\right]\left[\begin{matrix}\begin{matrix}-2\\-3\\\end{matrix}&\fbox{$\begin{matrix}4\\\mathbf{5}\\\end{matrix}$}\\\end{matrix}\right]=\left[\begin{matrix}-4+3&8+\left(-5\right)\\-6+0&12+\mathbf{0}\\\end{matrix}\right] $$

That is the end of that row and column. It is also the end of all the combinations of a row of the first matrix and a column of the second matrix. Now just simplify the elements of the answer.

$$ =\left[\begin{matrix}-1&3\\-6&12\\\end{matrix}\right] $$

Example 2

Simplify \(\left[\begin{matrix}1&-2&0\\-1&4&5\\\end{matrix}\right]\left[\begin{matrix}3\\-5\\1\\\end{matrix}\right]\).

Solution

This a 2×3 · 3×1. The middle numbers are the same, so the number of columns of the first matrix equals the number of rows of the second matrix. They can be multiplied. The result will be a 2×1 matrix.

Choose a row and column such as the 1st row and 1st column and multiply them. The result goes in the 1st row 1st column.

$$ \left[\begin{matrix}\fbox{$\begin{matrix}1&-2&0\\\end{matrix}$}\\\begin{matrix}-1&4&5\\\end{matrix}\\\end{matrix}\right]\left[\fbox{$\begin{matrix}3\\-5\\1\\\end{matrix}$}\right]=\left[\begin{matrix}3+10+0\\\\\end{matrix}\right] $$

Choose another row and column such as the 2nd row and 1st column and multiply them. The result goes in the 2nd row 1st column.

$$ \left[\begin{matrix}\begin{matrix}1&-2&0\\\end{matrix}\\\fbox{$\begin{matrix}-1&4&5\\\end{matrix}$}\\\end{matrix}\right]\left[\fbox{$\begin{matrix}3\\-5\\1\\\end{matrix}$}\right]=\left[\begin{matrix}3+10+0\\-3+\left(-20\right)+5\\\end{matrix}\right] $$

That is the end of all the combinations of a row of the first matrix and a column of the second matrix. Now just simplify the elements of the answer.

$$ =\left[\begin{matrix}13\\-18\\\end{matrix}\right] $$

Example 3

Use the given matrices to evaluate (AB) − 2C.

$$ A=\left[\begin{matrix}1&4\\-2&-1\\\end{matrix}\right],\ B=\left[\begin{matrix}5\\3\\\end{matrix}\right],\ C=\left[\begin{matrix}0\\7\\\end{matrix}\right] $$

Solution

Substitute the matrices into the equation.

$$ \left(\left[\begin{matrix}1&4\\-2&-1\\\end{matrix}\right]\left[\begin{matrix}5\\3\\\end{matrix}\right]\right)-2\left[\begin{matrix}0\\7\\\end{matrix}\right] $$

Order of operations says groups first, so multiply the two matrices in parentheses.

$$ \left(\left[\begin{matrix} 1· 5+4·3 \\ (-2)·5+(-1)·3 \end{matrix} \right]\right) -2 \left[\begin{matrix} 0 \\ 7 \end{matrix} \right] $$

$$ \left[\begin{matrix}17\\-13\\\end{matrix}\right]-2\left[\begin{matrix}0\\7\\\end{matrix}\right] $$

Next do the scalar multiplication because multiplication comes before subtraction.

$$ \left[\begin{matrix}17\\-13\\\end{matrix}\right]-\left[\begin{matrix}0\\14\\\end{matrix}\right] $$

Finally, subtract.

$$ \left[\begin{matrix}17\\-27\\\end{matrix}\right] $$

Example 4

The members of two bowling leagues submit meal choices for an upcoming banquet as shown. Each pizza meal costs $12, each spaghetti meal costs $15, and each Sam's chicken meal costs $20. Use matrix multiplication to find the total cost of the meals for each league.

PizzaSpaghettiSam's Chicken
League A1962
League B1091

Solution

Write the table of purchases as a matrix and multiply it by a price matrix.

$$ \left[\begin{matrix}19&6&2\\10&9&1\\\end{matrix}\right]\left[\begin{matrix}12\\15\\20\\\end{matrix}\right] $$

$$ \left[\begin{matrix}19·12+6·15+2·20 \\ 10·12+9·15+1·20 \end{matrix}\right] $$

$$ \left[\begin{matrix}358\\275\\\end{matrix}\right] $$

League A: $358, League B: $275

Practice Problems

Page 658 #1, 5, 7, 9, 11, 13, 15, 17, 21, 23, 25, 29, 35, 39, 41, and Mixed Review = 20

    Mixed Review

  1. (1-04) Simplify \(\left[\begin{matrix}3&8\\\end{matrix}\right]-\left[\begin{matrix}-1&0\\\end{matrix}\right]\).
  2. (1-04) Simplify \( 2\left[\begin{matrix}3\\0\\\end{matrix}\right]+3\left[\begin{matrix}-1\\5\\\end{matrix}\right]\).
  3. (1-02) Solve algebraically \(\left\{ \begin{alignat}{3} 2x&-&y&=&4 \\ -6x&+&3y&=&1 \end{alignat} \right.\).
  4. (1-01) Solve by graphing \(\left\{\begin{align} y& < 2x+1 \\ y& ≤ -2x-1 \end{align}\right.\).
  5. (0-04) Write the equation of the line with slope −3 and passes through (2, −5).

Answers

  1. \(\left[\begin{matrix}4&8\\\end{matrix}\right]\)
  2. \(\left[\begin{matrix}3\\15\\\end{matrix}\right]\)
  3. No solution
  4. y = −3x + 1