A topic in the Open Knowledge Graph — a free, open map of 15,495 topics and the order to learn them in.

Gaussian Elimination with Partial Pivoting

College Depth 94 in the knowledge graph ☐ I know this ☆ Set as goal
1topic build on this
370prerequisites beneath it
See this on the map →
Gaussian Elimination and Row Reduction→→LU Decomposition
numerical-stability pivoting gaussian-elimination

Core Idea

Partial pivoting swaps rows to place the largest entry in the pivot position before elimination, reducing rounding errors in floating-point arithmetic. Without pivoting, small pivots can amplify errors in subsequent operations. Pivoting is essential for numerical stability and is standard in computational practice.

How It's Best Learned

Solve 0.0001x + y = 1, x + y = 2 by hand, rounding every result to three significant digits. Without pivoting the multiplier is 10,000, the second row rounds to −10,000y = −10,000, so y = 1 and back-substitution gives x = 0. Swap the rows first and the same rounding gives x = 1, y = 1, close to the true solution (about 1.0001 and 0.9999).

Common Misconceptions

Explainer

You know Gaussian elimination: systematically use row operations to reduce a matrix to upper triangular form, then back-substitute to find the solution. On paper with exact arithmetic, it works perfectly. But computers store numbers in floating-point format with finite precision — every number is rounded to about 15-16 significant digits. This rounding is usually harmless, but Gaussian elimination without care can turn tiny rounding errors into massive ones. The fix is partial pivoting.

Here's the problem. Suppose your current pivot — the leading entry you're eliminating with — is 0.0001, and another entry in the same column is 500. To eliminate the 500, you multiply the pivot row by 500/0.0001 = 5,000,000 and subtract. You've just amplified any rounding error in the pivot row by a factor of 5 million. The result can have errors so large that your "solution" is completely wrong. The size of this amplification is related to the multiplier: if the multiplier is large, errors grow; if it's small (≤ 1), errors stay controlled.

Partial pivoting prevents this by swapping rows before each elimination step. Before using entry (k, k) as the pivot, scan all the entries below it in column k and find the largest one in absolute value. Swap that row up to position k. Now the pivot is the largest available entry in its column, so every multiplier in this step has absolute value ≤ 1. Errors don't get amplified — they stay bounded. The only cost is bookkeeping: you record the row swaps in a permutation matrix P so you can reconstruct that you solved PA = LU rather than A = LU directly.

A small example shows the difference clearly. Solving the system [0.001, 1; 1, 1] × [x; y] = [1; 2] without pivoting: subtract 1000 times row 1 from row 2 to eliminate, a multiplier of 1000 that amplifies floating-point noise. With pivoting: swap rows first so the pivot is 1 (the larger entry), multiplier becomes 0.001, and the elimination is numerically clean. The final answers match analytically but diverge significantly in floating-point.

Every serious numerical linear algebra library — LAPACK, NumPy, MATLAB — applies partial pivoting by default when solving Ax = b. It's not optional engineering caution; it's the reason direct solvers work reliably in practice. Understanding pivoting also prepares you for LU decomposition with permutation matrices (PA = LU), where the same row-swapping logic is formalized into a factorization that can be reused to solve systems with multiple right-hand sides efficiently.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Opposites and Additive Inverses → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Multiplying Binomials (FOIL) → Factoring Trinomials → Factoring Completely → Introduction to Rational Expressions → Simplifying Radical Expressions → Segments and Distance → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Similar Right Triangles and the Geometric Mean → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Special Right Triangles: 30-60-90 → Trigonometric Ratios Review → Vectors in Two Dimensions → Vectors in R^n → Scalar Multiplication of Vectors → Dot Product (Inner Product in R^n) → Matrix Multiplication → Determinants of 2×2 and 3×3 Matrices → Invertible Matrices and Matrix Inverses → Systems of Linear Equations and Matrix Form → Gaussian Elimination and Row Reduction → Gaussian Elimination with Partial Pivoting

Longest path: 95 steps · 370 total prerequisite topics

Prerequisites (1)

Leads To (1)