topic badge

4.10 Matrices

Lesson

Introduction

Learning objective

  • 4.10.A Determine the product of two matrices.

Understanding matrix dimensions

A matrix is an array consisting of n rows and m columns, where n and m are integers. It is represented as an n \times m matrix, with n denoting the number of rows and m representing the number of columns.

Matrix

A rectangular array of numbers or variables

Example:

M = \begin{bmatrix} a & 2 \\ 3 & d \end{bmatrix}

The dimensions of a matrix are referred to as the order and are always listed by row then column in the form where represents the number of rows and represents the number of columns. Special forms of a matrix can be classified by their order:

Square matrix

A matrix with order n\times n

Example:

3 \times 3 matrix: \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}

Row matrix

A matrix with order 1\times n

Example:

1 \times 3 matrix:\text{ } \\ \begin{bmatrix} 1 & 2 & 3 \end{bmatrix}

Column matrix

A matrix with order n\times 1

Example:

3 \times 1 matrix:\text{} \\ \begin{bmatrix} 1 \\ 4 \\ 7 \end{bmatrix}

The elements of a matrix are the individual numbers and variables and can be identified by their position using subscript notation a_{mn} where m represents the row the element is located in and n represents the column as shown in the matrix below:

\displaystyle A=\begin{bmatrix} a_{11} & a_{12} & \ldots & a_{1m} \\ a_{21} & a_{22} & \ldots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \ldots & a_{mn} \end{bmatrix}
\bm{a_{ij}}
is the element in row i and column j
\bm{m}
is the number of rows in matrix A
\bm{n}
is the number of columns in matrix A

Matrices can only be equal if they have the same order and every element within each matrix is equal. For example, if A=B, then a_{11}=b_{11}, a_{12}=b_{12}\ldots etc.

Examples

Example 1

Matrix A is shown below: A = \begin{bmatrix} 2 & 8 \\ 3 & 1 \\ 9 & 7 \end{bmatrix}

a

Find the order of matrix A.

Worked Solution
Create a strategy

The order of a matrix can be found as its dimensions n \times m, where n is the number of rows, and m is the number of columns.

Apply the idea

Matrix A contains 3 rows and 2 columns. The order of a matrix can be found as n \times m, where n is the number of rows, and m is the number of columns, so the order of the matrix is 3 \times 2.

b

Identify the value of a_{21} in matrix A.

Worked Solution
Create a strategy

The subscript indicates the position of the element by row and column respectively.

Apply the idea

a_{21} represents the value in the 2nd row, 1st column a_{21} = 3.

Example 2

Consider the matrix equation: \begin{bmatrix} x & 5 \\ 9 & 6-y \end{bmatrix}=\begin{bmatrix} 3 & 5 \\ 9 & 2 \end{bmatrix}

a

Solve for x.

Worked Solution
Create a strategy

Two matrices are equal if each of their corresponding elements are equal. To solve, we'll identify the element corresponding to x and write an equality statement.

Apply the idea

The variable x is in the first row and first column of \begin{bmatrix} x & 5 \\ 9 & 6-y \end{bmatrix} and 3 is in the first row and first column of \begin{bmatrix} 3 & 5 \\ 9 & 2 \end{bmatrix}. Since the matrices are equal we have: x=3

b

Solve for y.

Worked Solution
Create a strategy

Two matrices are equal if each of their corresponding elements are equal. To solve, we'll identify the element containing y and set it equal to its corresponding element in the equal matrix.

Apply the idea

The variable y is in the second row and second column of \begin{bmatrix} x & 5 \\ 9 & 6-y \end{bmatrix} and 2 is in the second row and second column of \begin{bmatrix} 3 & 5 \\ 9 & 2 \end{bmatrix}.Since the matrices are equal we have:

\displaystyle 6-y\displaystyle =\displaystyle 2If the matrices are equal, then the corresponding elements are equal
\displaystyle 6\displaystyle =\displaystyle 2+yAdd y to both sides
\displaystyle 4\displaystyle =\displaystyle ySubtract 2 from both sides

Therefore, y=4.

Idea summary

A matrix is a rectangular array of integers consisting of n rows and m columns, defined as having an order of n \times m. The individual components of a matrix are called elements, whose position can be represented in subscript notation as a_{mn}, where m is the row, and n is the column.

Multiplying Matrices

Matrices can be used for various operations, including multiplication. Two matrices can be multiplied if the number of columns in the first matrix equals the number of rows in the second matrix. The resulting matrix will have the same number of rows as the first matrix and the same number of columns as the second matrix.

Can be multiplied: A = \begin{bmatrix} 3 & 8 \\ 3 & 1 \\ 9 & 7 \end{bmatrix}\, B = \begin{bmatrix} 4 & 8 \\ 9 & 0 \end{bmatrix}

Cannot be multiplied: C = \begin{bmatrix} 5 & 7 \\ 2 & 9 \\ 7 & 8 \end{bmatrix}\, D = \begin{bmatrix} 2 & 9 \\ 1 & 4 \\ 1 & 5 \end{bmatrix}

To perform matrix multiplication, the component in the ith row and jthcolumn of the resulting matrix is the dot product of the ith row of the first matrix and the jth column of the second matrix.

\begin{bmatrix} 10 & 2 \end{bmatrix} \times \begin{bmatrix} 8 & 7 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 10 \cdot 8 + 2 \cdot 0 \,\,\,\,\, 10 \cdot 7 + 2 \cdot 1 \end{bmatrix}

results in \begin{bmatrix} 80 & 72 \end{bmatrix}

Matrix multiplication is not commutative, meaning that the order in which the matrices are multiplied matters.

Examples

Example 3

Determine if the following pairs of matrices can be multiplied.

A = \begin{bmatrix} 2 & 5 \\ 1 & 3 \end{bmatrix}\,\,\,\, B = \begin{bmatrix} 7 & 2 & 6 \\ 1 & 5 & 2 \end{bmatrix}\,\,\,\, C = \begin{bmatrix} 2 & 5 & 8 \\ 3 & 10 & 8 \\ 9 & 4 & 2 \end{bmatrix}

a

B \cdot C

Worked Solution
Create a strategy

Determine the number of columns in the first matrix named, and the number of rows in the second matrix named.

Apply the idea

For two matrices to be multiplied, the number of columns in the first matrix must match the number of rows in the second matrix. Matrix B has 3 columns and Matrix C has 3 rows. They can be multiplied.

b

A \cdot B

Worked Solution
Create a strategy

Determine the number of columns in the first matrix named, and the number of rows in the second matrix named.

Apply the idea

For two matrices to be multiplied, the number of columns in the first matrix must match the number of rows in the second matrix. Matrix A has 2 columns and matrix B has 2 rows. They can be multiplied.

c

C \cdot B

Worked Solution
Create a strategy

Determine the number of columns in the first matrix named, and the number of rows in the second matrix named.

Apply the idea

For two matrices to be multiplied, the number of columns in the first matrix must match the number of rows in the second matrix. Matrix C has 3 columns and Matrix B has 2 rows. They cannot be multiplied.

Example 4

Given the following matrices, perform the multiplication indicated.

E = \begin{bmatrix} 2 & 4 \\ 0 & 3 \\5 & 1 \end{bmatrix}\,\,\,\, F = \begin{bmatrix} 0 & 8 \\ 1 & 9 \end{bmatrix}\,\,\,\, G = \begin{bmatrix} 2 & 8 & 1 \\ 3 & 12 & 0 \\ 1 & 0 & 2 \end{bmatrix}

a

E \cdot F

Worked Solution
Create a strategy

Each component in the ith row and jth column of the resulting matrix is the dot product of the ith row of the first matrix and the jth column of the second matrix.

Apply the idea

The resulting matrix of the product of E and F will be a 3 \times 2 matrix. To find the components, the dot product of each ith row of the first matrix and the jth column of the second matrix creates the resulting matrix

\begin{bmatrix} 2 & 4 \\ 0 & 3 \\5 & 1 \end{bmatrix} \times \begin{bmatrix} 0 & 8 \\ 1 & 9 \end{bmatrix} = \begin{bmatrix} 2 \cdot 0 + 4 \cdot 1 \,\,\,\,2\cdot 8 + 4 \cdot 9 \\ 0\cdot 0 + 3 \cdot 1 \,\,\,\,0 \cdot 8 + 3 \cdot 9 \\ 5 \cdot 0 + 1 \cdot 1 \,\,\,\, 5\cdot 8 + 1 \cdot 9\end{bmatrix}

which simplifies to the resulting 3\times 2 matrix \begin{bmatrix} 4 & 52 \\ 3 & 27 \\ 1 & 49 \end{bmatrix}

b

G \cdot E

Worked Solution
Create a strategy

Each component in the ith row and jth column of the resulting matrix is the dot product of the ith row of the first matrix and the jth column of the second matrix.

Apply the idea

The resulting matrix of the product of E and F will be a 3 \times 2 matrix. To find the components, the dot product of each ith row of the first matrix and the jth column of the second matrix creates the resulting matrix

\begin{bmatrix} 2 & 8 & 1 \\ 3 & 12 & 0 \\1 & 0 & 2 \end{bmatrix} \times \begin{bmatrix} 2 & 4 \\ 0 & 3 \\ 5 & 1 \end{bmatrix} = \begin{bmatrix} 2 \cdot 2 + 8 \cdot 0 + 1 \cdot 5 \,\,\,\,2\cdot 4 + 8 \cdot 3 + 1 \cdot 1 \\ 3 \cdot 2 + 12 \cdot 0 + 0 \cdot 5\,\,\,\, 3\cdot 4 + 12 \cdot 3 + 0 \cdot 1 \\ 1 \cdot 2 + 0 \cdot 0 + 2 \cdot 5 \,\,\,\, 1\cdot 4 + 0 \cdot 3 + 2 \cdot 1\end{bmatrix}

which simplifies to \begin{bmatrix} 9 & 33 \\ 6 & 48 \\ 12 & 6 \end{bmatrix}

Idea summary

Matrix multiplication involves the process of taking the dot product of rows from the first matrix with columns from the second matrix. To perform this operation, the number of columns in the first matrix must equal the number of rows in the second matrix, resulting in a new matrix with the dimensions of the first matrix's rows and the second matrix's columns.

Outcomes

4.10.A

Determine the product of two matrices.

What is Mathspace

About Mathspace