How a Transformation Changes Volume
The determinant of a square matrix compresses its geometric effect into one number.
- is the volume scale factor: 2 doubles area or volume, while 0.5 halves it.
- The sign records orientation: positive preserves it and negative flips it like a mirror.
- means volume was flattened to zero. At least one dimension was lost, so the matrix is singular and has no inverse.
For a 2×2 matrix , the determinant is . For larger matrices, use tested linear-algebra routines rather than cofactor expansion by hand.
Exact Theory and Floating-Point Tests Are Different
In exact mathematics, is equivalent to invertibility. In floating-point code, testing det(A) != 0 is unreliable: rounding can turn a theoretical zero into a tiny value, and determinant magnitude can overflow or underflow with dimension and scale.
Try solve and handle its failure when solving a system. To diagnose sensitivity, inspect singular values or np.linalg.cond(A); use slogdet when a log-determinant is what you need. A small determinant alone does not prove ill-conditioning because rescaling the whole matrix also rescales the determinant.
Where Determinants Appear
- Areas and volumes spanned by vectors
- Jacobian corrections in changes of variables
- Covariance-volume and log-density terms in probability models
한행이 다른행의 배수이면 singular 기 때문에 역행렬이 존재하지 않는다
import numpy as np
rng = np.random.default_rng(7) A = rng.standard_normal((3, 3)) print('A =') print(A) print('det(A) =', np.linalg.det(A))
B = np.array([[1., 2., 3.], [2., 4., 6.], [0., 1., 5.]]) print('B =') print(B) print('det(B) =', np.linalg.det(B))