Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Flipping a table
Turn a table on its side, so rows become columns and columns become rows. A list of 2 students × 3 subjects becomes 3 subjects × 2 students. That’s the transpose.
Undoing a machine
A machine multiplies by 4. It shows 20. What went in? You undo it by dividing by 4: 5. Some matrix machines can be undone too. The undo machine is called the inverse. But a shadow machine (A2.1-6) can’t be undone: you can’t recover the height from a shadow.
How much does it stretch?
Draw a 1 × 1 square. A machine stretches it to 2 wide and 3 tall, so now it has area 6. The number that tells you how much a machine scales area (or volume) is the determinant. If the machine squashes the square flat, the area becomes 0, and that’s exactly when the machine can’t be undone.
det A = 1.00 (area scale) · rank = 2
- 1. Flip a 2 × 3 table on its side. Its new shape is…
- 2. A machine squashes every square flat (area 0). Can it be undone?
- 3. A unit square is stretched 2× wide and 3× tall. New area?
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Transpose
A column vector’s transpose is a row vector, and is the dot product.
The 2×2 determinant and inverse
Example. , so the map scales areas by 10. For , the determinant is 10 and the inverse is . Check: .
What the sign and zero mean
| Meaning | |
|---|---|
| scales area by , orientation kept | |
| scales area by , orientation flipped (like a mirror) | |
| squashes the plane onto a line or point: not invertible |
- 1. det [[1, 2], [2, 4]] = ?
- 2. Inverse of [[2, 0], [0, 5]]?
- 3. A reflection has determinant…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.Rules for the transpose
The order reverses, as if you were taking off socks and shoes: the last one on comes off first. In ML, appears in every backpropagation derivation (A3.3).
The inverse
exists exactly when is square and (equivalently, rank , or kernel ). Then . Rules: (order reverses again), and .
To solve , use np.linalg.solve(A, b), not inv(A) @ b. Solving directly (A2.2-4) is faster and more accurate. Inverses are a thinking tool. You rarely compute them.
Determinants of bigger matrices
The determinant can be computed by cofactor expansion along a row:
Here is with row 1 and column removed. For example, . Geometrically, is the volume of the box (parallelepiped) spanned by the columns.
Key properties
Swapping two rows flips the sign. Adding a multiple of one row to another leaves it unchanged. The determinant of a triangular matrix is the product of its diagonal entries (A2.2-3).
Where these appear
| Field | Use |
|---|---|
| Statistics and ML | the normal equations . in the Gaussian density. in Gaussian processes |
| Robotics | inverting rotations () and poses. marks singular arm poses |
| Geometry | the sign of a 2×2 determinant says whether a path turns left or right (Practice Code 3) |
- 1. (AB)ᵀ = ?
- 2. det A = 3, det B = −2. det(AB) = ?
- 3. A is 3 × 3 with det A = 5. det(2A) = ?
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.What a determinant really is
The determinant is the unique function of the columns of an matrix that is:
- linear in each column separately,
- alternating: it changes sign when two columns are swapped (so it’s 0 if two columns are equal),
- normalized: .
From these three rules you get the Leibniz formula , a sum over all permutations. It also gives every property above, and the geometric meaning: the signed volume of the box spanned by the columns.
Invertibility
A square matrix is invertible if and only if .
Proof. If is invertible, then , so . Conversely, if isn’t invertible, its columns are dependent (rank–nullity, A2.1-6). By linearity, one column can be replaced by the combination of the others without changing the determinant. That gives a matrix with a column equal to a combination of the others, and by the alternating property its determinant is 0. ∎
The inverse of a product
If and are invertible, then .
Proof. , and similarly in the other order. ∎
Cramer’s rule and the adjugate
, where the adjugate is the transposed matrix of cofactors. Cramer’s rule solves with , where is with column replaced by . Both are beautiful, but slow: cofactor expansion costs . Real software computes determinants from an LU factorization in (A2.3).
Exercise 3.1: Show that a rotation matrix has determinant 1 and a reflection −1
. For the reflection , . Rotations keep area and orientation, while reflections flip orientation.
- 1. Volume of the box spanned by (1,0,0), (1,2,0), (0,1,3)?
- 2. How many terms are in the Leibniz formula for a 5 × 5 determinant?
- 3. Two equal columns force det A to be…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.The determinant in change of variables
If is a smooth invertible map, densities transform like this:
The Jacobian determinant measures how much the map stretches volume locally, and probability has to be spread out by the same factor. This one formula drives:
- Normalizing flows (Dinh et al., 2017; Rezende and Mohamed, 2015), generative models built from invertible layers whose is cheap to compute (H5).
- Integration in polar and spherical coordinates (A3.2), where .
- Uncertainty propagation in robot state estimation (T5).
Numerical reality
- A determinant is a bad test of near-singularity. , yet this matrix is perfectly well-conditioned. Use the condition number or the smallest singular value instead (A2.3, A2.4).
- Work with log-determinants. In high dimensions, overflows or underflows easily.
np.linalg.slogdetreturns stably, and that’s what Gaussian processes and flows use.
References
- G. Cramer (1750). Introduction à l’analyse des lignes courbes algébriques. (Cramer’s rule.)
- A.-L. Cauchy (1815). “Mémoire sur les fonctions qui ne peuvent obtenir que deux valeurs égales…” Journal de l’École Polytechnique, 10. (The modern theory of determinants.)
- D. Rezende and S. Mohamed (2015). “Variational inference with normalizing flows.” ICML.
- L. Dinh, J. Sohl-Dickstein, S. Bengio (2017). “Density estimation using Real NVP.” ICLR.
- G. Papamakarios, E. Nalisnick, D. Rezende, S. Mohamed, B. Lakshminarayanan (2021). “Normalizing flows for probabilistic modeling and inference.” JMLR, 22(57).
- S. Axler (2024). Linear Algebra Done Right, 4th ed. Chapter 9 (determinants via volume and multilinear forms).