topic badge

10.02 Matrix operations

Lesson

Addition and subtraction

Addition and subtraction happens following normal rules of arithmetic, just that we complete these operations per element.

Addition

Formally - matrix addition looks like this. Note that we are simply applying the operation on corresponding elements. 

So as an example, 

Because of the nature of addition, (element by element) only matrices of the same size (order) can be added.

 

Subtraction

Formally - matrix subtraction looks like this. Note that we are simply applying the operation on corresponding elements. Only matrices of the exact same size can be subtracted. 

So as an example, 

Practice questions

QUESTION 1

    $7$7         $8$8    
If $A$A$=$=   $-7$7     and $B$B$=$=   $2$2   , find $A+B$A+B.
    $-5$5         $4$4    
  1.     $\editable{}$    
    $A+B$A+B$=$=   $\editable{}$    
        $\editable{}$    

QUESTION 2

If $A$A$=$=   $9$9 $2$2 $6$6     and $B$B$=$=   $-3$3 $-5$5 $3$3   , find $A-B$AB.
  $5$5 $-7$7 $8$8       $-1$1 $-6$6 $7$7  
  1. $A-B$AB$=$=   $\editable{}$ $\editable{}$ $\editable{}$    
      $\editable{}$ $\editable{}$ $\editable{}$    

Scalar multiplication

A scalar is a quantity, or a magnitude.  So to multiply by a scalar is to multiply by a quantity.  When multiplying an entire matrix by a scalar, we multiply each element by the same amount. 

Formally this looks like:

 

Worked examples

Question 3

each element is multiplied by $3$3.

Question 4

each element is multiplied by $\frac{1}{2}$12

Question 5

each element is multiplied by $\sqrt{2}$2

Question 6

In this example, we want to find $m$m.  Knowing that each element is multiplied by the same amount, we just need to find the common factor. 

We can take $1.5\div3$1.5÷​3, or $3.6\div7.2$3.6÷​7.2, what we find is that the common factor is $\frac{1}{2}$12.  

Practice questions

QUESTION 7

If $A$A$=$=
    $2$2 $-6$6    
    $-4$4 $3$3    
, find $3A$3A.
  1. $3A$3A $=$=
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    

QUESTION 8

Find $A+5B$A+5B if $A$A$=$=
    $6$6 $-3$3    
    $9$9 $7$7    
and $B$B$=$=
    $5$5 $0$0    
    $-4$4 $2$2    
.
  1. $A+5B$A+5B$=$=
        $6$6 $-3$3    
        $9$9 $7$7    
    $+$+ $\editable{}$
        $5$5 $0$0    
        $-4$4 $2$2    
    $=$=
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
    $+$+
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
    $=$=
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    

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 $\text{matrix A}$matrix A has dimension $m\times n$m×n and $\text{matrix B}$matrix B has dimension $n\times p$n×p then the dimension of $AB$AB will be $\left(m\times n\right)\times\left(n\times p\right)=\left(m\times p\right)$(m×n)×(n×p)=(m×p)

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

Matrix multiplication is not an element by element basis.  

Let's look at an example of multiplication before we generalize 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.  That is, $\text{element }_{11}$element 11 

 So $5\times6+12\times1+56\times7=434$5×6+12×1+56×7=434 goes in $\text{element }_{11}$element 11

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 in $\text{element }_{12}$element 12

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 in $\text{element }_{21}$element 21

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 in $\text{element }_{22}$element 22

 

Worked example

Question 9

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.

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.

To work out the total amount of water needed we will multiply $D$D by $W$W

 

What this tells us is that $2460$2460 ml is used in raising a lettuce plant ($2.46$2.46 L) and for each tomato plant it is $4050$4050 ml ($4.05$4.05 L).  

Matrix multiplication

Formally matrix multiplication looks like this:

 

Practice questions

QUESTION 10

Is $PQ$PQ, the product of $P_{4\cdot2}$P4·2 and $Q_{2\cdot3}$Q2·3, defined?

  1. No

    A

    Yes

    B
  2. What are its dimensions?

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

QUESTION 11

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

QUESTION 12

Consider $A$A$=$=
    $-9$9    
    $3$3    
and $B$B$=$=
    $8$8 $6$6 $-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. $AB$AB$=$=
        $-9$9    
        $3$3    
        $8$8 $6$6 $-8$8    
    $=$=
        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    

Properties with matrices

Matrices follow a lot of the same properties as real numbers.

Properties of addition

Addition is:

  • Commutative $A+B=B+A$A+B=B+A
  • Associative $\left(A+B\right)+C=A+\left(B+C\right)$(A+B)+C=A+(B+C)
  • Distributive $kA+kB=k\left(A+B\right)$kA+kB=k(A+B) and $$

 

Properties of subtraction

Subtraction is:

  • not Commutative $A-B\ne B-A$ABBA
  • not Associative $\left(A-B\right)-C\ne A-\left(B-C\right)$(AB)CA(BC)
  • Distributive $kA-kB=k\left(A-B\right)$kAkB=k(AB) and $kA-cA=\left(k-c\right)A$kAcA=(kc)A

 

Properties of multiplication

Scalar multiplication is:

  • Commutative $kA=Ak$kA=Ak
  • Associative $\left(kc\right)A=k\left(cA\right)$(kc)A=k(cA)

 

Matrix multiplication (if it is defined based on the order of the matrices) is:

  • not always Commutative $AB\ne BA$ABBA  depending on the order of the matrices
  • Associative $\left(AB\right)C=A\left(BC\right)$(AB)C=A(BC)

 

Practice questions

Question 13

Consider the following 2x2 matrices:

$A$A =
    $1$1 $-9$9    
    $-1$1 $2$2    
, $B$B=
    $2$2 $4$4    
    $-4$4 $0$0    
and $C$C =
    $4$4 $1$1    
    $3$3 $-6$6    
  1. Simplify $A+\left(B+C\right)$A+(B+C):

    $A+\left(B+C\right)$A+(B+C) $=$=
        $1$1 $-9$9    
        $-1$1 $2$2    
    $+$+ (
        $2$2 $4$4    
        $-4$4 $0$0    
    $+$+
        $4$4 $1$1    
        $3$3 $-6$6    
    )
      $=$= 
        $1$1 $-9$9    
        $-1$1 $2$2    
    $+$+  
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
     
      $=$= 
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
       
  2. Simplify $\left(A+B\right)+C$(A+B)+C:

    $\left(A+B\right)+C$(A+B)+C $=$= (
        $1$1 $-9$9    
        $-1$1 $2$2    
    $+$+
        $2$2 $4$4    
        $-4$4 $0$0    
    ) $+$+
        $4$4 $1$1    
        $3$3 $-6$6    
      $=$=   
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
    $+$+
        $4$4 $1$1    
        $3$3 $-6$6    
     
      $=$=   
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
     
  3. What property do parts (a) and (b) of this question demonstrate?

    The associative property of matrix addition: $A+\left(B+C\right)=\left(A+B\right)+C$A+(B+C)=(A+B)+C

    A

    The distributive property of right matrix multiplication: $\left(A+B\right)\cdot C=AC+BC$(A+B)·C=AC+BC

    B

    The distributive property of left matrix multiplication: $C\cdot\left(A+B\right)=CA+CB$C·(A+B)=CA+CB

    C

    The associative property of matrix multiplication: $A\cdot\left(B\cdot C\right)=\left(A\cdot B\right)\cdot C$A·(B·C)=(A·B)·C

    D

Question 14

Consider the following matrices:

$A$A =
    $7$7 $9$9 $7$7    
    $3$3 $6$6 $7$7    
, $B$B=
    $9$9 $6$6 $6$6    
    $7$7 $8$8 $6$6    
and $C$C =
    $6$6 $4$4    
    $9$9 $4$4    
    $2$2 $4$4    
  1. Simplify $\left(A+B\right)\cdot C$(A+B)·C:

    $\left(A+B\right)\cdot C$(A+B)·C $=$= (
        $7$7 $9$9 $7$7    
        $3$3 $6$6 $7$7    
    $+$+
        $9$9 $6$6 $6$6    
        $7$7 $8$8 $6$6    
    ) $×$×
        $6$6 $4$4    
        $9$9 $4$4    
        $2$2 $4$4    
      $=$=   
        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    
    $×$×
        $6$6 $4$4    
        $9$9 $4$4    
        $2$2 $4$4    
       
      $=$=   
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
     
  2. Simplify $A\cdot C+B\cdot C$A·C+B·C:

    $A\cdot C+B\cdot C$A·C+B·C $=$=
        $7$7 $9$9 $7$7    
        $3$3 $6$6 $7$7    
    $×$×
        $6$6 $4$4    
        $9$9 $4$4    
        $2$2 $4$4    
    $+$+
        $9$9 $6$6 $6$6    
        $7$7 $8$8 $6$6    
    $×$×
        $6$6 $4$4    
        $9$9 $4$4    
        $2$2 $4$4    
      $=$= 
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
    $+$+
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
         
      $=$= 
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
         
  3. What property do parts (a) and (b) demonstrate?

    $A+(B+C)=(A+B)+C$A+(B+C)=(A+B)+C

    A

    $C\cdot\left(A+B\right)=CA+CB$C·(A+B)=CA+CB

    B

    $A\cdot(B\cdot C)=(A\cdot B)\cdot C$A·(B·C)=(A·B)·C

    C

    $\left(A+B\right)\cdot C=AC+BC$(A+B)·C=AC+BC

    D

Question 15

Given the following matrices:

$A$A =
    $1$1 $8$8    
    $8$8 $8$8    
and $B$B=
    $2$2 $4$4    
    $2$2 $2$2    
 
  1. Simplify $A\cdot B$A·B:

    $A\cdot B$A·B $=$=
        $1$1 $8$8    
        $8$8 $8$8    
    $×$×
        $2$2 $4$4    
        $2$2 $2$2    
      $=$= 
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
       
  2. Simplify $B\cdot A$B·A:

    $B\cdot A$B·A $=$=
        $2$2 $4$4    
        $2$2 $2$2    
    $×$×
        $1$1 $8$8    
        $8$8 $8$8    
      $=$= 
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
       
  3. What property do parts (a) and (b) demonstrate?

    $A+B\ne B+A$A+BB+A

    A

    $A+B=B+A$A+B=B+A

    B

    $A\cdot B\ne B\cdot A$A·BB·A

    C

    $A\cdot B=B\cdot A$A·B=B·A

    D

Matrix identities

In mathematics an identity is a value that when included in an operation like addition, or multiplication, leaves the value unchanged.  

We have already used additive and multiplicative identities in whole number operations.

Can you think of what number you add to $6$6 to leave $6$6 unchanged, that is 

$6+???$6+??? = $6$6

Similarly, can you think of what number you multiply to $6$6 to leave $6$6 unchanged?  That is

$6\times???$6×???  = $6$6

That's right, we already know that $6+0=6$6+0=6 and$6\times1=6$6×1=6.  This makes $0$0 the additive identity and $1$1 the multiplicative identity for real numbers.

Additive identity

So all we need to do now is find the matrices that yield the same result.  The additive identify is the easiest one to see so what matrix is needed here?

Can you see that the result we need is

This matrix where all the elements are $0$0 has a special name. It is called the Zero Matrix.  

Additive Identity!

The additive identity for matrices is the zero matrix. So for any matrix $A$A

$A+0=A$A+0=A, and $0+A=A$0+A=A 

 

Multiplicative identity

We want the matrix that makes this true

Let's try some options.  What happens if we make all the elements $1$1

So this doesn't work, unless all the elements are $0$0, which is a trivial case.

Let's try using just one, $1$1

This is much closer, but we are not quite there.  If I told you there was one other $1$1 to be placed can you work out where to put it? 

So the diagonal matrix, with $1$1's on the diagonal is the identity matrix.  We use the symbol $I$I, to represent the identity matrix. 

A special thing about the identity matrix, is that it is commutative so:

 

Multiplicative Identity

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

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

Practice questions

Question 16

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 17

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    

Question 18

Which matrix satisfies the following equation:

$\text{A }\cdot\text{A }^{-1}=\editable{?}$A ·A 1=?

  1. Zero matrix $O$O.

    A

    Matrix inverse $A^{-1}$A1

    B

    Matrix $A$A

    C

    Identity matrix $I$I.

    D

Matrix applications

Sometimes we use matrices to solve problems involving more real-world type applications. A very common one is in systems relating to economics (prices, profits, losses, markups, and many other topics), but basically anything that would involve carrying out the same operation on multiple items can be made more simple by using matrices. 

Some key things to remember:

  • if you have to convert your system in a matrix, check what you place in rows and columns.  The operations you carry out on them will rely on you having done this first critical step correctly.
  • If you need to multiply, have you set up your matrices such that the dimensions allow multiplication
  • ALWAYS check that your answer seems reasonable

Let's look at some examples.

Practice questions

Question 19

A second-hand bookstore sells textbooks at a markup of $50%$50%. The table shows the amounts they paid for old textbooks during the past academic year.

  Semester 1 Semester 2
Business $\$940$$940 $\$980$$980
Law $\$1020$$1020 $\$1170$$1170
Mathematics $\$930$$930 $\$1160$$1160
Science $\$1180$$1180 $\$1040$$1040
Engineering $\$1150$$1150 $\$970$$970
  1. Organize the purchase costs into a cost matrix, with each row representing a subject and columns representing semesters.

    $C$C $=$=
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
  2. Organize the revenue that will be generated when they manage to sell all the textbooks into a revenue matrix.

    $R$R $=$= $\editable{}$
        $940$940 $980$980    
        $1020$1020 $1170$1170    
        $930$930 $1160$1160    
        $1180$1180 $1040$1040    
        $1150$1150 $970$970    
      $=$=
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
  3. Complete the profit matrix.

    $P$P $=$=
        $1410$1410 $1470$1470    
        $1530$1530 $1755$1755    
        $1395$1395 $1740$1740    
        $1770$1770 $1560$1560    
        $1725$1725 $1455$1455    
    $-$
        $940$940 $980$980    
        $1020$1020 $1170$1170    
        $930$930 $1160$1160    
        $1180$1180 $1040$1040    
        $1150$1150 $970$970    
      $=$=
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$    
  4. How much profit would the bookstore have generated from the sale of all these textbooks?

Question 20

In a particular diving competition, each dive is scored by summing the scores given by the three judges and then multiplying this sum by the degree of difficulty of the dive.The tables show the scorecards of the three judges.

FIRST JUDGE'S SCORECARD     THIRD JUDGE'S SCORECARD
  Dive 1 Dive 2 Dive 3   Dive 1 Dive 2 Dive 3
Beth $7$7 $9.5$9.5 $9$9 Beth $7.5$7.5 $9$9 $10.5$10.5
Emma $6.5$6.5 $7.5$7.5 $8.5$8.5 Emma $7$7 $7$7 $6.5$6.5
Katrina $8$8 $5$5 $5.5$5.5 Katrina $9$9 $4.5$4.5 $5$5
SECOND JUDGE'S SCORECARD
  Dive 1 Dive 2 Dive 3
Beth $5$5 $10.5$10.5 $7.5$7.5
Emma $5.5$5.5 $8.5$8.5 $10$10
Katrina $8$8 $5.5$5.5 $4.5$4.5
  1. Find matrix $A$A, which represents the sum of the judges' scores for each dive.

    $A$A $=$=
        $7$7 $9.5$9.5 $9$9    
        $6.5$6.5 $7.5$7.5 $8.5$8.5    
        $8$8 $5$5 $5.5$5.5    
    $+$+
        $5$5 $10.5$10.5 $7.5$7.5    
        $5.5$5.5 $8.5$8.5 $10$10    
        $8$8 $5.5$5.5 $4.5$4.5    
    $+$+
        $7.5$7.5 $9$9 $10.5$10.5    
        $7$7 $7$7 $6.5$6.5    
        $9$9 $4.5$4.5 $5$5    
      $=$=
        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    
  2. The tables below show the resulting Matrix A from the previous part, and the degree of difficulty of the dive for each diver.

    Matrix A     DEGREE OF DIFFICULTY
      Dive 1 Dive 2 Dive 3   Beth Emma Katrina
    Beth $19.5$19.5 $29$29 $27$27 Dive 1 $3.1$3.1 $1.4$1.4 $1.3$1.3
    Emma $19$19 $23$23 $25$25 Dive 2 $1.9$1.9 $1.2$1.2 $3.3$3.3
    Katrina $25$25 $15$15 $15$15 Dive 3 $2.6$2.6 $1.6$1.6 $2.3$2.3

    Find the matrix product that will contain each diver's total score in the competition.

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

    $=$=

        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    
        $\editable{}$ $\editable{}$ $\editable{}$    
  3. What was the final score for each diver?

    Beth's final score $=$= $\editable{}$
    Emma's final score $=$= $\editable{}$
    Katrina's final score $=$= $\editable{}$

What is Mathspace

About Mathspace