51. Gauss–Jordan Elimination

An extension of Gaussian elimination that takes the matrix all the way to Reduced Row Echelon Form (RREF) — not just to upper-triangular REF.

51.1. Two phases

  1. Forward elimination (same as Gaussian elimination): pivot to get zeros below each pivot, achieve REF (upper-triangular form).
  2. Back-substitution turned into elimination: pivot upward to also clear above each pivot, and scale each pivot row so the pivot equals 1.

Result: each pivot is 1, with all-zero columns above and below it — the canonical RREF.

51.2. Why bother going past REF?

After full Gauss–Jordan, the solution to 𝐴𝑥=𝑏 can be read directly off the right-hand side of the augmented matrix [𝐴|𝑏] — no back substitution needed.

Also useful for:

Example

Apply Gauss–Jordan to:

[1253716]

Forward: 𝑅2𝑅23𝑅1 gives

[125011]

Backward: 𝑅1𝑅12𝑅2 gives

[103011]

Read the solution off: 𝑥1=3,𝑥2=1.

51.3. Inverse via Gauss–Jordan

To compute 𝐴1 for an 𝑛×𝑛 invertible matrix, form [𝐴|𝐼𝑛] and row-reduce until the left half is the identity:

[𝐴|𝐼𝑛][𝐼𝑛|𝐴1]
Example

𝐴=[2153]. Augment with 𝐼2:

[21105301]

Row-reduce to [𝐼|𝐴1]:

[10310152]𝐴1=[3152]

51.4. Cost

Gauss–Jordan is 𝑂(𝑛3) — same asymptotic complexity as Gaussian elimination + back substitution, but with a slightly larger constant. For solving a single system, plain Gaussian elimination with back-substitution is marginally faster; for the inverse or RREF directly, Gauss–Jordan is the natural choice.

51.5. See also