topic badge
AustraliaVIC
VCE 12 General 2023

7.02 Matrix operations

Lesson

Matrix addition and subtraction

When we add or subtract two matrices A and B, we add or subtract the corresponding elements. So we can only add or subtract matrices that have the same dimensions. In general, the sum and difference of two matrices can be represented by the following identities. \begin{bmatrix} a&b\\ c&d \end{bmatrix} + \begin{bmatrix} e&f\\ g&h \end{bmatrix} = \begin{bmatrix} a+e&b+f\\ c+g&d+h \end{bmatrix} and\begin{bmatrix} a&b\\ c&d \end{bmatrix} - \begin{bmatrix} e&f\\ g&h \end{bmatrix} = \begin{bmatrix} a-e&b-f\\ c-g&d-h \end{bmatrix}\\

Examples

Example 1

If A = \begin{bmatrix} 9 & 2 & 6 \\ 5 & -7 &8 \end{bmatrix} and B = \begin{bmatrix} -3 & -5 & 3 \\ -1 & -6 & 7 \end{bmatrix}, find A-B.

Worked Solution
Create a strategy

Subtract each element in matrix B from its corresponding element in matrix A.

Apply the idea

Since matrices A and B are 2\times 3 matrices A-B will also be a 2\times 3 matrix.

\displaystyle A-B\displaystyle =\displaystyle \begin{bmatrix} 9 & 2 & 6 \\ 5 & -7 &8 \end{bmatrix}-\begin{bmatrix} -3 & -5 & 3 \\ -1 & -6 & 7 \end{bmatrix}Subtract matrix B from matrix A
\displaystyle =\displaystyle \begin{bmatrix} 9-(-3) & 2-(-5) & 6-3 \\ 5-(-1) & -7-(-6) &8-7 \end{bmatrix}Subtract each element
\displaystyle =\displaystyle \begin{bmatrix} 12&7&3 \\ 6&-1&1 \end{bmatrix}Evaluate each element
Idea summary

We can add or subtract two matrices of the same dimensions by adding or subtracting the corresponding elements.

Scalar multiplication

A scalar is a quantity, or a magnitude. When we multiply a matrix by a scalar, we multiply each element in the matrix by the given scalar. In general, the multiplication of a matrix by a scalar will appear similar the following: \lambda \begin{bmatrix} a&b\\ c&d \end{bmatrix}= \begin{bmatrix} \lambda a & \lambda b\\ \lambda c & \lambda d\\ \end{bmatrix}

As an example, the multiplication of a matrix with numerical elements by a scalar will look like the following: 3 \begin{bmatrix} 2&-2\\ 6&0 \end{bmatrix}= \begin{bmatrix} 6 & -6\\ 18 & 0\\ \end{bmatrix} We can see that each element was multiplied by 3.

Examples

Example 2

Find A+5B if A = \begin{bmatrix} 6 & -3 \\ 9 & 7 \end{bmatrix} and B = \begin{bmatrix} 5 & 0 \\ -4 & 2 \end{bmatrix}.

Worked Solution
Create a strategy

Apply scalar multiplication to matrix B and add it on matrix A.

Apply the idea
\displaystyle A+5B\displaystyle =\displaystyle \begin{bmatrix} 6 & -3 \\ 9 & 7 \end{bmatrix}+5\begin{bmatrix} 5 & 0 \\ -4 & 2 \end{bmatrix}Add matrix A to scalar multiplication on matrix B
\displaystyle =\displaystyle \begin{bmatrix} 6 & -3 \\ 9 & 7 \end{bmatrix}+\begin{bmatrix} 25 & 0 \\ -20 & 10 \end{bmatrix}Multiply each element of matrix B by 5
\displaystyle =\displaystyle \begin{bmatrix} 6+25&-3+0\\9+(-20)&7+10 \end{bmatrix}Add each element
\displaystyle =\displaystyle \begin{bmatrix} 31&-3\\-11&17 \end{bmatrix}Evaluate
Idea summary

A scalar is a quantity, or a constant number.

When we multiply a matrix by a scalar, we multiply each element in the matrix by the given scalar.

Transpose of a matrix

The transpose of a matrix is made by interchanging the rows and columns. The transpose of matrix A is written as A^{T}. For example, the first row of matrix A becomes the first column of A^{T}, the second row of A becomes the second column of A^{T}, and so on. If a_{mn} is an element of matrix A, then this is equal to a^{T}_{nm} of the matrix A^{T}. This can be represented by the following identity.

\begin{bmatrix} a & b & c \\ d & e & f \end{bmatrix}^{T} = \begin{bmatrix} a & d \\ b & e \\ c & f \end{bmatrix}

As an example, the transpose of a matrix with numerical elements will look like the following:

\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}^{T} = \begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix}

It's also easy to verify that the transpose of the matrix A^T returns the original matrix A. For instance, if we take the transpose of the resulting matrix above, we get the same matrix we started with.

\begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix}^T = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}

If a matrix is symmetric, then the transpose of the matrix returns itself. This is because the element in the mth row and the nth column is equal to the element in the nth row and the mth column.

A= \begin{bmatrix} 1 & 2 & 3 \\ 2 & 0 & -4 \\ 3 & -4 & 9 \end{bmatrix} = A^T

Lastly the transpose of a matrix is distributive, meaning that given two matrices A and B, then we have the following identity:

\left(A+B\right)^T=A^T+B^T

To illustrate this, consider the following matrices A and B and their transpose.

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

A^T= \begin{bmatrix} 1 & 2 & 4 \\ 2 & 1 & 0 \\ 5 & -4 & 9 \end{bmatrix}, B^T= \begin{bmatrix} -1 & 1 & 3 \\ 2 & 0 & 3 \\ -2 & 0 & 5 \end{bmatrix}

If we add each pair of matrices, that is, if we compute A+B and A^T+B^T then we can see that they are transpose of one another.

A + B= \begin{bmatrix} 0 & 4 & 3 \\ 3 & 1 & -4 \\ 7 & 3 & 14 \end{bmatrix}, A^T+B^T= \begin{bmatrix} 0 & 3 & 7 \\ 4 & 1 & 3 \\ 3 & -4 & 14 \end{bmatrix}

The distributive property also works for subtraction, i.e. \left(A-B\right)^T=A^T-B^T.

Examples

Example 3

Consider the following matrix:

A = \begin{bmatrix} 7 & 5 & 8 & 5 \\ 9 & 4 & 0 & 2 \\ 2 & 9 & 1 & 1 \\ 8 & 3 & 3 & 9 \end{bmatrix}

a

The order of A is ⬚ \times ⬚.

Worked Solution
Create a strategy

The order of a matrix is given by \text{number of rows $\times$ number of columns}.

Apply the idea

Matrix A has 4 rows and 4 columns.

The order of A is 4 \times 4.

b

Let b_{mn} represent the entry in the mth row and the nth column of A^T.

What is the value of b_{3,4}?

Worked Solution
Create a strategy

Swap the values of m and n to locate the element at the matrix.

Apply the idea

Element b_{3,4} at A^T is b_{4,3} at A.

From matrix A, we can see that the element in the 4th row and 3rd column is:

b_{3,4}=3

c

If B= A^T, then B = \begin{bmatrix} ⬚ & ⬚ & ⬚ & ⬚ \\ ⬚ & ⬚ & ⬚ & ⬚ \\ ⬚ & ⬚ & ⬚ & ⬚ \\ ⬚ & ⬚ & ⬚ & ⬚ \end{bmatrix} .

Worked Solution
Create a strategy

Find A^T or the transposition of matrix A by interchanging the rows and columns.

Apply the idea

Let the rows of A become columns of A^T or columns of A become rows of A^T.

A = \begin{bmatrix} 7 & 5 & 8 & 5 \\ 9 & 4 & 0 & 2 \\ 2 & 9 & 1 & 1 \\ 8 & 3 & 3 & 9 \end{bmatrix} \to A^T = \begin{bmatrix} 7 & 9 & 2 & 8 \\ 5 & 4 & 9 & 3 \\ 8 & 0 & 1 & 3 \\ 5 & 2 & 1 & 9 \end{bmatrix}

If B = A^T, then B= \begin{bmatrix} 7 & 9 & 2 & 8 \\ 5 & 4 & 9 & 3 \\ 8 & 0 & 1 & 3 \\ 5 & 2 & 1 & 9 \end{bmatrix} .

d

What is the order of B?

⬚ \times ⬚

Worked Solution
Create a strategy

The order of a matrix is given by \text{number of rows $\times$ number of columns}.

Apply the idea

Matrix B has 4 rows and 4 columns.

The order of B is 4 \times 4.

Idea summary

If we have matrix A, its transpose is made of its interchanged rows and columns denoted by A^T.

Outcomes

U4.AoS2.1

the order of a matrix, types of matrices (row, column, square, diagonal, symmetric, triangular, zero, binary, permutation and identity), the transpose of a matrix, and elementary matrix operations (sum, difference, multiplication of a scalar, product and power)

What is Mathspace

About Mathspace