Matrices

A matrix is a rectangular array of numbers. Matrices store data neatly, but their real power is as transformations. Multiplying a vector by a 2 × 2 matrix rotates, reflects, stretches or shears it. Multiplying matrices combines transformations.

Key facts

  • Order m × n means m rows and n columns. Add or subtract only matrices of the same order, entry by entry.
  • AB exists when the number of columns of A equals the number of rows of B. Entry (i, j) is row i of A times column j of B.
  • Usually AB ≠ BA, but (AB)C = A(BC). The identity matrix I leaves everything unchanged.
  • The columns of a transformation matrix are the images of (1, 0) and (0, 1).
  • Rotation by θ anticlockwise about O: [[cos θ, −sin θ], [sin θ, cos θ]].
  • “P then Q” is the matrix QP: the first transformation goes on the right.

Worked examples

Example 1

A = [[2, 1], [3, −1]] and B = [[4, 0], [−2, 5]]. Find AB.

  1. Row 1 of A with each column of B. 2×4 + 1×(−2) = 6, 2×0 + 1×5 = 5
  2. Row 2 of A with each column of B. 3×4 + (−1)×(−2) = 14, 3×0 + (−1)×5 = −5
  3. So AB = [[6, 5], [14, −5]].

Answer: AB = [[6, 5], [14, −5]]

Example 2

Find the image of the point (3, 1) after a rotation of 90° anticlockwise about the origin.

  1. With θ = 90°: [[0, −1], [1, 0]].
  2. Multiply by the column vector (3, 1). (0×3 − 1×1, 1×3 + 0×1) = (−1, 3)

Answer: (−1, 3)

Example 3

Find the single matrix for a reflection in the y-axis followed by a rotation of 90° anticlockwise about O, and describe it.

  1. Reflection in the y-axis: [[−1, 0], [0, 1]]. Rotation: [[0, −1], [1, 0]].
  2. The first transformation goes on the right. [[0, −1], [1, 0]][[−1, 0], [0, 1]] = [[0, −1], [−1, 0]]
  3. (1, 0) goes to (0, −1) and (0, 1) goes to (−1, 0). This is a reflection in y = −x.

Answer: [[0, −1], [−1, 0]]: a reflection in y = −x

Example 4

A = [[1, 2], [3, 4]]. Find 2A.

  1. Multiply each number in the matrix by 2. 2 × 1 = 2, 2 × 2 = 4, 2 × 3 = 6, 2 × 4 = 8

Answer: [[2, 4], [6, 8]]

Example 5

Work out [[1, 2], [0, 3]] × [[2], [1]].

  1. Top row: 1 × 2 + 2 × 1 = 4
  2. Bottom row: 0 × 2 + 3 × 1 = 3

Answer: [[4], [3]]