topic badge
AustraliaVIC
VCE 11 General 2023

6.05 Matrix multiplication

Lesson

When can we multiply?

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$A has dimension $m\times n$m×n and matrix $B$B as dimension $a\times b$a×b then the multiplication is defined if $n=a$n=a and  the dimension of the result $C=AB$C=AB will be $m\times b$m×b.

As shown in the following diagram:

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

For example consider the following matrices A, B and C where,

,   ,   

A is a $2\times2$2×2 matrix, B is a $2\times1$2×1 matrix and C is a $1\times2$1×2 matrix.

  •  $A\times B$A×B is a $(2\times2)\times(2\times1)$(2×2)×(2×1) this is defined and the result would be a $2\times1$2×1 matrix.
  • $B\times C$B×C is a $(2\times1)\times(1\times2)$(2×1)×(1×2) this is defined and the result would be a$2\times2$2×2 matrix.
  • $A\times C$A×C is a $(2\times2)\times(1\times2)$(2×2)×(1×2) this is undefined.

How do we multiply?

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.

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\times6+12\times1+56\times7=434$5×6+12×1+56×7=434 goes into the $\left(1,1\right)$(1,1) entry.

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\times3+12\times2+56\times2=151$5×3+12×2+56×2=151 goes into the $\left(1,2\right)$(1,2) entry.

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\times6+30\times1+75\times7=615$10×6+30×1+75×7=615 goes into the $\left(2,1\right)$(2,1) entry.

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\times3+30\times2+75\times2=240$10×3+30×2+75×2=240 goes into the $\left(2,2\right)$(2,2) entry.

Remember!

In general, to compute the $\left(i,j\right)$(i,j)-element in the matrix $AB$AB, we multiply the elements of the $i$ith row in $A$A with the elements in the $j$jth column of $B$B, and sum all the products. For a pair of $2\times2$2×2 matrices, this looks like:

Practice questions

QUESTION 1

Consider $A$A$=$=
    $-1$1 $-3$3    
    $-9$9 $-4$4    
    $4$4 $-5$5    
and $B$B$=$=
    $3$3    
    $-8$8    
.
  1. Is the product $AB$AB defined?

    Yes

    A

    No

    B
  2. What are the dimensions of $AB$AB?

    $\editable{}$$\times$×$\editable{}$

  3. Determine the matrix $AB$AB.

    $AB$AB$=$=
        $-1$1 $-3$3    
        $-9$9 $-4$4    
        $4$4 $-5$5    
        $3$3    
        $-8$8    
    $=$=
        $\editable{}$    
        $\editable{}$    
        $\editable{}$    

 

Real life applications

Worked example

Example 1

An organic gardener produces lettuces and tomatoes.  The following table indicates the time taken for each of the growing stages.

 

Stage 1

Germination from seed (days)

Stage 2

from sprout to seedling (days)

Stage 3

from seedling to maturity (days)

Lettuce $5$5 $12$12 $56$56
Tomato $10$10 $30$30 $75$75

The amount of water per day needed for Stage 1 is $60$60 mL, for Stage 2 is $40$40 mL and Stage 3 is $30$30 mL. 

Work out the amount of water needed for both the lettuce and tomato.

Think: First, let's construct two matrices. 

Let $D$D be the matrix of days needed in each stage:

And let $W$W be the matrix of water needed:

 

Do: To work out the total amount of water needed we will multiply $D$D by $W$W. It is important to note that we multiply $D$D by $W$W  not only because the dimensions match, but also because the headings of the columns of $D$D (stages) match the headings of the rows of $W$W (also stages).

 

This tells us that $2460$2460 mL is used in raising a lettuce plant ($2.46$2.46 L) and $4050$4050 mL is used for each tomato plant ($4.05$4.05 L).

Practice questions

QUESTION 2

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

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

  Small Medium Large
Panania Pizza $21$21 $25$25 $12$12
Penrith Pizza $26$26 $11$11 $22$22
  1. Organise the prices into the column matrix in ascending size order.

    $A$A$=$=
        $\editable{}$    
        $\editable{}$    
        $\editable{}$    
  2. Organise the number of pizzas sold into the matrix as given in the table.

    $B$B$=$=
        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    
  3. Calculate Frank's total revenue for each store by finding $BA$BA.

    $BA$BA$=$=
        $21$21 $25$25 $12$12    
        $26$26 $11$11 $22$22    
        $7$7    
        $15$15    
        $28$28    
    $=$=
        $\editable{}$    
        $\editable{}$    

 

Matrix multiplication and using the calculator

Let's look at how we can use our calculators to perform multiplication with matrices.

Casio Classpad

How to use the CASIO Classpad to complete the following tasks regarding matrices

If $A$A$=$=    $1$1  $5$5  $6$6     $B$B$=$=    $3$3  $0$0     and $C$C$=$=    $-2$2  $2$2    
   $3$3  $4$4  $5$5       $-1$1  $2$2       $1$1  $5$5  

Find where possible:

  1. $2BA$2BA

  2. $(B+C)A$(B+C)A

  3. $AB$AB

TI Nspire

How to use the TI Nspire to complete the following tasks regarding matrices

If $A$A$=$=    $1$1  $5$5  $6$6     $B$B$=$=    $3$3  $0$0     and $C$C$=$=    $-2$2  $2$2    
   $3$3  $4$4  $5$5       $-1$1  $2$2       $1$1  $5$5  

Find where possible:

  1. $2BA$2BA

  2. $(B+C)A$(B+C)A

  3. $AB$AB

 

Multiplicative identity

The Identity matrix, $I$I, has similar properties to the number $1$1 in the real number system. When multiplying a matrix by the identity matrix, $I$I, of the appropriate order, the result is the original matrix.

The diagonal matrix, with $1$1's on the diagonal is the identity matrix.  Use the symbol $I$I, to represent the identity matrix. 

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

 

Multiplicative identity

The multiplicative identity for matrices is the Identity matrix $I$I. For any matrix $A$A

$AI=IA=A$AI=IA=A

 

Practice questions

Question 3

Which matrix satisfies the following equation:

$\text{A }+\editable{?}=\text{A }$A +?=A

  1. Zero matrix $O$O.

    A

    Matrix $A$A

    B

    Identity matrix $I$I.

    C

Question 4

Find the matrix that satisfies the following equation:

  1.     $6$6 $1$1    
        $5$5 $9$9    
    x
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
    $=$=
        $6$6 $1$1    
        $5$5 $9$9    

 

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