Skip to content
mlmentorship

Determinant and volume

The determinant of a matrix is the signed volume scaling factor of the linear map. Zero determinant means the map collapses dimensions.

Published · 5 min read ·Core ·Foundation

Visual quick review

Visual first · depth when needed

Read a 2D determinant as two linked facts: its absolute value is the area scale of the ordered column parallelogram, while its sign records orientation; see why dependent columns force both area and determinant to zero.

Preparing the visual…

Summary

The determinant of a square matrix is the signed factor by which scales -dimensional volumes. Geometrically, is the volume of the parallelepiped spanned by ‘s column vectors; the sign flips if contains a reflection.

Determinants tell you whether a linear map is invertible (non-zero det) or singular (zero det). They appear in change-of-variables formulas (probability density transformations, normalizing flows), in computing volumes of parallelotopes (Gaussian likelihoods), and as Jacobian determinants in differential geometry.

Properties

For :

  • . Composition multiplies volumes.
  • .
  • when is invertible.
  • for scalar .
  • columns linearly dependent not invertible has a zero eigenvalue.
  • (product of eigenvalues, with multiplicity, possibly complex).
  • For triangular matrices: (product of diagonal).

Geometric interpretation

The columns of are vectors in . They span a parallelepiped. Its volume is .

  • : preserves orientation.
  • : reverses orientation (contains a reflection).
  • : parallelepiped is flat. Columns are linearly dependent. collapses at least one dimension.

For an orthogonal matrix : (rotation/reflection preserves volume).

Learning objective

Separate area magnitude from orientation sign, then see why dependent columns have zero area.

Three ordered column pairs with positive, negative, and zero determinant The first panel shows columns a one equals two comma one half and a two equals one half comma one and one quarter, spanning a parallelogram of area two and one quarter in counterclockwise order, so the determinant is positive two and one quarter. The second panel uses the exact same parallelogram but swaps the column order: a one now points to one half comma one and one quarter and a two points to two comma one half. Its area remains two and one quarter, but the order is clockwise, so the determinant is negative two and one quarter. The third panel has columns b one equals two comma one and b two equals one comma one half. The second is half the first, so both arrows lie on one line, the parallelogram collapses to a segment, and the determinant is zero. 1 · Positive: area 2.25, orientation preserved a₁ = (2, 0.5) a₂ = (0.5, 1.25) counterclockwise det[a₁ a₂] = +2.25 2 · Swap columns: same area, opposite sign a₁ = (0.5, 1.25) a₂ = (2, 0.5) clockwise det[a₁ a₂] = −2.25 3 · Dependent columns: one direction is lost b₁ = (2, 1) b₂ = (1, 0.5) = ½b₁ collapsed segment det[b₁ b₂] = 0 area = 0 · not invertible
Read it this way: compare the first two panels before looking at the third. Swapping the ordered columns leaves the parallelogram and its area unchanged but reverses orientation, so only the sign flips. When one column becomes a multiple of the other, the shape loses a dimension; its area and determinant both become zero.

Original coordinate construction checked against MIT OpenCourseWare 18.06, the Deep Learning linear algebra chapter, and the open Interactive Linear Algebra determinant text.

Change of variables (probability)

If with invertible and differentiable, the density of is

where is the Jacobian of the inverse transform. This is the basis of normalizing flows: pick so the Jacobian determinant is cheap to compute (triangular Jacobian → ).

Computing determinants

MethodCostWhen
LU decompositionGeneral-purpose; standard library default
Triangular: product of diagWhen matrix is already triangular
Eigendecomposition: If you need eigenvalues anyway
Log-determinant for PD matricesvia CholeskyWhen you only need (e.g., Gaussian log-likelihood)

Numerical tip: for a general matrix, use a signed log-determinant: track the row-pivot sign and the signs of the LU diagonal entries, then sum . For a positive-definite matrix with , compute . The determinant itself overflows or underflows quickly.

Common pitfalls

  • Using as a proxy for matrix “size.” A nearly singular matrix can have huge entries but tiny .
  • Computing for invertibility tests. Numerically unstable; use rank or condition number instead.
  • Forgetting the absolute value in change-of-variables formulas. Densities are non-negative; the Jacobian determinant can be negative.