๐งฎ Linear Algebra Kingdom ยท Linear Algebra
Linear Transformations
A function that moves every vector at once, and the matrix that describes it: test the two rules a linear map obeys, build the standard matrix from the images of the basis vectors, recognise rotations, reflections, scalings and shears, and read a composition as a matrix product.
In short
- A map is linear when it keeps sums and keeps scalar multiples; a quick consequence is that it must send the zero vector to the zero vector.
- Every linear map is a matrix, and the columns of that matrix are the images of the standard basis vectors, standing up in order.
- Doing one map after another multiplies their matrices, with the map that acts first on the right โ and swapping the order usually changes the map.
- A pivot in every column means one-to-one; a pivot in every row means onto.
A map that keeps the grid straight
Lens-keeper Ash does not think about one vector at a time. She thinks about what a map does to everything at once โ and the only maps worth a lens are the ones that leave the ruled grid of the isle looking like a ruled grid afterwards: lines stay lines, the origin stays put, and evenly spaced marks stay evenly spaced.
Written down, that comes to two rules. A map T is a linear transformation when, for every pair of vectors u and v and every number c:
- it keeps sums: T(u + v) = T(u) + T(v)
- it keeps scalar multiples: T(cu) = cT(u)
Between them, those two say that whatever you do to the inputs โ add them, stretch them, mix them โ you may just as well do it to the outputs instead. That is the whole idea, and everything else in this craft is a consequence of it.
Here is the cheapest consequence, and the first test to run every time. Put c = 0 in the second rule: T(0u) = 0T(u), which reads T(0) = 0. A linear map must send the zero vector to the zero vector. So if a formula carries a constant on the end โ T(x, y) = (x + 4, y) โ it moves the origin, and it is not linear. One line of arithmetic settles it.
The second test is nearly as cheap. Take u = (1, 1) and compare T(2u) with 2T(u). A squared term or a product of two variables will not survive it: if the first component is x2 then doubling the input multiplies that component by 4, not by 2.
Between them the two tests catch everything you will meet. A map is linear exactly when every component is a sum of multiples of the variables โ no constants, no powers, no products of two variables, nothing under a square root.
Every linear map is a matrix
This is the theorem the whole subject turns on. Take any vector x = (x1, x2) and split it up using the standard basis vectors e1 = (1, 0) and e2 = (0, 1):
x = x1(1, 0) + x2(0, 1) = x1*e1 + x2*e2
Now push it through a linear map and let the two rules do the work:
T(x) = T(x1*e1 + x2*e2) = x1*T(e1) + x2*T(e2)
Read that carefully. It says T is completely decided by two vectors: what it does to e1 and what it does to e2. Know those, and you know what T does to every vector in the plane, for ever.
So we store them. Stand T(e1) up as the first column and T(e2) up as the second, and you have the standard matrix A of T, with T(x) = Ax:
A = [[first entry of T(e1), first entry of T(e2)], [second entry of T(e1), second entry of T(e2)]]
Images stand up as columns, never lying down as rows. Writing them as rows gives the transpose, which is a different map, and it is the single most common slip in this section.
Working out Ax. Each entry of the answer comes from one whole row of A meeting the whole of x: pair the entries up in order, multiply, and add.
[[2, -1], [3, 4]] applied to (5, 1) = ((2)(5) + (-1)(1), (3)(5) + (4)(1)) = (9, 19)
The shapes have to agree: A must have as many columns as x has entries, and the answer has as many entries as A has rows. A 2 by 3 matrix eats a vector of R3 and hands back a vector of R2.
The maps you can name
A handful of maps of the plane come up so often that their matrices are worth recognising on sight. Every one of them is built the same way โ send (1, 0) somewhere, send (0, 1) somewhere, stand the two images up as columns:
- reflection in the x-axis: (1, 0) stays, (0, 1) flips to (0, -1), so A = [[1, 0], [0, -1]]
- reflection in the y-axis: A = [[-1, 0], [0, 1]]
- reflection in the line y = x: the coordinates trade places, so A = [[0, 1], [1, 0]]
- rotation of 90 degrees anticlockwise: (1, 0) swings up to (0, 1) and (0, 1) swings round to (-1, 0), so A = [[0, -1], [1, 0]]
- rotation of 180 degrees: A = [[-1, 0], [0, -1]]
- rotation of 270 degrees anticlockwise: A = [[0, 1], [-1, 0]]
- scaling by k about the origin: A = [[k, 0], [0, k]]
- horizontal shear sending (0, 1) to (k, 1): A = [[1, k], [0, 1]]
The two rotations are the pair worth being careful about: they are transposes of each other, so writing the images as rows turns a quarter-turn one way into a quarter-turn the other way. If you are unsure, draw the arrow (1, 0), turn it, and look at where its tip lands.
Notice that none of these has a constant anywhere. A translation โ sliding the whole plane two steps to the right โ is not a linear transformation at all, because it moves the origin. It is a perfectly good map, it is just not one a single matrix of this kind can hold.
One map after another, and what a map can reach
Do R first and then S, and you have a new transformation T with T(x) = S(R(x)). Because R(x) is just Rx, that reads T(x) = S(Rx) = (SR)x: the matrix of a composition is the product of the matrices.
The order is the part to be careful with. The map that acts first stands on the right, next to x, because that is the one x meets first. And matrix multiplication does not commute, so SR and RS are usually different maps: rotate then reflect and you land somewhere else than reflect then rotate. Try it with your hands on a book cover.
Two more questions get asked of every transformation, and one row reduction answers both.
One-to-one asks whether two different inputs can ever share an image. They cannot exactly when every column of A carries a pivot โ no column is left free, so nothing but the zero vector is sent to zero.
Onto asks whether every vector of the codomain can be reached. It can exactly when every row of A carries a pivot.
So count the pivots once, then compare that count with the number of columns and with the number of rows. Shapes settle some cases before you start: a map from R3 to R2 has more columns than rows and can never be one-to-one, and a map from R2 to R3 can never be onto.
Worked examples
Example 1
Is T(x, y) = (2x - y, x + 3) a linear transformation?
- Run the cheapest test first: T(0, 0) = ((2)(0) - 0, 0 + 3) = (0, 3).
- A linear map must send the zero vector to the zero vector, and this one does not: the constant 3 in the second component moves the origin.
- That breaks both rules at once. Check the second directly to see it: T(2, 2) = (2, 5) while 2T(1, 1) = 2(1, 4) = (2, 8).
- So T is not linear. The first component was fine; a single constant anywhere is enough.
Example 2
T is linear with T(1, 0) = (3, -1) and T(0, 1) = (2, 4). Write the standard matrix of T, and find T(5, 2).
- The columns of the standard matrix are the images of the basis vectors, standing up in order.
- The first column is (3, -1) and the second is (2, 4), so A = [[3, 2], [-1, 4]].
- Now apply it: row 1 gives (3)(5) + (2)(2) = 19, and row 2 gives (-1)(5) + (4)(2) = 3.
- So T(5, 2) = (19, 3). Checking against linearity directly: 5T(1, 0) + 2T(0, 1) = 5(3, -1) + 2(2, 4) = (19, 3).
Example 3
R is the reflection in the x-axis and S is the rotation of 90 degrees anticlockwise. Find the matrix of the map that does R first and then S.
- Write the two matrices down: R = [[1, 0], [0, -1]] and S = [[0, -1], [1, 0]].
- R acts first, so it stands on the right and the matrix wanted is SR.
- Entry (1, 1) is (0)(1) + (-1)(0) = 0; entry (1, 2) is (0)(0) + (-1)(-1) = 1; entry (2, 1) is (1)(1) + (0)(0) = 1; entry (2, 2) is (1)(0) + (0)(-1) = 0.
- So SR = [[0, 1], [1, 0]], which is the reflection in the line y = x. Multiplying the other way round gives RS = [[0, -1], [-1, 0]], a different map โ the order really does matter.
Practice problems, with solutions
Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.
Problem 1
Difficulty 1 of 5T(x, y) = (2x, 2x + y + 2) Is T a linear transformation? Pick the statement that is true.
- T is not linear: T does send the zero vector to the zero vector, but T(2u) is not 2T(u).
- T is not linear: T sends the zero vector somewhere else, so both rules break down.
- T is not linear: T(u + v) = T(u) + T(v) holds for every u and v, but T(cu) = cT(u) never does.
- T is linear: T(u + v) = T(u) + T(v) and T(cu) = cT(u) both hold.
Answer: B. T is not linear: T sends the zero vector somewhere else, so both rules break down.
- Test the zero vector first: T(0, 0) = (0, 2).
- A linear map must send the zero vector to the zero vector, because T(0u) = 0T(u).
- That one line breaks both rules at once โ for instance T(2, 2) = (4, 8) while 2T(1, 1) = (4, 10).
Problem 2
Difficulty 3 of 5T is the linear transformation T(x) = Ax, with A = [[3, -5], [5, 0]] and x = [1, 3]. Find T(x). Type the image as a pair, for example (3, -4).
Answer: (-12, 5)
- A has 2 rows and 2 columns, and x has 2 entries, so the image has 2 entries.
- Row 1: (3)(1) + (-5)(3) = -12 Row 2: (5)(1) + (0)(3) = 5
- So T(x) = [-12, 5].
Problem 3
Difficulty 4 of 5T is a linear transformation and T([1, 0, 0]) = [3, -6] T([0, 1, 0]) = [6, -5] T([0, 0, 1]) = [0, 3] Write the standard matrix A of T, the matrix with T(x) = Ax. Write the matrix row by row, entries separated by commas and rows by a semicolon, like 1,2;3,4.
Answer: [[3,6,0],[-6,-5,3]]
- The columns of the standard matrix are the images of the standard basis vectors, in order.
- Column 1 is [3, -6]. Column 2 is [6, -5]. Column 3 is [0, 3].
- Standing them up side by side gives A = [[3, 6, 0], [-6, -5, 3]].
Common mistakes
- Writing the images of the basis vectors as rows instead of columns, which builds the transpose and turns a quarter-turn into the opposite quarter-turn.
- Multiplying the matrices of a composition in the order the sentence names them, instead of putting the map that acts first on the right next to x.
- Calling a map with a constant term linear because the rest of it looks like multiples of the variables; a constant moves the origin, and that is enough on its own.
What you should be able to do
- Decide whether a map is linear, and name the rule that fails when it is not.
- Find the image of a vector under a transformation given by a matrix.
- Build the standard matrix of a transformation from the images of the basis vectors.
- Recognise the matrix of a rotation, reflection, scaling or shear, and compose two transformations by multiplying their matrices.
Where this fits in the curriculum
Common Core
- HSN-VM.C.8
High school โ Add, subtract and multiply matrices of appropriate dimensions.
HSN-VM.C.8 is a (+) standard โ beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. Composing two transformations is the product of their matrices, which is why this standard belongs to the craft as much as HSN-VM.C.11 does.
- HSN-VM.C.11
High school โ Multiply a vector (regarded as a matrix with one column) by a matrix of suitable dimensions to produce another vector; work with matrices as transformations of vectors.
HSN-VM.C.11 is a (+) standard โ beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.
- HSN-VM.C.12
High school โ Work with 2 ร 2 matrices as transformations of the plane, and interpret the absolute value of the determinant in terms of area.
HSN-VM.C.12 is a (+) standard โ beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.