Inverse via Gauss-Jordan Elimination
Augment a matrix with the identity and row-reduce until the left block becomes the identity.
Reduce both blocks together
Every row operation applies to the whole augmented matrix. When the left block is I, the right block is the inverse.
inverse([[1, 2], [3, 7]])Use a row swap when needed
The zero top-left pivot forces an exchange. Reducing the swapped rows gives the same permutation matrix back as its own inverse.
inverse([[0, 1], [1, 0]])Scale rows to leading ones
The identity begins on the right. Scaling each row by its diagonal reciprocal finishes the inverse without any off-diagonal elimination.
inverse([[2, 0], [0, 4]])Practice
Practice: problems like this one, made and checked in your browser.
Recap
- Start with [A | I], not with A alone.
- Apply every row operation across both blocks.
- If the left block cannot become I, the matrix is singular.