Elimination, remembered
Gaussian elimination solves by subtracting multiples of one row from the rows below it until the matrix is upper triangular, . The multipliers you used are worth keeping: put them below the diagonal of a lower triangular matrix with ones on the diagonal, and then . The decomposition records the whole elimination, so the work is done once and reused.
To solve, first by forward substitution (top to bottom), then by back substitution (bottom to top). Each costs about operations, while the factorisation costs about . With many right-hand sides (many scenarios on the same matrix) you factor once and pay only per scenario.
- : lower triangular, ones on the diagonal, the elimination multipliers below it.
- : upper triangular, the result of the elimination; its diagonal holds the pivots.
- Pivoting: swap rows so the pivot is large, giving with a permutation matrix .
For the first pivot is 0 and plain elimination divides by zero, yet the matrix is perfectly invertible. Swapping the rows fixes it. A pivot that is tiny rather than zero does not crash, but it produces huge multipliers and wrecks accuracy, so real libraries always pivot.
Lab · what's graded
7 tasks · 100 pts- The matrix L15 pts
- The matrix U15 pts
- A determinant from U15 pts
- Solving with L and U15 pts
- Why pivot15 pts
- The steps of an LU solve10 pts
- Why factor once15 pts