Matrix multiplication is composition
Which single matrix represents two transformations of the plane applied in sequence?
Follow e₁ and e₂ through both transformations. Their final positions form the two columns of one matrix, and that matrix is the product of the two.
Before you start · 3 quick checks on matrices and functions, about 2 min
From the previous page: a 2×2 matrix \(A\) moves the plane, its columns are \(Ae_1\) and \(Ae_2\), the images of \(e_1 = (1, 0)\) and \(e_2 = (0, 1)\), and \(Ax = x_1(\text{column } 1) + x_2(\text{column } 2)\) for \(x = (x_1, x_2)\).
This page uses four basic moves. Each column is where the move sends \(e_1\) or \(e_2\).
- \(R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}\): rotate by 90° counterclockwise about the origin.
- \(M = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\): mirror in the \(x_1\)-axis.
- \(S = \begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix}\): stretch by 2 along the \(x_1\)-axis.
- \(H = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}\): shear sideways, \((x_1, x_2) \mapsto (x_1 + x_2, x_2)\).
The identity \(I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\) leaves every point where it is.
If a point \(x\) is moved first by a matrix \(B\), to \(Bx\), and the result is then moved by \(A\), it ends at \(A(Bx)\). This two-step map is written \(x \mapsto A(Bx)\). As in \(f(g(x))\), the map applied first is the one next to \(x\).
How the pictures on this page are drawn
Each picture starts from the ordinary grid. The shaded region is the image of the unit square, the square with corners \(0\), \(e_1\), \(e_1 + e_2\) and \(e_2\), and the F drawn in it shows the square's orientation: a turned F and a mirrored F can be told apart.
The two colored arrows end where \(e_1\) and \(e_2\) land. Their end points are the columns of the matrix of the map that is drawn.
Does the order of two moves matter?
Answer with one click. The page then draws both orders and their matrices.
Four more pairs open after you answer.
Four more pairs
Predict each pair with one click, then see both orders.
Build the goal from four moves
One question first, on how the page writes a sequence of moves. The builder opens when you have answered it.
The builder opens when you have answered the question above.
Press the moves in the order you want them made, at most 6. The page multiplies their matrices, first move on the right, and draws the result. A goal counts only when your product equals the goal's matrix exactly.
Why a product is computed row times column
Let \(A\) and \(B\) be any two 2×2 matrices, and let \(T\) be the map \(x \mapsto A(Bx)\): first \(B\), then \(A\). Then \(T\) is linear, so it has a matrix; that matrix is called the product \(AB\). Column \(j\) of \(AB\) is \(A\) times column \(j\) of \(B\), and the entry in row \(i\) and column \(j\) is
\[ (AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j}, \]row \(i\) of \(A\) dotted with column \(j\) of \(B\). Here \(a_{ik}\) is the entry of \(A\) in row \(i\) and column \(k\), and \(b_{kj}\) is the entry of \(B\) in row \(k\) and column \(j\).
Build the proof one line at a time. Each line has one correct choice.
Rules that follow
Associativity. For 2×2 matrices \(A\), \(B\) and \(C\), \((AB)C = A(BC)\). By the theorem, used twice on each side,
\[ \begin{aligned} ((AB)C)x &= (AB)(Cx) \\ &= A(B(Cx)), \\ (A(BC))x &= A((BC)x) \\ &= A(B(Cx)). \end{aligned} \]Both are the matrix of “first \(C\), then \(B\), then \(A\)”, and two matrices that give the same map have the same columns, so they are equal. A product of three matrices needs no brackets: \(ABC\). This holds because doing maps one after another is associative, whatever the maps.
The identity. \(Ix = x\) for every \(x\), so \(A(Ix) = Ax\) and \(I(Ax) = Ax\): \(AI = IA = A\) for every \(A\).
A 2×2 matrix \(A\) is invertible if there is a matrix \(A^{-1}\) with \(A^{-1}A = AA^{-1} = I\): the map \(A^{-1}\) undoes \(A\). If \(A\) and \(B\) are invertible, then \(AB\) is invertible and \((AB)^{-1} = B^{-1}A^{-1}\). By associativity,
\[ \begin{aligned} (B^{-1}A^{-1})(AB) &= B^{-1}(A^{-1}A)B \\ &= B^{-1}IB = B^{-1}B = I, \\ (AB)(B^{-1}A^{-1}) &= A(BB^{-1})A^{-1} \\ &= AIA^{-1} = AA^{-1} = I. \end{aligned} \]Socks and shoes: you put on socks first and shoes second, and you take off the shoes first. The map \(AB\) does \(B\) first and \(A\) last, so its inverse undoes \(A\) first: in \(B^{-1}A^{-1}\), the factor \(A^{-1}\) stands on the right and acts first.
Problems
Each problem has hints and a full solution. Where the answer is a matrix \(\begin{pmatrix} a & b \\ c & d \end{pmatrix}\), type its entries row by row, a, b, c, d, separated by commas; the forms [[a, b], [c, d]] and a, b; c, d are read too. Answers are graded exactly: type whole numbers, exact decimals such as 0.5, or fractions such as 1/2.
Next in linear algebra: What the determinant measures (in preparation).
Further reading
- G. Strang, Introduction to Linear Algebra, 5th ed. (Wellesley-Cambridge Press, 2016), section 2.4 (Rules for Matrix Operations) and section 2.5 (Inverse Matrices).
- D. C. Lay, S. R. Lay and J. J. McDonald, Linear Algebra and Its Applications, 5th ed. (Pearson, 2016), sections 2.1 and 2.2 (Matrix Operations; The Inverse of a Matrix).
- S. Axler, Linear Algebra Done Right, 4th ed. (Springer, 2024), section 3C (Matrices), on the matrix of a product of linear maps.