Part II — Linear Algebra & Matrix Decompositions · Chapter 4

Determinants & matrix inversion

Hook

A matrix maps the unit square to some parallelogram. Sometimes that parallelogram has plenty of area; sometimes it flattens into a line with none at all. That one number — the area, signed — turns out to answer a completely different-sounding question: does Ax=bAx=b have a unique solution?

Intuition
area = |det| = 4.0, orientation preserved

M = [[3, 1], [2, 2]]   det(M) = 4

Drag the sliders. The dashed square is the input; the solid shape is where the matrix sends it. Push any slider until the solid shape collapses into a line — that's a singular matrix, and its determinant drops to exactly 0.

Formalize

For a 2×22\times2 matrix, the determinant is:

det(A)=adbc\det(A) = ad - bc
  • AA — the 2×22\times2 matrix, with entries a,b,c,da, b, c, d (rows top-to-bottom, columns left-to-right).
  1. It's a signed area

    det(A)|\det(A)| is the area of the parallelogram the unit square maps to. The sign flips exactly when the mapping reverses orientation (flips the plane over).

  2. Zero means singular

    det(A)=0\det(A)=0 exactly when AA's two columns point along the same line — the mapped square collapses to zero area, and AA is singular: not invertible.

  3. It gates invertibility

    A1A^{-1} exists if and only if det(A)0\det(A)\neq0, since the inverse formula below divides by it.

The inverse itself, when it exists:

A1=1det(A)(dbca)A^{-1} = \frac{1}{\det(A)}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}
  1. Why this undoes A

    A1A^{-1} is defined precisely so that A1A=AA1=IA^{-1}A = AA^{-1} = I — applying AA then A1A^{-1} (or vice versa) leaves every vector exactly where it started.

  2. Singular means no undo

    If det(A)=0\det(A)=0, AA has already thrown away a dimension (collapsed the plane to a line) — there's no way to recover the lost information, so no inverse can exist.

Play
area = |det| = 4.0, orientation preserved

det(M) = 4   M⁻¹ = [[0.50, -0.25], [-0.50, 0.75]]

Jump between the invertible preset and the singular one. Watch the inverse readout switch from a clean set of numbers to "no inverse" the instant the parallelogram flattens.

Worked example

For A=(3122)A = \begin{pmatrix}3&1\\2&2\end{pmatrix}:

  1. Compute the determinant

    det(A)=(3)(2)(1)(2)=62=4\det(A) = (3)(2) - (1)(2) = 6 - 2 = 4.

  2. Compute the inverse

    A1=14(2123)=(0.50.250.50.75)A^{-1} = \frac{1}{4}\begin{pmatrix}2&-1\\-2&3\end{pmatrix} = \begin{pmatrix}0.5&-0.25\\-0.5&0.75\end{pmatrix}.

  3. Check it

    AA1=(3122)(0.50.250.50.75)A A^{-1} = \begin{pmatrix}3&1\\2&2\end{pmatrix}\begin{pmatrix}0.5&-0.25\\-0.5&0.75\end{pmatrix}. Multiplying entry by entry:

    • Top-left: 3(0.5)+1(0.5)=1.50.5=13(0.5)+1(-0.5)=1.5-0.5=1
    • Top-right: 3(0.25)+1(0.75)=0.75+0.75=03(-0.25)+1(0.75)=-0.75+0.75=0
    • Bottom-left: 2(0.5)+2(0.5)=11=02(0.5)+2(-0.5)=1-1=0
    • Bottom-right: 2(0.25)+2(0.75)=0.5+1.5=12(-0.25)+2(0.75)=-0.5+1.5=1

    Exactly (1001)\begin{pmatrix}1&0\\0&1\end{pmatrix}.

Checkpoint

For M = [[1, -1], [1, 1]], compute det(M) by hand and pick it below.

area = |det| = 2.0, orientation preserved
Pick a value to try it
Summary
det(A)=adbcA1=1det(A)(dbca)\det(A) = ad-bc \qquad\qquad A^{-1} = \frac{1}{\det(A)}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

The determinant is a single number that tells you whether a linear system has a unique solution before you do any further work — zero means the matrix has destroyed a dimension, and no amount of algebra will get it back. Every later decomposition in this part (eigenvalues, SVD, PSD-ness) leans on this same idea: a matrix's determinant is the product of its eigenvalues, so a zero eigenvalue is exactly what makes a matrix singular.