JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

The Identity and the Inverse

If the identity matrix is the matrix version of 1, the inverse is the matrix version of dividing: it perfectly undoes what a matrix did. But unlike ordinary numbers, not every matrix has an inverse — and there is one number, the determinant, that tells you in advance whether it does.

The identity is matrix '1'

Recall the identity matrix I: 1s on the diagonal, 0s elsewhere. It behaves exactly like the number 1, because multiplying by it changes nothing — I*A = A and A*I = A. Just as 1 is the anchor of ordinary multiplication, I is the anchor of matrix multiplication.

The inverse undoes a matrix

The inverse of A, written A^(-1), is the matrix that undoes A. Apply A, then A^(-1), and you are right back where you started: A^(-1)*A = I and A*A^(-1) = I. If A rotates by 30 degrees, A^(-1) rotates back by 30 degrees.

A = [[2,0],[0,4]]      A^(-1) = [[0.5,0],[0,0.25]]
A * A^(-1) = [[1,0],[0,1]] = I
Stretch by (2,4); the inverse shrinks by (1/2, 1/4), landing back on I.

When does an inverse exist?

Here is the honest catch: not every matrix has an inverse. A square matrix A is invertible exactly when its determinant is not zero. The determinant of a 2x2 matrix [[a,b],[c,d]] is a*d - b*c; if that comes out 0, the matrix squashes space flat and there is no way to undo it.

A = [[2,1],[1,3]]   det = 2*3 - 1*1 = 5  (nonzero -> invertible)
B = [[2,4],[1,2]]   det = 2*2 - 4*1 = 0  (zero -> NO inverse)
det != 0 means invertible; det = 0 means no inverse exists.

But you don't actually invert

Conceptually, the inverse solves A*x = b in one line: multiply both sides by A^(-1) to get **x = A^(-1)*b**. It is a beautiful formula, and it is exactly how to *think* about the solution.