<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />
You are viewing an older version of this Concept. Go to the latest version.

# Limitations of Matrix Multiplication

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

Estimated5 minsto complete
%
Progress
Practice Limitations of Matrix Multiplication
Progress
Estimated5 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.

$\begin{bmatrix}-3 & 1\\2 & 0\\4 & -3 \end{bmatrix}$

Wanda writes the matrix $\begin{bmatrix}-1 & 2\\5 & 3\\0 & -2 \end{bmatrix}$ .

Xavier writes the matrix $\begin{bmatrix}2 & -3\\7 & 1 \end{bmatrix}$ .

Zach writes the matrix $\begin{bmatrix}-4 & 1 & 0\\8 & 5 & -3 \end{bmatrix}$ .

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

### Guidance

Matrix multiplication has some limitations which you will discover in the following investigation.

#### Investigation: Limitations to Matrix Multiplication

Part 1:

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

1. $\begin{bmatrix}-2 & 3\\1 & -5 \end{bmatrix}\cdot\begin{bmatrix}1 & -4\end{bmatrix}$

2. $\begin{bmatrix}-2\\3\\5\end{bmatrix}\cdot\begin{bmatrix}4\\-1\\0\end{bmatrix}$

3. $\begin{bmatrix}5\\-1\end{bmatrix}\cdot\begin{bmatrix}-3 & 1\\4 & 3\end{bmatrix}$

1. These matrices are $2 \times 2$ and $1 \times 2$ . When we try to multiply them together, there is no element to multiply the values in the second column by as shown below:

$\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}$

2. These matrices are both $3 \times 1$ . Look what happens when we attempt to multiply:

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

We can see right away that we have a problem.

3. In this case we have a $2 \times 1$ and a $2 \times 2$ matrix. Again we have trouble multiplying:

$\begin{bmatrix}5\\-1\end{bmatrix}\cdot\begin{bmatrix}-3 & 1\\4 & 2\end{bmatrix} = \begin{bmatrix}5(-3)+?(4) & \\\\\end{bmatrix}$

Requirement: In order to multiply two matrices, $A$ and $B$ , the number of columns in matrix $A$ must be equal to the number of rows in column B.

Now, look back at some of the problems in the last concept, Multiplying Matrices . 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: $\begin{bmatrix}-2 & 3\\1 & 5\end{bmatrix}\cdot\begin{bmatrix}4\\-1\end{bmatrix}.$ In this case we have $2 \times {\color{red}2} \cdot {\color{red}2} \times 1$ . 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 \times 1$ .

Dimensions of the Product: The product of two matrices, $A$ and $B$ , will have the following dimensions – the rows in matrix $A$ by the columns in matrix $B$ .

Part 2:

Use the following matrices for this exercise:

$A = \begin{bmatrix}-2 & 5\\1 & 3\end{bmatrix}, \ B = \begin{bmatrix}1 & 3\\0 & -5\end{bmatrix}$

1. Find $AB$ : $\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}$

2. Find $BA$ : $\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}$

From this exercise we can see that $AB \ne BA$ . We only need one example to show that the commutative property does not hold for matrix multiplication.

Matrix multiplication is NOT commutative.

#### Example A

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

(a) $\begin{bmatrix}5\\-2\\1\end{bmatrix}\cdot\begin{bmatrix}0 & -7 & 3\end{bmatrix}$

(b) $\begin{bmatrix}4 & -1\\2 & 3\end{bmatrix}\cdot\begin{bmatrix}-8\\0\end{bmatrix}$

Solution:

(a) Yes, the matrices can be multiplied. The dimensions of the matrices are $3 \times {\color{red}1} \ {\color{red}\text{and}} \ {\color{red}1} \times 3$ , so the result is going to be a $3 \times 3$ matrix.

(b) Yes, the matrices can be multiplied. The dimensions of the matrices are $2 \times {\color{red}2} \ {\color{red}\text{and}} \ {\color{red}2} \times 1$ , so the result is going to be a $2 \times 1$ matrix.

#### Example B

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

(a) $\begin{bmatrix}1 & -3\end{bmatrix}\cdot\begin{bmatrix}4\\-1\end{bmatrix}$

(b) $\begin{bmatrix}2 & -5\end{bmatrix}\cdot\begin{bmatrix}-3 & 1\end{bmatrix}$

Solution:

(a) Yes, the matrices can be multiplied. The dimensions of the matrices are $1 \times {\color{red}2} \ {\color{red}\text{and}} \ {\color{red}2}\times 1$ , so the result is going to be a $1 \times 1$ matrix.

(b) No, the matrices cannot be multiplied. The dimensions of the matrices are $1 \times {\color{red}2} \ {\color{red}\text{and}} \ {\color{red}1} \times 2$ , the number of columns in the first matrix does not match the number of rows in the second matrix.

#### Example C

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

Solution:

$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}$

$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}$

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.

Intro Problem Revisit 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.

### Guided Practice

Given: $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},$ find the products, if possible.

1. $AB$

2. $BA$

3. $AC$

4. $CA$

1. $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}$

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

3. $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}$

4. $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}$

$^{**}$ Note: When the product is $\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix},$ the identity matrix for a $2 \times 2$ 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.

### Practice

Use the following matrices to answer questions 1-10.

$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}$

$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}$

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

1. $AB$
2. $BA$
3. $CD$
4. $DC$
5. $EA$
6. $EB$
7. $CF$
8. $FC$
9. $DF$
10. $BD$

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

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