The determinant of a square matrix is a single number that tells you two things at once: whether the matrix is invertible, and how much the matrix scales area/volume when used as a linear transformation.
2ร2 Formula
Numerical Example
Two Things the Determinant Tells You
| Determinant Value | Meaning |
|---|---|
| \(\det(\mathbf{A}) = 0\) | The matrix is singular โ not invertible; its rows/columns are linearly dependent (see Vector Spaces). |
| \(\det(\mathbf{A}) \ne 0\) | The matrix is invertible; \(\mathbf{A}^{-1}\) exists. |
| \(|\det(\mathbf{A})| > 1\) | The transformation expands area/volume. |
| \(|\det(\mathbf{A})| < 1\) | The transformation shrinks area/volume. |
| \(\det(\mathbf{A}) < 0\) | The transformation flips orientation (like a mirror reflection). |
Geometric Intuition
Picture a unit square in 2-D. Apply a matrix \(\mathbf{A}\) as a linear transformation to every corner of that square (see Linear Transformations). The resulting shape's area is exactly \(|\det(\mathbf{A})|\). A determinant of 0 means the square gets squashed into a line or a point โ all the area collapses, which is exactly why the transformation can't be undone (no inverse exists).
Code
import numpy as np
A = np.array([[3., 8.], [4., 6.]])
print(np.linalg.det(A)) # -14.0
singular = np.array([[2., 4.], [1., 2.]]) # second row is a multiple of the first
print(np.linalg.det(singular)) # 0.0 -> not invertible
Connection to Eigenvalues
The determinant of a matrix equals the product of its eigenvalues โ this is covered fully in Eigenvalues. If any eigenvalue is exactly 0, the determinant is 0, confirming the matrix is singular.
Common Mistakes
- Thinking the determinant is only relevant to invertibility โ its magnitude (area/volume scaling) matters for reasoning about numerical stability in deep networks: a weight matrix with determinant far from 1 can cause activations to explode or vanish across layers.
- Trying to compute a determinant for a non-square matrix โ it's only defined for square matrices.
Interview Relevance
Q: "What does it mean if a matrix's determinant is zero?" The matrix is singular โ not invertible. Geometrically, it collapses space into a lower dimension (e.g. a 2-D square onto a 1-D line), losing information that can't be recovered, which is exactly why no inverse can exist.
Practice Question
Without fully computing it, explain why \(\begin{bmatrix}1 & 2\\2 & 4\end{bmatrix}\) has a determinant of 0 by inspecting the relationship between its rows.