Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Linear Algebra  ›  Lesson

Determinants and the Inverse

Determinants, inverse of Matrix 14 minThe determinant measures how a matrix scales space, and a matrix has an inverse only when its determinant is not zero.

Determinants and the Inverse

An analyst adds a new column to the flats table: size in square feet, right next to size in square metres. Training suddenly fails with "singular matrix". Nothing is wrong with the code. The two columns say the same thing, and the determinant is how you see that.

The rule

Determinant zero means information lost, and no inverse brings it back.

A 2 × 2 matrix (abcd)\begin{pmatrix} a & b \\ c & d \end{pmatrix} has determinant ad−bcad - bc. Think of the matrix as a machine that moves every point in the plane. The determinant is how much it scales areas:

  • (2111)\begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}: determinant 2−1=12 - 1 = 1. Areas keep their size.
  • (2436)\begin{pmatrix} 2 & 4 \\ 3 & 6 \end{pmatrix}: determinant 12−12=012 - 12 = 0. The second column is twice the first, so the whole plane is squashed onto a line.

The inverse M−1M^{-1} undoes the machine: MM−1=IM M^{-1} = I, the identity. If the plane was squashed onto a line, many points landed on the same spot, and no machine can tell them apart again. So:

  • determinant not zero → an inverse exists;
  • determinant zero → no inverse (the matrix is singular).

Because the inverse undoes the scaling, its determinant is one over the original: if det⁡M=0.5\det M = 0.5 then det⁡M−1=2\det M^{-1} = 2.

In ML, the classic linear-regression formula needs the inverse of XTXX^T X. If one feature column is a multiple of another, like square feet and square metres, that matrix is singular. The fix is to drop the duplicate or add regularisation. Libraries solve the equations directly rather than forming the inverse, but the same singularity still breaks them.

The shortcut

For a 2 × 2 inverse: swap the diagonal, negate the off-diagonal, divide by the determinant.

Inverting [[4, 2], [3, 2]]Step 1 of 4
  1. Determinant first

    4 × 2 − 2 × 3 = 8 − 6 = 2. Not zero, so an inverse exists.

Always compute the determinant first. If it is zero, stop: there is nothing to divide by.

Drills

Answer fast — trust the rule.

quick drill

What is the determinant of [[3, 2], [1, 4]]?

quick drill

Which matrix has no inverse?

quick drill

What is the inverse of [[2, 1], [1, 1]]?

quick drill

Why does adding size in square feet next to size in square metres break the inverse of X transposed times X?

quick drill

If a matrix has determinant 0.5, what is the determinant of its inverse?

Remember

  • Determinant zero means information lost, and no inverse brings it back.
  • Shortcut for 2 × 2: swap the diagonal, negate the off-diagonal, divide by the determinant.
  • Trap: duplicate or proportional features make the matrix singular.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainThe duplicate column

An analyst adds a 'size in square feet' column next to 'size in square metres', and the training library reports a singular matrix. Explain what went wrong using determinants and inverses, and suggest a fix.