<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# Limitations of Matrix Multiplication

## Number of columns must match number of rows to multiply matrices

Estimated7 minsto complete
%
Progress
Practice Limitations of Matrix Multiplication

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated7 minsto complete
%
Limitations of Matrix Multiplication

Mr. Hwan writes the following matrix on the board and asks his students to write down a matrix that they could multiply this matrix by.

324103\begin{align*}\begin{bmatrix} -3 & 1\\ 2 & 0\\ 4 & -3 \end{bmatrix}\end{align*}

Wanda writes the matrix 150232\begin{align*}\begin{bmatrix} -1 & 2\\ 5 & 3\\ 0 & -2 \end{bmatrix}\end{align*}

Xavier writes the matrix [2731]\begin{align*}\begin{bmatrix} 2 & -3\\ 7 & 1 \end{bmatrix}\end{align*}

Zach writes the matrix [481503]\begin{align*}\begin{bmatrix} -4 & 1 & 0\\ 8 & 5 & -3 \end{bmatrix}\end{align*}

"One of you has made a mistake," Mr. Hwan says. Who made the mistake?

### Limitations to Matrix Multiplication

Matrix multiplication has some limitations, which you will discover in this section.

Note the dimensions of the following matrices. Attempt to multiply the matrices together. What do you notice?

1. [2135][14]\begin{align*}\begin{bmatrix} -2 & 3\\ 1 & -5 \end{bmatrix}\cdot\begin{bmatrix} 1 & -4\end{bmatrix}\end{align*}

2. 235410\begin{align*}\begin{bmatrix} -2\\ 3\\ 5\end{bmatrix}\cdot\begin{bmatrix} 4\\ -1\\ 0\end{bmatrix}\end{align*}

3. [51][3413]\begin{align*}\begin{bmatrix} 5\\ -1\end{bmatrix}\cdot\begin{bmatrix} -3 & 1\\ 4 & 3\end{bmatrix}\end{align*}

1. These matrices are 2×2\begin{align*}2 \times 2\end{align*} and 1×2\begin{align*}1 \times 2\end{align*}. When we try to multiply them together, there is no element to multiply the values in the second column by as shown below:

[2135][14]=[2(1)+3(?)1(1)+5(?)2(4)+3(?)1(4)+5(?)]\begin{align*}\begin{bmatrix} -2 & 3\\ 1 & -5\end{bmatrix}\cdot\begin{bmatrix} 1 & -4\end{bmatrix} = \begin{bmatrix} -2(1)+3(?) & -2(-4)+3(?)\\ 1(1)+-5(?) & 1(-4)+-5(?)\end{bmatrix}\end{align*}

2. These matrices are both 3×1\begin{align*}3 \times 1\end{align*}. Look what happens when we attempt to multiply:

235410=2(4)+?(1)+?(0) \begin{align*}\begin{bmatrix} -2\\ 3\\ 5\end{bmatrix}\cdot\begin{bmatrix} 4\\ -1\\ 0\end{bmatrix} = \begin{bmatrix} -2(4)+?(-1)+?(0) & \ \\ \\ \\ \end{bmatrix}\end{align*}

We can see right away that we have a problem.

3. In this case we have a 2×1\begin{align*}2 \times 1\end{align*} and a 2×2\begin{align*}2 \times 2\end{align*} matrix. Again we have trouble multiplying:

[51][3412]=[5(3)+?(4)]\begin{align*}\begin{bmatrix} 5\\ -1\end{bmatrix}\cdot\begin{bmatrix} -3 & 1\\ 4 & 2\end{bmatrix} = \begin{bmatrix} 5(-3)+?(4) & \\ \\ \end{bmatrix}\end{align*}

Therefore, in order to multiply two matrices, A\begin{align*}A\end{align*} and B\begin{align*}B\end{align*}, the number of columns in matrix A\begin{align*}A\end{align*} must be equal to the number of rows in column B.

What do you notice about the dimensions of the two matrices when multiplication is possible? Can you make a conjecture about the requirements of the dimensions of the matrices?

Look at this example: [2135][41].\begin{align*}\begin{bmatrix} -2 & 3\\ 1 & 5\end{bmatrix}\cdot\begin{bmatrix} 4\\ -1\end{bmatrix}.\end{align*} In this case we have 2×22×1\begin{align*}2 \times {\color{red}2} \cdot {\color{red}2} \times 1\end{align*}. The two two’s in the middle are the same (i.e., the number of columns in the first matrix matches the number of rows in the second matrix). Now what is left is the 2 on the left and the 1 on the right. The resulting matrix will have these dimensions: 2×1\begin{align*}2 \times 1\end{align*}.

Dimensions of the Product: The product of two matrices, A\begin{align*}A\end{align*} and B\begin{align*}B\end{align*}, will have the following dimensions – the rows in matrix A\begin{align*}A\end{align*} by the columns in matrix B\begin{align*}B\end{align*}.

Let's use the following matrices to answer the problems below.

A=[2153], B=[1035]\begin{align*}A = \begin{bmatrix} -2 & 5\\ 1 & 3\end{bmatrix}, \ B = \begin{bmatrix} 1 & 3\\ 0 & -5\end{bmatrix}\end{align*}

1. Find AB\begin{align*}AB\end{align*}: [2153][1035]=[2+01+0625315]=[213112]\begin{align*}\begin{bmatrix} -2 & 5\\ 1 & 3\end{bmatrix}\cdot\begin{bmatrix} 1 & 3\\ 0 & -5\end{bmatrix} = \begin{bmatrix} -2+0 & -6-25\\ 1+0 & 3-15\end{bmatrix} = \begin{bmatrix} -2 & -31\\ 1 & -12\end{bmatrix}\end{align*}

2. Find BA\begin{align*}BA\end{align*}: [1035][2153]=[2+3055+9015]=[151415]\begin{align*}\begin{bmatrix} 1 & 3\\ 0 & -5\end{bmatrix}\cdot\begin{bmatrix} -2 & 5\\ 1 & 3\end{bmatrix} = \begin{bmatrix} -2+3 & 5+9\\ 0-5 & 0-15\end{bmatrix} = \begin{bmatrix} 1 & 14\\ -5 & -15\end{bmatrix}\end{align*}

From this exercise we can see that ABBA\begin{align*}AB \ne BA\end{align*}. We only need one example to show that the commutative property does not hold for matrix multiplication.

Matrix multiplication is NOT commutative.

1. Which of the following matrix multiplication problems are possible? What are the dimensions of the product?

521[073]\begin{align*}\begin{bmatrix} 5\\ -2\\ 1\end{bmatrix}\cdot\begin{bmatrix} 0 & -7 & 3\end{bmatrix}\end{align*}

Yes, the matrices can be multiplied. The dimensions of the matrices are 3×1 and 1×3\begin{align*}3 \times {\color{red}1} \ {\color{red}\text{and}} \ {\color{red}1} \times 3\end{align*}, so the result is going to be a 3×3\begin{align*}3 \times 3\end{align*} matrix.

[4213][80]\begin{align*}\begin{bmatrix} 4 & -1\\ 2 & 3\end{bmatrix}\cdot\begin{bmatrix} -8\\ 0\end{bmatrix}\end{align*}

Yes, the matrices can be multiplied. The dimensions of the matrices are 2×2 and 2×1\begin{align*}2 \times {\color{red}2} \ {\color{red}\text{and}} \ {\color{red}2} \times 1\end{align*}, so the result is going to be a 2×1\begin{align*}2 \times 1\end{align*} matrix.

1. Which of the following matrix multiplication problems are possible? What are the dimensions of the product?

[13][41]\begin{align*}\begin{bmatrix} 1 & -3\end{bmatrix}\cdot\begin{bmatrix} 4\\ -1\end{bmatrix}\end{align*}

Yes, the matrices can be multiplied. The dimensions of the matrices are 1×2 and 2×1\begin{align*}1 \times {\color{red}2} \ {\color{red}\text{and}} \ {\color{red}2}\times 1\end{align*}, so the result is going to be a 1×1\begin{align*}1 \times 1\end{align*} matrix.

[25][31]\begin{align*}\begin{bmatrix} 2 & -5\end{bmatrix}\cdot\begin{bmatrix} -3 & 1\end{bmatrix}\end{align*}

No, the matrices cannot be multiplied. The dimensions of the matrices are 1×2 and 1×2\begin{align*}1 \times {\color{red}2} \ {\color{red}\text{and}} \ {\color{red}1} \times 2\end{align*}, the number of columns in the first matrix does not match the number of rows in the second matrix.

1. Given the matrices: A=[231085]\begin{align*}A = \begin{bmatrix} 2 & -1 & 8\\ 3 & 0 & -5\end{bmatrix}\end{align*} and B=125046,\begin{align*}B = \begin{bmatrix} -1 & 0\\ 2 & 4\\ 5 & 6\end{bmatrix},\end{align*} find AB\begin{align*}AB\end{align*} and BA\begin{align*}BA\end{align*}. What do you notice?

AB=[231085]125046=[2(1)+(1)(2)+8(5)3(1)+(0)(2)+(5)(5)2(0)+(1)(4)+8(6)3(0)+(0)(4)+(5)(6)]=[22+403+02504+480+030]=[36284430]\begin{align*}AB = \begin{bmatrix} 2 & -1 & 8\\ 3 & 0 & -5\end{bmatrix}\cdot\begin{bmatrix} -1 & 0\\ 2 & 4\\ 5 & 6\end{bmatrix} &= \begin{bmatrix} 2(-1)+(-1)(2)+8(5) & 2(0)+(-1)(4)+8(6)\\ 3(-1)+(0)(2)+(-5)(5) & 3(0)+(0)(4)+(-5)(6)\end{bmatrix}\\ &= \begin{bmatrix} -2-2+40 & 0-4+48\\ -3+0-25 & 0+0-30\end{bmatrix} = \begin{bmatrix} 36 & 44\\ -28 & -30\end{bmatrix}\end{align*}

BA=125046[231085]=1(2)+0(3)2(2)+4(3)5(2)+6(3)1(1)+0(0)2(1)+4(0)5(1)+6(0)1(8)+0(5)2(8)+4(5)5(8)+6(5)=2+04+1210+181+02+05+08016204030=216281258410\begin{align*}BA = \begin{bmatrix} -1 & 0\\ 2 & 4\\ 5 & 6\end{bmatrix}\cdot\begin{bmatrix} 2 & -1 & 8\\ 3 & 0 & -5\end{bmatrix} &= \begin{bmatrix} -1(2)+0(3) & -1(-1)+0(0) & -1(8)+0(-5)\\ 2(2)+4(3) & 2(-1)+4(0) & 2(8)+4(-5)\\ 5(2)+6(3) & 5(-1)+6(0) & 5(8)+6(-5)\end{bmatrix}\\ &= \begin{bmatrix} -2+0 & 1+0 & -8-0\\ 4+12 & -2+0 & 16-20\\ 10+18 & -5+0 & 40-30\end{bmatrix} = \begin{bmatrix} -2 & 1 & -8\\ 16 & -2 & -4\\ 28 & -5 & 10\end{bmatrix}\end{align*}

The dimensions of the products are different based on the order in which we multiply them. Clearly, the results are different and the commutative property does not hold for matrix multiplication.

### Examples

#### Example 1

Earlier, you were asked to find the student that made the mistake.

Mr. Hwan's matrix is a 3 x 2 matrix. To multiply it by another matrix, that other matrix must be a 2 x ? matrix, where ? can be any number.

Wanda writes a 3 x 2 matrix, so she is wrong.

Xavier writes a 2 x 2 matrix, so he is correct.

Zach writes a 2 x 3 matrix, so he is correct.

Given: A=[15314],B=[21],C=[14531],\begin{align*}A = \begin{bmatrix} 1 & -3\\ 5 & -14\end{bmatrix}, \qquad B = \begin{bmatrix} -2\\ 1\end{bmatrix}, \qquad C = \begin{bmatrix} -14 & 3\\ -5 & 1\end{bmatrix},\end{align*} find the following products, if possible.

#### Example 2

AB\begin{align*}AB\end{align*}
\begin{align*}AB = \begin{bmatrix} 1 & -3\\ 5 & -14\end{bmatrix}\cdot\begin{bmatrix} -2\\ 1\end{bmatrix} = \begin{bmatrix} 1(-2)+-3(1)\\ 5(-2)+-14(1)\end{bmatrix} = \begin{bmatrix} -2-3\\ -10-14\end{bmatrix} = \begin{bmatrix} -5\\ -24\end{bmatrix}\end{align*}

#### Example 3

\begin{align*}BA\end{align*}
\begin{align*}BA = \begin{bmatrix} -2\\ 1\end{bmatrix}\cdot\begin{bmatrix} 1 & -3\\ 5 & -14\end{bmatrix}\end{align*} is not possible.

#### Example 4

\begin{align*}AC\end{align*}

\begin{align*}AC = \begin{bmatrix} 1 & -3\\ 5 & -14\end{bmatrix}\cdot\begin{bmatrix} -14 & 3\\ -5 & 1\end{bmatrix} = \begin{bmatrix} 1(-14)+(-3)(-5) & 1(3)+(-3)(1)\\ 5(-14)+(-14)(-5) & 5(3)+(-14)(1)\end{bmatrix} = \begin{bmatrix} -14+15 & 3-3\\ -70+70 & 15-14\end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}\end{align*}

#### Example 5

\begin{align*}CA\end{align*}

\begin{align*}CA = \begin{bmatrix} -14 & 3\\ -5 & 1\end{bmatrix}\cdot\begin{bmatrix} 1 & -3\\ 5 & -14\end{bmatrix} = \begin{bmatrix} -14(1)+3(5) & -14(-3)+3(-14)\\ -5(1)+1(5) & -5(-3)+1(-14)\end{bmatrix} = \begin{bmatrix} -14+15 & 52-52\\ -5+5 & 15-14\end{bmatrix} = \begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix}\end{align*}

\begin{align*}^{**}\end{align*}Note: When the product is \begin{align*}\begin{bmatrix} 1 & 0\\ 0 & 1\end{bmatrix},\end{align*} the identity matrix for a \begin{align*}2 \times 2\end{align*} matrix, the product can be found by multiplying the matrices in either order as illustrated here in questions 3 and 4. If the product of two matrices is the inverse matrix, then the matrices are multiplicative inverses of one another. This idea is further explored in other matrix concepts.

### Review

Use the following matrices to answer questions 1-10.

\begin{align*}A = \begin{bmatrix} 2 & -1 & 4\end{bmatrix} \qquad B = \begin{bmatrix} -3\\ 5\\ 0\end{bmatrix} \qquad C = \begin{bmatrix} 4 & -1\\ 2 & 5\end{bmatrix} \qquad D = \begin{bmatrix} 3 & -2\end{bmatrix}\end{align*}

\begin{align*}E = \begin{bmatrix} 8 & -1 & 0\\ 2 & 5 & 1\\ 3 & 4 & -3\end{bmatrix} \qquad F = \begin{bmatrix} 5 & 0 & -11\\ -1 & 8 & 9\end{bmatrix}\end{align*}

For each product, determine the dimensions of the resulting matrix or write “cannot be determined”. Do not multiply the matrices together.

1. \begin{align*}AB\end{align*}
2. \begin{align*}BA\end{align*}
3. \begin{align*}CD\end{align*}
4. \begin{align*}DC\end{align*}
5. \begin{align*}EA\end{align*}
6. \begin{align*}EB\end{align*}
7. \begin{align*}CF\end{align*}
8. \begin{align*}FC\end{align*}
9. \begin{align*}DF\end{align*}
10. \begin{align*}BD\end{align*}

Perform the multiplication if possible. If not possible, write “cannot be determined”.

1. .
\begin{align*}\begin{bmatrix} 2 & -1\\ -4 & 8\end{bmatrix}\cdot\begin{bmatrix} 5\\ -3\end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 5 & -2\\ 3 & 7\\ -4 & 1\end{bmatrix}\cdot\begin{bmatrix} 5 & -2 & 3\\ 7 & -4 & 1\end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 5 & -3\end{bmatrix}\cdot\begin{bmatrix} -4 & 2\end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 5 & -1 & 3\end{bmatrix}\cdot\begin{bmatrix} -4\\ 7\\ 11\end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 5 & 2\\ -3 & 1\end{bmatrix}\cdot\begin{bmatrix} 4 & -7\end{bmatrix}\end{align*}
1. .
\begin{align*}\begin{bmatrix} 2 & -5\end{bmatrix}\cdot\begin{bmatrix} 1 & 0\\ -3 & 4\end{bmatrix}\end{align*}
1. Challenge Problem
1. Find \begin{align*}\begin{bmatrix} 5 & 3\\ 8 & 5\end{bmatrix}\cdot\begin{bmatrix} 5 & -3\\ -8 & 5\end{bmatrix}\end{align*}
2. What is the name of the product matrix?
3. Can you find \begin{align*}\begin{bmatrix} 5 & -3\\ -8 & 5\end{bmatrix}\cdot\begin{bmatrix} 5 & 3\\ 8 & 5\end{bmatrix}\end{align*} without actually multiplying?
4. What can you conclude about the two matrices in part a?

To see the Review answers, open this PDF file and look for section 4.5.

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes