Read this lesson as text

Partial Pivoting

Numerical Analysis · Axiom Academy

Preventing numerical instability in Gaussian elimination Consider what happens when we try to eliminate using a very small pivot element. Even tiny rounding errors can cause catastrophic results. Let's see what happens when we use naive Gaussian elimination versus partial pivoting on this system. Partial pivoting is simple but powerful: before eliminating, swap rows so the element with the largest absolute value in the current column becomes the pivot. Complete Example with Pivoting Let's solve a 3×3 system using partial pivoting: Sometimes rows have very different magnitudes. Scaled partial pivoting accounts for this by dividing each element by the row's scale factor. Use pivot as-is Unstable O(n²) work Search column below pivot Stable for most cases O(n²) work Search entire submatrix Most stable O(n³) work (expensive) You've learned how pivoting prevents numerical instability in Gaussian elimination!

This is the written version of the interactive lesson above. See the full Numerical Analysis course.