20. Linear Algebra
CollegeLinear algebra is the mathematics of vectors, matrices, and the linear transformations between them — the backbone of computer graphics, data science, and quantum mechanics.
Matrices, determinants and eigenvalues
A matrix is a rectangular array of numbers. Matrix multiplication combines rows of one matrix with columns of another via dot products, and is only defined when the inner dimensions match. The identity matrix I leaves vectors unchanged; a square matrix's inverse A⁻¹, when it exists, satisfies AA⁻¹ = I.
The determinant of a 2×2 matrix [[a,b],[c,d]] is ad − bc. A matrix is invertible exactly when its determinant is non-zero — equivalently, when its rows (or columns) are linearly independent.
An eigenvector v ≠ 0 of a matrix A satisfies Av = λv for some scalar λ, its eigenvalue: the transformation stretches v without rotating it off its own line. Eigenvalues solve the characteristic equation:
Matrices as transformations of space
The most useful mental picture of a matrix is not a grid of numbers but a machine that moves every point in space — rotating, stretching, or shearing it. The determinant tells you how that machine scales area (in 2-D) or volume (in 3-D); a determinant of zero means the transformation crushes space into a lower dimension, which is exactly why such a matrix can't be undone (no inverse exists).
Eigenvectors are the special directions a transformation leaves alone, merely stretching them by the eigenvalue. This matters enormously: the natural vibration modes of a bridge, the stable population structure in ecology, the ranking behind Google's original PageRank algorithm, and the "directions of greatest variance" found by PCA in data science are all eigenvectors of some matrix built from the problem.
Worked example: eigenvalues and eigenvectors
Find the eigenvalues and eigenvectors of A = [[4, 1], [2, 3]].
- Characteristic equation: det(A − λI) = (4 − λ)(3 − λ) − (1)(2) = 0.
- Expand: 12 − 7λ + λ² − 2 = 0 → λ² − 7λ + 10 = 0 → (λ − 5)(λ − 2) = 0. Eigenvalues: λ = 5 and λ = 2.
- For λ = 5: solve (A − 5I)v = 0, i.e. [[-1,1],[2,-2]]v = 0, giving v = (1, 1).
- For λ = 2: solve (A − 2I)v = 0, i.e. [[2,1],[2,1]]v = 0, giving v = (1, −2).
Answer: eigenvalue 5 with eigenvector (1,1); eigenvalue 2 with eigenvector (1,−2) (each up to any non-zero scalar multiple).
Test your understanding
What does it mean for a matrix to be singular (non-invertible)?
Its determinant is zero, meaning the transformation squashes space into a lower dimension — for example, a 2-D transformation collapsing the whole plane onto a line. Information is lost, so there is no way to reverse it uniquely; a linear system built from such a matrix has either no solution or infinitely many.
Why must the inner dimensions match to multiply two matrices?
Each entry of the product is a dot product of a row from the first matrix with a column from the second, and a dot product requires both lists to have the same length. An m×n matrix times an n×p matrix works because each row (length n) can pair with each column (also length n).
If Av = λv, what is A²v?
A²v = A(Av) = A(λv) = λ(Av) = λ(λv) = λ²v. The eigenvector direction never changes under repeated application of A — only the eigenvalue gets raised to that power. This is why eigenvalues govern long-term, repeated behaviour (like a system evolving over many time steps).
How are eigenvalues used in real applications?
Google's original PageRank used the dominant eigenvector of a giant web-link matrix to rank pages. Structural engineers find a bridge's natural vibration frequencies as eigenvalues of its stiffness matrix. In data science, Principal Component Analysis (PCA) uses the eigenvectors of a covariance matrix to find the directions along which data varies most.
How the ideas connect
Every key idea in this chapter, branching from the core concept — use it to see the whole picture at a glance.
The key facts, visualised
Worked problems, step by step
Follow each solution line by line, then try to reproduce it on paper before moving on.
Example 1Find the determinant of [[2, 1], [3, 4]].
- Use ad - bc
- 2 x 4 - 1 x 3 = 8 - 3
- Determinant = 5
Example 2Find the eigenvalues of [[2, 0], [0, 3]].
- Solve det(A - L I) = 0
- (2 - L)(3 - L) = 0
- L = 2 or L = 3
Now you try
Work each one out first, then tap to reveal the worked answer.