📘 CodingMarble Learn

Matrices as Functions: Linear Transformations

A 2×2 matrix is a function that takes a vector in and gives a vector out. Its first column is where ⟨1, 0⟩ lands and its second column is where ⟨0, 1⟩ lands. The determinant ad − bc tells how areas scale; when it is not zero, the inverse matrix undoes the change. Transition matrices use the same rule to model how shares change step by step.

🎬 Step-by-step story

  1. A matrix is a machine: vector in, vector out. [[2,1],[0,1]] moves the point ⟨1,1⟩ to ⟨3,1⟩.
  2. Column 1 shows where i = ⟨1,0⟩ lands; column 2 shows where j = ⟨0,1⟩ lands. The unit square becomes a parallelogram.
  3. A rotation matrix turns every point around the origin by the same angle. Lengths stay the same.
  4. The determinant ad − bc is the area scale factor. If it is not 0, an inverse matrix undoes the move.
  5. A transition matrix models a real context: each year some people move between two cities.
  6. Free play: change a, b, c, d and watch the square, i, j and the determinant.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

How do I multiply a matrix by a vector without getting lost?

Go row by row: first row times the vector gives the new x; second row gives the new y. Multiply matching numbers and add.

Why are the columns so important?

Every vector is x·i + y·j. If you know where i and j land (the columns), every other point follows the same recipe.

Why doesn't a rotation change size?

Its columns ⟨cos θ, sin θ⟩ and ⟨−sin θ, cos θ⟩ both have length 1 and stay at right angles, and its determinant is cos²θ + sin²θ = 1.

What does a negative determinant mean?

The area is scaled by |det|, and the shape is also flipped like a mirror image (i and j swap their order).

Why do the city shares stop changing?

At ⟨0.75, 0.25⟩ the people leaving A (10% of 0.75 = 0.075) exactly equal the people arriving from B (30% of 0.25 = 0.075).

What happens if the two columns are parallel?

The square squashes flat to a line, the determinant is 0, and there is no inverse. Try a = 1, b = 2, c = 1, d = 2 in free play.

A matrix as a function

A matrix is a rectangle of numbers. A 2×2 matrix A = [[a, b], [c, d]] can act as a function: give it a vector ⟨x, y⟩ and it gives back

A⟨x, y⟩ = ⟨ax + by, cx + dy⟩

Each output part is a row of the matrix "times" the input (multiply matching numbers, then add). Such a function is called a linear transformation: it keeps the origin fixed, keeps straight lines straight, and keeps evenly spaced grid lines evenly spaced.

Columns, common transformations and composition

Put in i = ⟨1, 0⟩: you get ⟨a, c⟩, the first column. Put in j = ⟨0, 1⟩: you get ⟨b, d⟩, the second column. So to build a matrix, ask "where should i go?" and "where should j go?" and write those as columns.

Composition: doing B first, then A, is the single matrix AB (the one done first goes on the right). Order matters: usually AB ≠ BA.

Determinant and inverse

The determinant det A = ad − bc. The unit square (area 1) becomes a parallelogram with area |ad − bc|. A negative determinant means the shape was also flipped over.

If det A ≠ 0, A has an inverse A⁻¹ that undoes it:

A⁻¹ = (1 ÷ (ad − bc)) × [[d, −b], [−c, a]]

Swap a and d, change the signs of b and c, then divide by the determinant. If det A = 0, the plane is squashed onto a line (or a point), information is lost, and no inverse exists.

Matrices modelling contexts

A transition matrix describes how things move between states in one time step. Example: each year 90% of people in City A stay and 10% move to City B; 70% of City B stays and 30% moves to A. With shares written as a row ⟨A, B⟩:

next = ⟨A, B⟩ × [[0.9, 0.1], [0.3, 0.7]] = ⟨0.9A + 0.3B, 0.1A + 0.7B⟩

Starting at ⟨0.5, 0.5⟩: year 1 gives ⟨0.6, 0.4⟩, year 2 gives ⟨0.66, 0.34⟩, and the shares slowly settle at ⟨0.75, 0.25⟩, a steady state that the matrix leaves unchanged. To go back one year, multiply by the inverse.

Try it: In 3D step 5 press "Next year" again and again, and predict the next bar heights before you press.

Key formulas and definitions

Worked examples

1. A = [[3, −1], [2, 4]]. Find A⟨2, 1⟩.

Top: 3·2 + (−1)·1 = 5. Bottom: 2·2 + 4·1 = 8. Answer ⟨5, 8⟩.

2. Write the matrix that sends i to ⟨2, 1⟩ and j to ⟨−1, 3⟩.

The columns are the images: [[2, −1], [1, 3]].

3. Find the matrix that rotates by 90° anticlockwise and use it on ⟨3, 1⟩.

cos 90° = 0, sin 90° = 1, so [[0, −1], [1, 0]]. ⟨3, 1⟩ → ⟨0·3 − 1·1, 1·3 + 0·1⟩ = ⟨−1, 3⟩.

4. A triangle has area 6. It is transformed by [[2, 1], [1, 3]]. Find the new area.

det = 2·3 − 1·1 = 5. New area = 5 × 6 = 30.

5. Find the inverse of A = [[4, 7], [2, 6]].

det = 24 − 14 = 10. A⁻¹ = (1/10)[[6, −7], [−2, 4]] = [[0.6, −0.7], [−0.2, 0.4]].

6. With the city matrix [[0.9, 0.1], [0.3, 0.7]] and start shares ⟨0.6, 0.4⟩, find next year's shares.

A: 0.6·0.9 + 0.4·0.3 = 0.54 + 0.12 = 0.66. B: 0.6·0.1 + 0.4·0.7 = 0.06 + 0.28 = 0.34. Next year ⟨0.66, 0.34⟩.

Common mistakes

Practice quiz

1. [[1, 2], [3, 4]]⟨1, 1⟩ equals:
2. The image of ⟨0, 1⟩ under [[a, b], [c, d]] is:
3. det [[3, 2], [6, 4]] is:
4. Which matrix reflects in the x-axis?
5. A rotation matrix changes areas by a factor of:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a linear transformation in simple words?

A way of moving every point of the plane using a matrix so that the origin stays put and straight, evenly spaced grid lines stay straight and evenly spaced.

How do you find the matrix of a transformation?

Find where ⟨1, 0⟩ and ⟨0, 1⟩ go and write those two vectors as the columns.

What is a transition matrix?

A matrix whose numbers are the chances (or fractions) of moving from one state to another in one step. Multiplying by it gives the next step's shares.

Where this is taught

USA (Common Core, NGSS, AP)Grade 12Functions Involving Parameters, Vectors, and Matrices

Learn first

Learn next

Related lessons

All Maths lessons