Matrices and Determinants
Rectangles of numbers that act#
A matrix is a rectangular array of numbers, but the right mental image is a machine that moves space. A 2\times 2 matrix A sends each point (x,y) to a new point A\begin{pmatrix}x\\y\end{pmatrix}; the unit square becomes a parallelogram:

Matrix multiplication is composition of machines — apply B, then A — and that is exactly why it is computed the strange row-into-column way, and why AB \ne BA in general (rotating then stretching differs from stretching then rotating):
(AB)_{ij} = \sum_k A_{ik}B_{kj}.
The formula says: entry (i,j) of the product is row i of A dotted with column j of B — Chapter 10’s dot product, running the whole machine. Worth seeing the non-commutativity rather than taking it on trust. With A = \begin{pmatrix} 1 & 2\\ 3 & 4\end{pmatrix} and B = \begin{pmatrix} 0 & 1\\ -1 & 2\end{pmatrix}:
\begin{gathered}AB \\ = \begin{pmatrix} (1)(0)+(2)(-1) & (1)(1)+(2)(2)\\ (3)(0)+(4)(-1) & (3)(1)+(4)(2)\end{pmatrix} \\ = \begin{pmatrix} -2 & 5\\ -4 & 11\end{pmatrix}, \qquad BA \\ = \begin{pmatrix} 3 & 4\\ 5 & 6\end{pmatrix}.\end{gathered}
Not merely different numbers — a different machine. Order matters because composition is not symmetric: putting on socks then shoes is not putting on shoes then socks. Almost every surprise in linear algebra traces back to this one fact.
The identity matrix I (ones on the diagonal) is the do-nothing machine; the inverse A^{-1} is the undo button, satisfying A A^{-1} = I. For 2 \times 2:
\begin{gathered}A \\ = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \\ \Longrightarrow A^{-1} \\ = \frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}.\end{gathered}
The recipe in words: swap the diagonal, negate the off-diagonal, divide by the determinant. A full worked run, solving a system with it:
\begin{aligned}&\text{Solve } \begin{cases} 2x + 5y = 4 \\ x + 3y = 3 \end{cases} \\ &\quad \text{i.e. } A\vec x = \vec b \text{ with } A = \begin{pmatrix} 2 & 5 \\ 1 & 3\end{pmatrix},\ \vec b = \begin{pmatrix}4 \\ 3\end{pmatrix} \\ &\det A = (2)(3) - (5)(1) = 1 \\ &\quad \text{nonzero, so } A^{-1} \text{ exists} \\ &A^{-1} = \frac{1}{1}\begin{pmatrix} 3 & -5 \\ -1 & 2 \end{pmatrix} \\ &\quad \text{swap } 2,3;\ \text{negate } 5,1;\ \text{divide by } \det \\ &\vec x = A^{-1}\vec b = \begin{pmatrix} 3\cdot4 + (-5)\cdot3 \\ (-1)\cdot4 + 2\cdot3\end{pmatrix} = \begin{pmatrix} -3 \\ 2 \end{pmatrix}\end{aligned}
row-into-column, entry by entry.
Check: 2(-3) + 5(2) = 4 ✓ and (-3) + 3(2) = 3 ✓.
The determinant: an area with a sign#
The number \det A = ad - bc is the area scaling factor of the machine: the unit square (area 1) lands on a parallelogram of area |\det A|, with a negative sign if the machine flips orientation. From this single insight:
- \det A = 0 \iff the machine squashes space flat (into a line or point) — information is destroyed, so no inverse exists.
- \det(AB) = \det A \cdot \det B — scale factors multiply.
Systems of linear equations are matrix equations in disguise: A\vec x = \vec b. If \det A \ne 0, the unique solution is \vec x = A^{-1}\vec b; if \det A = 0, the system has either no solutions or infinitely many — the geometry (parallel or coincident lines) decides which.
For 3\times 3 determinants, expand along a row with alternating signs:
\begin{gathered}\det\begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i \end{pmatrix} \\ = a(ei - fh) - b(di - fg) + c(dh - eg).\end{gathered}
We will re-meet matrices in Chapter 16 with grander ambitions — vector spaces and eigenvalues (the green and purple arrows in the figure are a preview: directions the machine cannot turn, only stretch).
In the wild. Every 3D game and CGI film moves its world with 4\times4 matrices (rotate, scale, translate, project) multiplied thousands of times per frame — GPUs are, at heart, matrix-multiplication machines. That is also precisely why GPUs power AI: a neural network layer is a matrix multiplication (Chapter 21). Networks-as-graphs are stored as adjacency matrices; economies as input–output matrices (Leontief won a Nobel for it); quantum states evolve by matrix action.
If you keep one thing from this chapter: A matrix is a machine that moves space. Its determinant is the area scale factor, and \det = 0 means the machine flattened space — information destroyed, no undo.
Exercises 12
- With A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B = \begin{pmatrix} 0 & 1 \\ -1 & 2 \end{pmatrix}, compute AB and BA and confirm they differ. (Worked in this chapter — close the book and do it from memory first, then compare.)
- Find A^{-1} for A = \begin{pmatrix} 3 & 4 \\ 2 & 3 \end{pmatrix} and use it to solve 3x + 4y = 10, 2x + 3y = 7.
- For what value of k does \begin{pmatrix} 3 & k \\ 6 & 4 \end{pmatrix} have no inverse? What happens geometrically?
- Compute the determinant of \begin{pmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 2 & 1 & 0 \end{pmatrix}.
- Show that the matrix R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix} satisfies \det R_\theta = 1 and R_\alpha R_\beta = R_{\alpha+\beta}. What does this say geometrically?