Generator

Gaussian elimination on a 4×4, one step at a time

One function in the elim library, called 29 times across 6 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 46 claims it put to the test while drawing them, and where it stands against the rule this site is named for.

At its defaults it draws gaussian elimination on a 4×4, one step at a time. 4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.75, which partial pivoting bounds by one.

elimination-steps is one function in lib/figures/elim.js — elimination — the swap, the growth factor, and the matrix with a known answer. Everything below came out of it during this build, at arguments taken from the essays rather than invented for this page. A figure here is the figure a reader meets in an essay, and if the generator changes, this page changes with it.

At its defaults

Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.

Gaussian elimination on a 4×4, one step at a time4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.75, which partial pivoting bounds by one.21-13-3-121-212-443-12as givenrows in the order 1 2 3 443-1201.251.252.502.51.5-30-0.5-0.52after step 1pivot 443-1202.51.5-3000.5400-0.21.4after step 2pivot 2.543-1202.51.5-3000.540003after step 3pivot 0.5‖PA − LU‖/‖A‖0largest multiplier0.75row order 4 3 2 1the pivot is chosen

4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.75, which partial pivoting bounds by one.

A: [2,1,-1,3, -3,-1,2,1, -2,1,2,-4, 4,3,-1,2]

The arguments are the ones A rule that is correct and unusable passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Gaussian elimination on a 4×4, one step at a time4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.75, which partial pivoting bounds by one.21-13-3-121-212-443-12as givenrows in the order 1 2 3 443-1201.251.252.502.51.5-30-0.5-0.52after step 1pivot 443-1202.51.5-3000.5400-0.21.4after step 2pivot 2.543-1202.51.5-3000.540003after step 3pivot 0.5‖PA − LU‖/‖A‖0largest multiplier0.75row order 4 3 2 1the pivot is chosen

4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.75, which partial pivoting bounds by one.

A: [4,1,0, 1,4,1, 0,1,4]

The arguments are the ones Elimination is a sequence of choices passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Gaussian elimination on a 3×3, one step at a time3 copies of the same 3×3 matrix: as given, and after each of the 2 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.267, which partial pivoting bounds by one.410141014as givenrows in the order 1 2 341003.751014after step 1pivot 441003.751003.73after step 2pivot 3.75‖PA − LU‖/‖A‖0largest multiplier0.27row order 1 2 3the pivot is chosen

3 copies of the same 3×3 matrix: as given, and after each of the 2 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.267, which partial pivoting bounds by one.

A: [0,1,2, 1,1,1, 2,3,1]

The arguments are the ones Elimination is a sequence of choices passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Gaussian elimination on a 3×3, one step at a time3 copies of the same 3×3 matrix: as given, and after each of the 2 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.5, which partial pivoting bounds by one.012111231as givenrows in the order 1 2 32310-0.50.5012after step 1pivot 2231012001.5after step 2pivot 1‖PA − LU‖/‖A‖0largest multiplier0.5row order 3 1 2the pivot is chosen

3 copies of the same 3×3 matrix: as given, and after each of the 2 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.5, which partial pivoting bounds by one.

A: [1e-8,1, 1,1]

The arguments are the ones Elimination is a sequence of choices passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Gaussian elimination on a 2×2, one step at a time2 copies of the same 2×2 matrix: as given, and after each of the 1 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 10⁻⁸, which partial pivoting bounds by one.10⁻⁸111as givenrows in the order 1 21101after step 1pivot 1‖PA − LU‖/‖A‖0largest multiplier10⁻⁸row order 2 1the pivot is chosen

2 copies of the same 2×2 matrix: as given, and after each of the 1 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 10⁻⁸, which partial pivoting bounds by one.

A: [1,2,3,4, 4,3,2,1, 1,1,1,1, 2,4,8,16]

The arguments are the ones Elimination is a sequence of choices passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Gaussian elimination on a 4×4, one step at a time4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.5, which partial pivoting bounds by one.12344321111124816as givenrows in the order 1 2 3 4432101.252.53.7500.250.50.7502.5715.5after step 1pivot 4432102.5715.500-0.2-0.800-1-4after step 2pivot 2.5432102.5715.500-1-40000after step 3pivot -1‖PA − LU‖/‖A‖0largest multiplier0.5row order 2 4 1 3the pivot is chosen

4 copies of the same 4×4 matrix: as given, and after each of the 3 elimination steps. The pivot in use is outlined and the entries reduced to zero are greyed. ‖PA − LU‖/‖A‖ is 0 and the largest multiplier is 0.5, which partial pivoting bounds by one.

What it checked while drawing

Every figure above checked its own claims on the way to being drawn, and a claim that failed would have stopped the picture rather than shipped a wrong one. Those checks used to leave no trace at all: a passing one returned true and the only evidence the figure had checked anything was that nothing crashed. The list below is what they actually said, collected by running this generator with an observer installed — not a description of what it is believed to check.

46 distinct claims across 6 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.

the last frame is the U that luFactor returns (0,0) — checked 25 times

the backward tie-break holds the growth at two on the tied matrix, n = 4 — checked 4 times

a look-ahead of one or two steps

a look-ahead variant this file measures

a pivot-decision view this figure draws

a size every ordering can be enumerated at

a size the exhaustive comparisons are affordable at

and breaking the tie by 10⁻¹² takes it back to the bound

and its worst is a real factor

and no multiplier exceeds one, which is what pivoting buys

and no single decision, removed, multiplies the growth by three

LU is for square matrices

matmul shapes agree

one step ahead the candidates are tied to 10⁻⁹

PA = LU to rounding

the determinant by pivots and by cofactors agree

the first decision moves a row on most matrices

the greedy order does not attain the least growth on every matrix

while an ordering with growth two is still there

Against the rule

It draws a decomposition and prints its residual. It calls luFactor, and every figure above carries the badge — which residualcheck verifies by looking for it in the emitted SVG rather than by finding the call that builds one. A badge that is constructed and then left out of the body is the failure that check exists for.

Across the library: the rule bites on 217 of 397 generators — 199 print a residual and 18 are exempt with a published reason; 180 factorise nothing. Read from lib/residual-rule.js, which is the same body the gate enforces from, and the gate's last check fails the build if this page and it disagree about any generator.

Where it is called

Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.

Elimination, and the swap

A rule that is correct and unusable

Cramer's rule gives every component of the solution in closed form, in terms of determinants, and it is a theorem. On two-by-two systems whose rows are nearly parallel it returns an answer with a backward error of 458 units of roundoff where elimination returns 1.3 — on a matrix whose condition number is 32,000 and which elimination solved perfectly.

Elimination, and the swap

Elimination is a sequence of choices

Gaussian elimination is taught as a procedure with no decisions in it. There is one decision at every step — which row to use — and every stability property the algorithm has comes from making it well.

Elimination, and the swap

One step ahead is one step short

Partial pivoting takes the largest entry in the column and, on Wilkinson's matrix, walks into growth of 2^(n−1) that a cyclic shift of the rows avoids entirely. A rule that chose instead the pivot whose elimination leaves the smallest trailing submatrix was expected to see the good order at the first step. It sees nothing there: every first pivot leaves a largest entry of exactly 2, and with the ties broken by 10⁻¹² it prefers the greedy row by 10⁻¹². It attains 2^(n−1) at every size. Looking two eliminations ahead, the greedy row scores 4 and every other row 2, and the growth is 2 at every size up to 24. On random matrices one step of look-ahead helps below n = 16 and is worse than greedy on more than half of them by n = 32.

Elimination, and the swap

The order the greedy rule cannot choose

Wilkinson's matrix is the standard demonstration that partial pivoting's growth bound of 2^(n−1) is attained. It is attained by the row order the greedy rule picks, and not by the matrix: a single cyclic shift of the rows gives growth 2 at every size, with no multiplier above one. At n = 7 that is 64 against 2. And perturbing one entry by 10⁻¹² leaves the good order exactly where it was while putting every tie-break of the greedy rule back on 64.

Elimination, and the swap

The swap that is not optional

Run elimination without a row interchange on a matrix that needs one and nothing announces a failure. There is no division by zero, no warning, and an answer of the right shape. It is simply wrong, and how wrong depends on a number you did not look at.

Elimination, and the swap

Which of the choices is doing the work

Elimination makes n − 1 decisions and they are not worth the same. On 8×8 standard normal matrices, removing the first pivot search and leaving the other six multiplies the median growth factor by 1.624; removing the last multiplies it by 1.000. The cost falls monotonically along the run, and the worst single matrix in the sweep grows by 2,366 when one early decision goes — so the median is the wrong statistic and the tail is where pivoting earns its reputation.

The whole library · All essays · What must fail