Chapter 20

20. Linear Algebra

College

Linear algebra is the mathematics of vectors, matrices, and the linear transformations between them — the backbone of computer graphics, data science, and quantum mechanics.

At a glance
Core ideaA matrix is a machine that transforms every point in space.
Key termEigenvector: a direction a matrix only stretches, by its eigenvalue λ.
You can…Multiply matrices, take determinants, and find eigenvalues and eigenvectors.
Watch outA zero determinant means the matrix is singular — no inverse exists.
01 · Theory

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:

det(A − λI) = 0
02 · Explanation

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.

03 · Practical

Worked example: eigenvalues and eigenvectors

Problem

Find the eigenvalues and eigenvectors of A = [[4, 1], [2, 3]].

  1. Characteristic equation: det(A − λI) = (4 − λ)(3 − λ) − (1)(2) = 0.
  2. Expand: 12 − 7λ + λ² − 2 = 0 → λ² − 7λ + 10 = 0 → (λ − 5)(λ − 2) = 0. Eigenvalues: λ = 5 and λ = 2.
  3. For λ = 5: solve (A − 5I)v = 0, i.e. [[-1,1],[2,-2]]v = 0, giving v = (1, 1).
  4. 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).

04 · Q&A

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.

Concept mind map

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.

MatricesMatrix productDeterminantEigenvaluesEigenvectorsTransformationsLinear Algebra
Infographic

The key facts, visualised

det
Scale factor of area under the map
A v = L v
Eigenvector equation, L is eigenvalue
det = 0
Matrix is singular, no inverse
ad - bc
Determinant of a 2x2 matrix
Solved examples

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]].

  1. Use ad - bc
  2. 2 x 4 - 1 x 3 = 8 - 3
  3. Determinant = 5

Example 2Find the eigenvalues of [[2, 0], [0, 3]].

  1. Solve det(A - L I) = 0
  2. (2 - L)(3 - L) = 0
  3. L = 2 or L = 3
Practice problem set

Now you try

Work each one out first, then tap to reveal the worked answer.

1Find the determinant of [[1, 2], [3, 4]].
1x4 - 2x3 = -2.
2Is [[1, 2], [2, 4]] invertible?
Determinant 4 - 4 = 0, so it is singular and not invertible.
3Multiply [[1,0],[0,1]] by the vector (5, 7).
The identity leaves it unchanged: (5, 7).
4What is an eigenvector of A?
A nonzero vector whose direction is unchanged by A, only scaled.
5Find the eigenvalues of [[4, 0], [0, 4]].
Both eigenvalues equal 4.
6What does a determinant of 2 mean geometrically?
The transformation doubles areas.