Linear Algebra, Live
Strang §2.5 · Gauss-Jordan elimination

Eliminate on [A | I] and the inverse appears.

Write A and the identity side by side. Use row operations to turn A into I. The same operations turn I into A⁻¹.

[ A  |  I ]  →  [ I  |  A⁻¹ ]

Think: carbon paper

Put a sheet of carbon paper under your work. Every row operation you do on A gets copied onto the identity beside it.

When A has been turned into I, the copy holds the record of everything you did. Undoing A is exactly what that record does, so the copy is A⁻¹.

The steps

  • Forward: clear below the pivots, as in lesson 2.
  • Backward: clear above the pivots too, from the bottom up.
  • Scale: divide each row by its pivot so the diagonal becomes 1s.

The result is the reduced row echelon form. The lab's rref does all three steps.

Worked example

K = 2−10−12−10−12 shows up for a chain of springs and masses.
K⁻¹ = ¼ · 321242123
Check one column: K times (3, 2, 1) = (6 − 2, −3 + 4 − 1, −2 + 2) = (4, 0, 0), which is 4 times the first column of I ✓

Don't use it to solve Ax = b

Computing A⁻¹ costs about three times the work of elimination, and it adds rounding error. To solve Ax = b, use elimination (A = LU). As Strang stresses: the inverse is great for thinking, but don't compute A⁻¹ to solve Ax = b.

Exercise Show that 4·K⁻¹ has whole-number entries: make the last item 4 * K_inv. Edit the code and press Run.
slide_4.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.
✎Lesson review
3 more worked examples and 5 mixed problems with solutions
→