Determinants and Matrix Rank
- Compute the determinant of a 2x2 and 3x3 matrix using the cofactor expansion
- Interpret the determinant as a signed volume scaling factor and use it to determine whether a matrix is invertible
- Compute the rank of a matrix via row reduction and apply the rank-nullity theorem
- Explain the trace, its cyclic property tr(ABC) = tr(CAB), and its connection to the eigenvalue sum
The Determinant
The determinant of a square matrix , written or , is a scalar that encodes whether is invertible and by how much it stretches or compresses space.
2×2 Case
For a matrix:
Geometrically: if the two rows are interpreted as vectors in , the determinant equals the signed area of the parallelogram they span. If the rows are parallel (linearly dependent), the parallelogram collapses to a line — area zero, determinant zero.
3×3 Case (Cofactor Expansion)
For a matrix, expand along the first row:
This pattern — alternating signs, each term multiplying a row element by the determinant of the submatrix formed by deleting that element's row and column — is cofactor expansion and generalizes to any matrix.
Properties
- for an matrix
- Swapping two rows negates the determinant
- Adding a multiple of one row to another leaves the determinant unchanged
- A matrix with two identical rows has determinant zero
Geometric interpretation in dimensions
For an matrix , is the -dimensional volume of the parallelepiped formed by the rows (or columns) of . The sign encodes orientation. A linear transformation scales all volumes by .
Invertibility and the Determinant
A square matrix is invertible (also called non-singular) if and only if .
When :
- is singular — it cannot be inverted
- The columns of are linearly dependent
- The transformation maps all of into a lower-dimensional subspace
- The system either has no solution or infinitely many
In ML: a singular covariance matrix signals that your data lives in a lower-dimensional subspace than assumed — some features are exact linear combinations of others.
Matrix Rank
The rank of a matrix , written , is the dimension of its column space — equivalently, the number of linearly independent columns (which always equals the number of linearly independent rows).
For an matrix:
- If , the matrix has full rank
- For a square matrix: is invertible
Rank-Nullity Theorem
For an matrix :
where is the dimension of the null space. Every column "direction" either contributes to the output (rank) or gets killed to zero (null space) — the two together always account for all input dimensions.
Idempotent Matrices
A matrix is idempotent if . Idempotent matrices represent projections: applying the transformation twice gives the same result as applying it once, because the output is already in the target subspace.
The mean-deviation matrix
(where is the vector of ones) is a symmetric idempotent matrix. Pre-multiplying a data vector by produces the mean-deviation form . This matrix appears throughout regression and ANOVA.
For any symmetric idempotent matrix :
- (trace equals rank)
- Its eigenvalues are all 0 or 1
- It represents an orthogonal projection onto its column space
Trace
The trace of a square matrix is the sum of its diagonal elements:
Key properties:
- (cyclic property — even when )
- where are the eigenvalues of
The cyclic property makes trace useful for simplifying quadratic forms: , which can be easier to differentiate.