Exercises — Solving linear systems — Gaussian elimination with partial pivoting
All numeric answers below are machine-verified in the appendix.
Level 1 — Recognition
"Can you read the matrix and identify the mechanical pieces?"
L1.1 — Find the pivot
Recall Solution
WHAT partial pivoting asks: among the entries in column 1, from the current row down, find the one with the largest absolute value. Column-1 entries are . Their absolute values are , , . The biggest is , in row 2. WHY absolute value and not the value itself? A large magnitude (positive or negative) is what keeps the multiplier small; the sign is irrelevant to how "big" the number is as a divisor. Answer: swap row 2 into row 1.
L1.2 — Compute one multiplier
Recall Solution
WHAT the multiplier is: the number chosen so that . Solving, . WHAT IT LOOKS LIKE: we subtract from row 3, i.e. we add half the pivot row. Since , this is a well-behaved (stable) step — exactly what pivoting guarantees.
L1.3 — Is this matrix ready for back-substitution?
Recall Solution
WHAT "upper-triangular" means: every entry below the main diagonal is zero. : below-diagonal entries are — all zero. ✅ : entry — still a variable to kill. ❌ Answer: only . Back-substitution needs each row (bottom-up) to expose exactly one new unknown; 's bottom two rows still tangle and .
Level 2 — Application
"Run the machine on a small system, end to end."
L2.1 — Full solve with pivoting
Recall Solution
Augmented matrix: . Step 1 — pivot column 1. vs → biggest is (row 2). Swap: Step 2 — eliminate. (note — the pivot paid off). Row RowRow: , . Step 3 — back-substitute (bottom-up). ; . Answer: . Check eq 2: ✅.
L2.2 — A negative pivot
Recall Solution
Column 1: vs → biggest magnitude is (row 2). Swap: A negative pivot is completely fine — pivoting cares about magnitude, not sign. . RowRowRowRowRow: , . Back-sub: ; . Answer: . Check eq 1: ✅.
L2.3 — Zero on the diagonal (pivot rescues it)
Recall Solution
The naive pivot would force division by zero. This is exactly the emergency pivoting is built for. Column 1: vs → biggest is (row 2). Swap: The system is already upper-triangular — no elimination needed! Back-sub: ; . Answer: . A zero on the diagonal is not a dead end unless every entry below it is also zero.
Level 3 — Analysis
"Reason about why the method behaves as it does."
L3.1 — with a mid-elimination pivot
Recall Solution
Column 1. → biggest (row 2). Swap rows 1,2: , . RowRowRow: . RowRowRow: . Column 2 (rows 2,3): vs — a tie. On a tie we may keep the current row (no swap needed for stability). . RowRowRow: . Back-sub. ; ; . Answer: (exactly ).
L3.2 — Why does pivoting cap the multipliers at 1?
Recall Solution
WHAT a multiplier is: for rows . WHAT pivoting guarantees: we swapped in the row whose column- entry has the largest absolute value among rows . So the pivot satisfies Divide both sides by : WHY it matters: small multipliers mean the elimination step shrinks rather than amplifies existing round-off in each row — the numerical heart of stability. See Condition Number and Numerical Stability.
L3.3 — Round-off with limited precision
Recall Solution
Column 1: vs → biggest (row 2). Swap — the whole point: (tiny, ✅). (3 s.f.). . Back-sub: ; . Answer (3 s.f.): — matches exact to full displayed precision. Contrast: without swapping, , and swamps the useful digits. Pivoting salvaged the accuracy. See Round-off Error in Floating Point.
Level 4 — Synthesis
"Combine ideas; connect to neighbouring tools."
L4.1 — Extract the LU factors
Recall Solution
The permutation swapped rows 1,2, so and The single multiplier was . In LU form, holds the multipliers below its unit diagonal, holds the eliminated (upper-triangular) result: Check : ✅. WHY this is the same computation: partial-pivoted Gaussian elimination is the algorithm that produces . See LU Decomposition; solving then splits into Back-substitution and Forward-substitution.
L4.2 — Determinant from the elimination
Recall Solution
KEY fact: row operations of type "add a multiple of a row to another" do not change the determinant; each row swap flips the sign. After elimination we reached the upper-triangular The determinant of an upper-triangular matrix is the product of its diagonal: We performed one row swap (column 1), so Check (direct expansion): ✅. See Determinants.
L4.3 — Same answer, different tool
Recall Solution
Replace column 1 by : Replace column 2: Answer matches ✅. WHY prefer elimination for large : Cramer's Rule needs determinants ( work); elimination is — vastly cheaper as grows.
Level 5 — Mastery
"Design and predict behaviour of a hard case."
L5.1 — Detect singularity mid-elimination
Recall Solution
Column 1: → biggest (row 2). Swap rows 1,2: . RowRowRow: . RowRowRow: . Column 2 (rows 2,3): candidates and → biggest (row 3). Swap: The last pivot is — column 3, row 3, entry , and there is nothing below to swap in. is singular. What it means: the bottom row reads — always true, so the system has infinitely many solutions (the equations were linearly dependent: row 2 was row 1). The (not ) tells us consistent-but-not-unique, not "no solution". A zero pivot always signals .
L5.2 — Build a system that punishes no-pivoting
Recall Solution
Design idea: put a tiny number where the first pivot sits. Take Exact solution: subtract — , , . Good. Route A — NO pivoting (3 s.f.): . ; . ; then . But at 3 s.f., rounds to (catastrophic cancellation) → . Wrong ( instead of ). Route B — WITH pivoting. Swap (row 2 has ): , , , . ; . Correct ✅. Moral: the tiny pivot forces a subtraction of two near-equal numbers in back-substitution — pivoting reorders so the divisor is and the cancellation never happens.
L5.3 — Predict multiplier magnitudes before computing
Recall Solution
Column 1 magnitudes: . Biggest is → row 2 becomes the pivot row (swap rows 1,2). After swapping, the pivot is ; remaining column-1 entries are (old row 1, now row 2) and (row 3). Both satisfy ✅ — exactly the guarantee of L3.2. Had we not pivoted, the divisor would have been , giving and : monster multipliers, unstable.
Recall Where to go next
- Deeper stability theory → Condition Number and Numerical Stability
- When elimination is too slow → Iterative Methods (Jacobi, Gauss-Seidel)
- The factorization view → LU Decomposition and Back-substitution and Forward-substitution