topic badge
AustraliaVIC
VCE 11 General 2023

6.05 Matrix multiplication

Lesson

Matrix multiplication

Two matrices can be multiplied if the number of columns in the first matrix is equal to the number of rows in the second.

If matrix A has dimension m \times n and matrix B as dimension a\times b then the multiplication is defined (possible) if n=a and the dimension of the result C=AB will be m \times b. This is shown in the following diagram:

Multiplication of matrices A and B where their product is matrix C. Ask your teacher for more information.

If the dimensions do not meet this criteria then we say that the matrix multiplication is undefined (not possible).

For example consider the following matrices A, B and C where A=\begin{bmatrix} a&b\\ c&d \end{bmatrix}, B=\begin{bmatrix} e\\ f \end{bmatrix}, C=\begin{bmatrix} g&h \end{bmatrix}

A is a 2\times 2 matrix, B is a 2\times 1 matrix and C is a 1\times 2 matrix.

  • A\times B is a (2\times 2)\times (2\times 1) this is defined and the result would be a 2\times 1 matrix.

  • B\times C is a (2\times 1)\times (1\times 2) this is defined and the result would be a 2\times 2 matrix.

  • A\times C is a (2\times 2)\times (1\times 2) this is undefined.

Unlike matrix addition and subtraction, matrix multiplication is not computed element by element.

Let's look at an example of multiplication before we generalise the result.

Multiplying the first row of a matrix by the first column of another. Ask your teacher for more information.

If we take the elements in the first row, and multiply them by the elements in the first column, then sum them up then we end up with the a number that belongs in the spot occupying the first row and first column.

So 5\times 6+12\times 1+56\times 7=434 goes into the (1,1) entry: \begin{bmatrix} 5&12&56\\ 10&30&75\\ \end{bmatrix} \begin{bmatrix} 6&3\\ 1&2\\ 7&2 \end{bmatrix} = \begin{bmatrix} 434&.\\ .&. \end{bmatrix}

Multiplying the first row of a matrix by the second column of another. Ask your teacher for more information.

The next combination will be the first row and the second column. Take the sum of the elements in the first row multiplied by the elements in second column.

So, 5\times 3+12\times 2+56\times 2=151 goes into the (1,2) entry: \begin{bmatrix} 5&12&56\\ 10&30&75\\ \end{bmatrix} \begin{bmatrix} 6&3\\ 1&2\\ 7&2 \end{bmatrix} = \begin{bmatrix} 434&151\\ .&. \end{bmatrix}

Multiplying the second row of a matrix by the first column of another. Ask your teacher for more information.

The next combination will be the second row and the first column. Take the sum of the elements in the second row multiplied by the elements in first column.

So 10\times 6+30\times 1+75\times 7=615 goes into the (2,1) entry: \begin{bmatrix} 5&12&56\\ 10&30&75\\ \end{bmatrix} \begin{bmatrix} 6&3\\ 1&2\\ 7&2 \end{bmatrix} = \begin{bmatrix} 434&151\\ 615&. \end{bmatrix}

Multiplying the second row of a matrix by the second column of another. Ask your teacher for more information.

The final combination is the second row and the second column. Take the sum of the elements in the second row multiplied by the elements in second column.

So 10\times 3+30\times 2+75\times 2=240 goes into the (2,2) entry. \begin{bmatrix} 5&12&56\\ 10&30&75\\ \end{bmatrix} \begin{bmatrix} 6&3\\ 1&2\\ 7&2 \end{bmatrix} = \begin{bmatrix} 434&151\\ 615&240 \end{bmatrix}

In general, to compute element (i,j) in the matrix AB, we multiply the elements of the ith row in A with the elements in the jth column of B, and sum all the products. For a pair of 2\times 2 matrices, this looks like this: \begin{bmatrix} a&b\\ c&d \end{bmatrix} \begin{bmatrix} e&f\\ g&h \end{bmatrix} =\begin{bmatrix} ae+bg&af+bh\\ ce+dg&cf+dh \end{bmatrix}

Examples

Example 1

ConsiderA = \begin{bmatrix} -1 & -3 \\ -9 & -4 \\ 4 & -5 \end{bmatrix} and B = \begin{bmatrix} 3 \\ -8 \end{bmatrix}

a

Is the product AB defined?

Worked Solution
Create a strategy

Check whether the number of columns in A is equal to the number of rows in B.

Apply the idea

Matrix A has dimensions 3\times 2 and matrix B has dimensions 2\times 1.

Since the number of columns of matrix A is equal to the number of rows of matrix B, then it means that the product AB is defined.

b

What are the dimensions of AB?

Worked Solution
Create a strategy

When you multiply an m\times n and an n\times r matrix, the result is an m\times r matrix.

Apply the idea

When matrix A with dimensions 3\times 2 is multiplied by matrix B with dimensions 2\times 1 then AB will have dimensions 3\times 1.

c

Determine the matrix AB.

Worked Solution
Create a strategy

To compute the element (i,j), multiply the elements of the ith row in A with the elements in the jth column of B, and sum all the products.

Apply the idea
\displaystyle AB\displaystyle =\displaystyle \begin{bmatrix} -1 & -3 \\ -9 & -4 \\ 4 & -5 \end{bmatrix}\begin{bmatrix} 3 \\ -8 \end{bmatrix}Multiply matrix A by matrix B
\displaystyle =\displaystyle \begin{bmatrix} -1 \times 3 + (-3\times (-8))\\ -9\times 3 +(-4 \times (-8))\\ 4\times 3 + (-5 \times (-8)) \end{bmatrix}Multiply and add corresponding elements
\displaystyle =\displaystyle \begin{bmatrix} 21\\ 5\\ 52 \end{bmatrix}Evaluate each element

Example 2

Frank owns two pizza stores, Panania Pizza and Penrith Pizza, at which he sells small pizzas for \$7, medium-sized pizzas for \$15 and large pizzas for \$28.

The table shows the number of pizzas sold at each store on a particular day.

SmallMediumLarge
Panania Pizza212512
Penrith Pizza261122
a

Organise the prices into the column matrix in ascending size order.A= \begin{bmatrix} ⬚\\ ⬚\\ ⬚ \end{bmatrix}

Worked Solution
Create a strategy

Write the prices in ascending size order into the matrix.

Apply the idea

The prices in ascending size order are: \$7, \$15, \$28. So the matrix is:A= \begin{bmatrix} 7\\ 15\\ 28 \end{bmatrix}

b

Organise the number of pizzas sold into the matrix as given in the table.B= \begin{bmatrix} ⬚&⬚&⬚\\ ⬚&⬚& ⬚\\ \end{bmatrix}

Worked Solution
Create a strategy

Write the numbers from the table into the matrix in the same positions.

Apply the idea

B= \begin{bmatrix} 21&25&12\\ 26&11& 22\\ \end{bmatrix}

c

Calculate Frank's total revenue for each store by finding BA.

Worked Solution
Create a strategy

To compute the element (i,j), multiply the elements of the ith row in B with the elements in the jth column of A, and sum all the products.

Apply the idea

Since B is a 2\times 3 matrix, and A is a 3\times 1 matrix, BA will be a 2\times 1 matrix.

\displaystyle BA\displaystyle =\displaystyle \begin{bmatrix} 21&25&12\\ 26&11& 22\\ \end{bmatrix} \begin{bmatrix} 7\\ 15\\ 28 \end{bmatrix}Multiply matrix B by matrix A
\displaystyle =\displaystyle \begin{bmatrix} (21 \times 7) + (25 \times 15) + (12\times 28)\\ (26 \times 7) + (11\times 15) + (22\times 28) \end{bmatrix}Multiply and add corresponding elements
\displaystyle =\displaystyle \begin{bmatrix} 858\\ 963 \end{bmatrix}Evaluate each element
Reflect and check

Note that the matrix BA actually shows us how much money each store made that day. This is because we multiplied the number of pizzas sold by their prices.

Panania Pizza made \$858, and Penrith Pizza made \$963. We know that this is the order since Panania Pizza was the top row of the table, so it would correspond to the top element of the matrix.

Idea summary

If matrix A has dimension m \times n and matrix B as dimension a\times b then the result C=AB will have dimensions m \times b:

Multiplication of matrices A and B where their product is matrix C. Ask your teacher for more information.

To compute element (i,j) in the matrix AB, we multiply the elements of the ith row in A with the elements in the jth column of B, and sum all the products. For a pair of 2\times 2 matrices, this looks like this: \begin{bmatrix} a&b\\ c&d \end{bmatrix} \begin{bmatrix} e&f\\ g&h \end{bmatrix} =\begin{bmatrix} ae+bg&af+bh\\ ce+dg&cf+dh \end{bmatrix}

Multiplicative identity

The Identity matrix, I, has similar properties to the number 1 in the real number system. When multiplying a matrix by the identity matrix, I, of the appropriate order, the result is the original matrix. \begin{bmatrix} a&b\\ c&d \end{bmatrix} \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} = \begin{bmatrix} a&b\\ c&d \end{bmatrix}

The diagonal matrix, with 1's on the diagonal is the identity matrix. Use the symbol I, to represent the identity matrix. \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} = I

A special thing about the identity matrix is that the order of multiplication doesn't matter, i.e.

Let A= \begin{bmatrix} a&b\\ c&d \end{bmatrix} and let I= \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} then AI=IA=A.

Examples

Example 3

Which matrix satisfies the following equation: A+⬚=A.

A
Zero matrix O
B
Matrix A
C
Identity matrix I
Worked Solution
Create a strategy

Think of the matrix A as a number. What number added to another gives the same number?

Apply the idea

Among the choices, only zero matrix O will give the same sum of matrix A when added to matrix A.

So, the correct answer is Option A.

Example 4

Find the matrix that satisfies the following equation: \begin{bmatrix} 6&1\\ 5&9 \end{bmatrix} \times \begin{bmatrix} ⬚&⬚\\ ⬚&⬚ \end{bmatrix} = \begin{bmatrix} 6&1\\ 5&9 \end{bmatrix}

Worked Solution
Create a strategy

Notice that the result matrix is the same as the original matrix.

Apply the idea

To satisfy the given equation above, we multiply the original matrix by the identity matrix. \begin{bmatrix} 6&1\\ 5&9 \end{bmatrix} \times \begin{bmatrix} 1&0\\ 0&1 \end{bmatrix} = \begin{bmatrix} 6&1\\ 5&9 \end{bmatrix}

Idea summary

The multiplicative identity for matrices is the Identity matrix I. For any matrix A,AI=IA=A

Outcomes

U1.AoS3.3

matrix arithmetic: the definition of addition, subtraction, multiplication by a scalar, multiplication, the power of a square matrix, and the conditions for their use

U1.AoS3.9

add and subtract matrices, multiply a matrix by a scalar or another matrix, and raise a matrix to a power

What is Mathspace

About Mathspace