Matrices

Print the chapter

Every lesson of the chapter, ready for paper. Exercise sets are lettered A, B, C… and answered at the end.

To save a PDF, choose “Save as PDF” in the print dialog.

1. Matrices: representing data, adding and multiplying by a scalar

Warm-up

Three quick questions from earlier lessons.

Discover

A table has 2 rows and 3 columns of numbers. How many numbers does it hold?

  1. 6
  2. 5

Key idea

A matrix is a rectangular table of numbers.

An m×nm \times n matrix has mm rows and nn columns; the entry in row ii, column jj is aija_{ij}. Matrices of the same size add and subtract entry by entry, and a scalar kk multiplies every entry: 3(120−1)=(360−3)3\begin{pmatrix} 1 & 2 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} 3 & 6 \\ 0 & -3 \end{pmatrix}.

Worked example

Add (1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and (50−12)\begin{pmatrix} 5 & 0 \\ -1 & 2 \end{pmatrix}.

1 + 5, 2 + 0, 3 + (−1), 4 + 2
Same positions.
(6226)\begin{pmatrix} 6 & 2 \\ 2 & 6 \end{pmatrix}
Result.

Your turn, guided

Your turn: the top-left entry of 4(2103)\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix}.

88
4 · 2.

Practice ★

  1. Let A = (3−375)\begin{pmatrix} 3 & -3 \\ 7 & 5 \end{pmatrix} and B = (−4−4−55)\begin{pmatrix} -4 & -4 \\ -5 & 5 \end{pmatrix}. What is the entry in row 1, column 2 of A + B?
  2. Let A = (2761)\begin{pmatrix} 2 & 7 \\ 6 & 1 \end{pmatrix} and B = (5−555)\begin{pmatrix} 5 & -5 \\ 5 & 5 \end{pmatrix}. What is the entry in row 1, column 2 of A + B?
  1. A shop records sales in a matrix with one row for each of its 4 stores and one column for each of 7 days. What are the dimensions of the matrix?
    1. 4 × 7
    2. 7 × 4
    3. 28 × 1

Watch out!

Practice ★★

  1. Let A = (2062)\begin{pmatrix} 2 & 0 \\ 6 & 2 \end{pmatrix}. What is the entry in row 2, column 1 of 3A?
  2. Let A = (82−1−3)\begin{pmatrix} 8 & 2 \\ -1 & -3 \end{pmatrix}. What is the entry in row 2, column 1 of 3A?
  1. Let A = (3−375)\begin{pmatrix} 3 & -3 \\ 7 & 5 \end{pmatrix} and B = (−4−4−55)\begin{pmatrix} -4 & -4 \\ -5 & 5 \end{pmatrix}. What is the entry in row 1, column 2 of A + B?

Exit ticket

Three questions to check you have got it.

  1. Let A = (3−375)\begin{pmatrix} 3 & -3 \\ 7 & 5 \end{pmatrix} and B = (−4−4−55)\begin{pmatrix} -4 & -4 \\ -5 & 5 \end{pmatrix}. What is the entry in row 1, column 2 of A + B?
  2. Let A = (2761)\begin{pmatrix} 2 & 7 \\ 6 & 1 \end{pmatrix} and B = (5−555)\begin{pmatrix} 5 & -5 \\ 5 & 5 \end{pmatrix}. What is the entry in row 1, column 2 of A + B?
  3. Let A = (4618)\begin{pmatrix} 4 & 6 \\ 1 & 8 \end{pmatrix} and B = (7259)\begin{pmatrix} 7 & 2 \\ 5 & 9 \end{pmatrix}. What is the entry in row 1, column 2 of A + B?

Summary card

Matrices

Size is rows × columns; add entry by entry; a scalar multiplies every entry.

Watch out: rows first.

2. Multiplying matrices and its properties

Warm-up

Three quick questions from earlier lessons.

Discover

To multiply a row (2, 3) by a column (4, 5), you compute 2 · 4 + 3 · 5. What is it?

  1. 23
  2. (8, 15)

Key idea

Each entry of AB is a row of A times a column of B.

If AA is m×nm \times n and BB is n×pn \times p, then ABAB is m×pm \times p: the entry in row ii, column jj is row ii of AA times column jj of BB (multiply pairs, then add). The inner sizes must match. Matrix multiplication is associative and distributes over addition, but in general AB≠BAAB \ne BA.

Worked example

Compute the top-left entry of (1234)(5678)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}.

(1, 2) and (5, 7)
Row 1 of A, column 1 of B.
1 · 5 + 2 · 7 = 19
Multiply and add.

Your turn, guided

Your turn: the top-right entry of the same product.

2222
1 · 6 + 2 · 8.

Practice ★

  1. Let A = (423−2)\begin{pmatrix} 4 & 2 \\ 3 & -2 \end{pmatrix} and B = (7954)\begin{pmatrix} 7 & 9 \\ 5 & 4 \end{pmatrix}. What is the entry in row 1, column 1 of AB?
  2. Let A = (−2−45−4)\begin{pmatrix} -2 & -4 \\ 5 & -4 \end{pmatrix} and B = (47−5−1)\begin{pmatrix} 4 & 7 \\ -5 & -1 \end{pmatrix}. What is the entry in row 1, column 1 of AB?
  1. A is a 2 × 5 matrix and B is a 5 × 8 matrix. What are the dimensions of AB?
    1. 2 × 8
    2. 5 × 5
    3. AB is not defined

Watch out!

Practice ★★

  1. Let A = (8884)\begin{pmatrix} 8 & 8 \\ 8 & 4 \end{pmatrix} and B = (2332)\begin{pmatrix} 2 & 3 \\ 3 & 2 \end{pmatrix}. What is the entry in row 2, column 1 of AB?
  2. Let A = (182−2)\begin{pmatrix} 1 & 8 \\ 2 & -2 \end{pmatrix} and B = (2−556)\begin{pmatrix} 2 & -5 \\ 5 & 6 \end{pmatrix}. What is the entry in row 2, column 1 of AB?
  1. Boss problem. A stand sells pens and notebooks. The sales matrix S = (9537)\begin{pmatrix} 9 & 5 \\ 3 & 7 \end{pmatrix} has rows Monday, Tuesday and columns pens, notebooks. The price vector is p = (36)\begin{pmatrix} 3 \\ 6 \end{pmatrix} (dollars). The product Sp gives each day's income.

Exit ticket

Three questions to check you have got it.

  1. Let A = (423−2)\begin{pmatrix} 4 & 2 \\ 3 & -2 \end{pmatrix} and B = (7954)\begin{pmatrix} 7 & 9 \\ 5 & 4 \end{pmatrix}. What is the entry in row 1, column 1 of AB?
  2. Let A = (−2−45−4)\begin{pmatrix} -2 & -4 \\ 5 & -4 \end{pmatrix} and B = (47−5−1)\begin{pmatrix} 4 & 7 \\ -5 & -1 \end{pmatrix}. What is the entry in row 1, column 1 of AB?
  3. Let A = (5804)\begin{pmatrix} 5 & 8 \\ 0 & 4 \end{pmatrix} and B = (41−23)\begin{pmatrix} 4 & 1 \\ -2 & 3 \end{pmatrix}. What is the entry in row 1, column 1 of AB?

Summary card

Multiplying matrices

(m × n)(n × p) = m × p; entry = row · column.

Watch out: AB is usually not BA.

3. Identity, determinant and inverse of a 2 × 2 matrix

Warm-up

Three quick questions from earlier lessons.

Discover

The number 5 has the inverse 1/5 because 5 · 1/5 = 1. Which number has no inverse?

  1. 0
  2. 1

Key idea

A 2 × 2 matrix has an inverse exactly when its determinant is not 0.

The identity I=(1001)I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} plays the role of 1 (AI=IA=AAI = IA = A) and the zero matrix the role of 0. For A=(abcd)A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}, det⁡A=ad−bc\det A = ad - bc. If det⁡A≠0\det A \ne 0, A−1=1ad−bc(d−b−ca)A^{-1} = \dfrac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix} and AA−1=IAA^{-1} = I; if det⁡A=0\det A = 0, AA has no inverse.

Worked example

Invert (4726)\begin{pmatrix} 4 & 7 \\ 2 & 6 \end{pmatrix}.

4 · 6 − 7 · 2 = 10
Determinant.
(6−7−24)\begin{pmatrix} 6 & -7 \\ -2 & 4 \end{pmatrix}
Swap and change signs.
(0.6−0.7−0.20.4)\begin{pmatrix} 0.6 & -0.7 \\ -0.2 & 0.4 \end{pmatrix}
Divide by 10.

Your turn, guided

Your turn: det (3152)\begin{pmatrix} 3 & 1 \\ 5 & 2 \end{pmatrix}.

11
3 · 2 − 1 · 5.

Practice ★

  1. What is the determinant of (−2−584)\begin{pmatrix} -2 & -5 \\ 8 & 4 \end{pmatrix}?
  2. What is the determinant of (7354)\begin{pmatrix} 7 & 3 \\ 5 & 4 \end{pmatrix}?
  1. For which value of k does (k3102)\begin{pmatrix} k & 3 \\ 10 & 2 \end{pmatrix} have no inverse?

Watch out!

Practice ★★

  1. Let A = (5318)\begin{pmatrix} 5 & 3 \\ 1 & 8 \end{pmatrix}. What is the entry in row 1, column 1 of the inverse of A?
  2. Let A = (−5274)\begin{pmatrix} -5 & 2 \\ 7 & 4 \end{pmatrix}. What is the entry in row 1, column 1 of the inverse of A?
  1. What is the determinant of (−2−584)\begin{pmatrix} -2 & -5 \\ 8 & 4 \end{pmatrix}?

Exit ticket

Three questions to check you have got it.

  1. What is the determinant of (−2−584)\begin{pmatrix} -2 & -5 \\ 8 & 4 \end{pmatrix}?
  2. What is the determinant of (7354)\begin{pmatrix} 7 & 3 \\ 5 & 4 \end{pmatrix}?
  3. What is the determinant of (7837)\begin{pmatrix} 7 & 8 \\ 3 & 7 \end{pmatrix}?

Summary card

Determinants and inverses

det = ad − bc; inverse = (1/det)(d, −b; −c, a) when det ≠ 0.

Watch out: the inverse is not the matrix of reciprocals.

4. Matrices as transformations: matrix times vector, determinant and area

Warm-up

Three quick questions from earlier lessons.

Discover

Doubling both coordinates of every point of a square with area 1 gives a square with area…

  1. 4
  2. 2

Key idea

A matrix moves vectors; its determinant scales areas.

Multiplying a column vector by a matrix gives a new vector: (abcd)(xy)=(ax+bycx+dy)\begin{pmatrix} a & b \\ c & d \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} ax + by \\ cx + dy \end{pmatrix}. So a 2×22 \times 2 matrix is a transformation of the plane; its columns are the images of (1,0)(1, 0) and (0,1)(0, 1). Areas are multiplied by ∣det⁡A∣|\det A|.

Worked example

Apply (0−110)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} to (3, 0) and (0, 3).

(0 · 3 − 1 · 0, 1 · 3 + 0) = (0, 3)
First point.
(−3, 0)
Second point.
a 90° counterclockwise rotation; det = 1, areas unchanged
Conclusion.

Your turn, guided

Your turn: the area scale factor of (3002)\begin{pmatrix} 3 & 0 \\ 0 & 2 \end{pmatrix}.

66
det = 3 · 2.

Practice ★

  1. Let A = (9236)\begin{pmatrix} 9 & 2 \\ 3 & 6 \end{pmatrix}. What is the first component of A(−3−1)\begin{pmatrix} -3 \\ -1 \end{pmatrix}?
  2. Let A = (−15−5−5)\begin{pmatrix} -1 & 5 \\ -5 & -5 \end{pmatrix}. What is the first component of A(3−2)\begin{pmatrix} 3 \\ -2 \end{pmatrix}?
  1. The matrix (0−110)\begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} maps the point (8, 0) to (0, 8) and (0, 8) to (−8, 0). Which transformation does it represent?
    1. A rotation of 90° counterclockwise about the origin
    2. A reflection in the line y = x
    3. A rotation of 90° clockwise about the origin

Watch out!

Practice ★★

  1. A shape with an area of 2 square units is transformed by the matrix (2223)\begin{pmatrix} 2 & 2 \\ 2 & 3 \end{pmatrix}. What is the area of the image?
  2. A shape with an area of 8 square units is transformed by the matrix (2213)\begin{pmatrix} 2 & 2 \\ 1 & 3 \end{pmatrix}. What is the area of the image?
  1. Let A = (9236)\begin{pmatrix} 9 & 2 \\ 3 & 6 \end{pmatrix}. What is the first component of A(−3−1)\begin{pmatrix} -3 \\ -1 \end{pmatrix}?

Exit ticket

Three questions to check you have got it.

  1. Let A = (9236)\begin{pmatrix} 9 & 2 \\ 3 & 6 \end{pmatrix}. What is the first component of A(−3−1)\begin{pmatrix} -3 \\ -1 \end{pmatrix}?
  2. Let A = (−15−5−5)\begin{pmatrix} -1 & 5 \\ -5 & -5 \end{pmatrix}. What is the first component of A(3−2)\begin{pmatrix} 3 \\ -2 \end{pmatrix}?
  3. Let A = (7−1−27)\begin{pmatrix} 7 & -1 \\ -2 & 7 \end{pmatrix}. What is the first component of A(61)\begin{pmatrix} 6 \\ 1 \end{pmatrix}?

Summary card

Matrices as transformations

Av moves vectors; columns are the images of (1, 0) and (0, 1); areas scale by |det|.

Watch out: the area factor is the determinant, not a sum of entries.

5. Solving systems of linear equations with matrices

Warm-up

Three quick questions from earlier lessons.

Discover

To solve 5x = 20 you multiply both sides by 1/5. What does that give?

  1. x = 4
  2. x = 100

Key idea

A system is one matrix equation AX = B; X = A⁻¹B.

Write the coefficients as a matrix AA (one row per equation), the unknowns as X=(xy)X = \begin{pmatrix} x \\ y \end{pmatrix} and the constants as BB: then AX=BAX = B. If det⁡A≠0\det A \ne 0, X=A−1BX = A^{-1}B, the only solution.

Worked example

Solve 2x + y = 5, x + y = 3.

A=(2111)A = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}, det = 1
Matrix.
A−1=(1−1−12)A^{-1} = \begin{pmatrix} 1 & -1 \\ -1 & 2 \end{pmatrix}
Inverse.
x = 5 − 3 = 2, y = −5 + 6 = 1
Multiply.

Your turn, guided

Your turn: in that system, what is det A?

11
2 · 1 − 1 · 1.

Practice ★

  1. Which matrix equation represents the system 4x + 5y = 18 and 4x + 2y = 35?
    1. (4542)(xy)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    2. (4452)(xy)\begin{pmatrix} 4 & 4 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    3. (4542)(1835)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} 18 \\ 35 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  2. Which matrix equation represents the system 9x + 9y = 13 and 2x + 4y = 10?
    1. (9924)(xy)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    2. (9294)(xy)\begin{pmatrix} 9 & 2 \\ 9 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    3. (9924)(1310)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} 13 \\ 10 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  1. Solve the system 4x + 4y = 0 and 3x + 1y = 10 by multiplying by the inverse of the coefficient matrix. What is x?

Watch out!

Practice ★★

  1. Solve the system 4x + 4y = 0 and 3x + 1y = 10 by multiplying by the inverse of the coefficient matrix. What is x?
  2. Solve the system 4x + 1y = 20 and 1x + 1y = 5 by multiplying by the inverse of the coefficient matrix. What is x?
  1. Which matrix equation represents the system 4x + 5y = 18 and 4x + 2y = 35?
    1. (4542)(xy)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    2. (4452)(xy)\begin{pmatrix} 4 & 4 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    3. (4542)(1835)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} 18 \\ 35 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}

Exit ticket

Three questions to check you have got it.

  1. Which matrix equation represents the system 4x + 5y = 18 and 4x + 2y = 35?
    1. (4542)(xy)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    2. (4452)(xy)\begin{pmatrix} 4 & 4 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    3. (4542)(1835)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} 18 \\ 35 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  2. Which matrix equation represents the system 9x + 9y = 13 and 2x + 4y = 10?
    1. (9924)(xy)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    2. (9294)(xy)\begin{pmatrix} 9 & 2 \\ 9 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    3. (9924)(1310)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} 13 \\ 10 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  3. Which matrix equation represents the system 6x + 2y = 32 and 6x + 4y = 39?
    1. (6264)(xy)\begin{pmatrix} 6 & 2 \\ 6 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (3239)\begin{pmatrix} 32 \\ 39 \end{pmatrix}
    2. (6624)(xy)\begin{pmatrix} 6 & 6 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (3239)\begin{pmatrix} 32 \\ 39 \end{pmatrix}
    3. (6264)(3239)\begin{pmatrix} 6 & 2 \\ 6 & 4 \end{pmatrix}\begin{pmatrix} 32 \\ 39 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}

Summary card

Systems with matrices

AX = B, so X = A⁻¹B when det A ≠ 0.

Watch out: one row per equation; multiply by A⁻¹ on the left.