Generator

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

One function in the elim library, called 42 times across 8 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 51 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.

show: "defer-exponent"

The arguments are the ones A doubling that arrives two steps late passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The growth factor of Wilkinson's matrix and of the constructions two and three interleaved copies of W that defer its damage, under pivot rules looking one to four eliminations aheadW ⊗ I1 at n = 4, 6, 8, 10, 12: looking up to 1 step ahead the growth is 7.999999999980998, 31.999999999888992, 127.99999999942494, 511.9999999971848, 2047.9999999866877 — 2^(n/1 − 1), the greedy rule's — and looking 2 ahead it is 2; W ⊗ I2 at n = 6, 8, 10, 12, 14: looking up to 2 steps ahead the growth is 3.9999999999929994, 7.999999999980998, 15.999999999952996, 31.999999999888992, 63.99999999974498 — 2^(n/2 − 1), the greedy rule's — and looking 3 ahead it is 2; W ⊗ I3 at n = 9, 12, 15: looking up to 3 steps ahead the growth is 3.9999999999929994, 7.999999999980998, 15.999999999952996 — 2^(n/3 − 1), the greedy rule's — and looking 4 ahead it is 2. Dashed lines are 2^(n/d − 1).468101214160246810nlog₂ of the growth factorW ⊗ I₁W ⊗ I₂W ⊗ I₃look 1 step aheadlook 2 steps aheadlook 3 steps aheadlook 4 steps aheaddashed: 2^(n/d − 1); each family defeats every depth up to its owna fixed depth stretches the exponential

W ⊗ I1 at n = 4, 6, 8, 10, 12: looking up to 1 step ahead the growth is 7.999999999980998, 31.999999999888992, 127.99999999942494, 511.9999999971848, 2047.9999999866877 — 2^(n/1 − 1), the greedy rule's — and looking 2 ahead it is 2; W ⊗ I2 at n = 6, 8, 10, 12, 14: looking up to 2 steps ahead the growth is 3.9999999999929994, 7.999999999980998, 15.999999999952996, 31.999999999888992, 63.99999999974498 — 2^(n/2 − 1), the greedy rule's — and looking 3 ahead it is 2; W ⊗ I3 at n = 9, 12, 15: looking up to 3 steps ahead the growth is 3.9999999999929994, 7.999999999980998, 15.999999999952996 — 2^(n/3 − 1), the greedy rule's — and looking 4 ahead it is 2. Dashed lines are 2^(n/d − 1).

show: "defer-matrix"

The arguments are the ones A doubling that arrives two steps late passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The construction two interleaved copies of Wilkinson's four-by-four matrix: Wilkinson's four-by-four matrix with every entry replaced by that entry times the two-by-two identity, so that two copies of it are interleavedEight rows and columns. Rows and columns 1, 3, 5 and 7 hold one copy of Wilkinson's matrix — ones on the diagonal, minus ones below it, ones in the last column of the copy — and rows and columns 2, 4, 6 and 8 hold the other. No entry couples the two copies, so eliminating a column of one leaves the other untouched, and a pivot decision in one copy meets its consequence two eliminations later, when that copy's next column comes up.1·····1··1·····1−1·1···1··−1·1···1−1·−1·1·1··−1·−1·1·1−1·−1·−1·1··−1·−1·−1·1copy 1copy 2pink: the first copy; green: the secondtwo Wilkinson matrices, taking turns

Eight rows and columns. Rows and columns 1, 3, 5 and 7 hold one copy of Wilkinson's matrix — ones on the diagonal, minus ones below it, ones in the last column of the copy — and rows and columns 2, 4, 6 and 8 hold the other. No entry couples the two copies, so eliminating a column of one leaves the other untouched, and a pivot decision in one copy meets its consequence two eliminations later, when that copy's next column comes up.

show: "defer-first"

The arguments are the ones A doubling that arrives two steps late passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Each candidate first pivot of two interleaved copies of Wilkinson's four-by-four matrix scored by the look-ahead rule at depths one, two and three: the smallest worst largest entry any continuation of that length leaves1 ahead: row 1 2.000, row 3 2.000, row 5 2.000, row 7 2.000; 2 ahead: row 1 2.000, row 3 2.000, row 5 2.000, row 7 2.000; 3 ahead: row 1 4.000, row 3 2.000, row 5 2.000, row 7 2.000. Row 1 is the greedy rule's choice. At depths one and two every candidate scores 2, a tie broken towards row 1; at depth three row 1 scores 4 and the others 2.123451 step aheadrows 1, 3, 5, 72 steps aheadrows 1, 3, 5, 73 steps aheadrow 1rows 3, 5, 7score: the largest entry the best continuation leavesred: row 1, the greedy choicethe tie lasts as long as the deferral

1 ahead: row 1 2.000, row 3 2.000, row 5 2.000, row 7 2.000; 2 ahead: row 1 2.000, row 3 2.000, row 5 2.000, row 7 2.000; 3 ahead: row 1 4.000, row 3 2.000, row 5 2.000, row 7 2.000. Row 1 is the greedy rule's choice. At depths one and two every candidate scores 2, a tie broken towards row 1; at depth three row 1 scores 4 and the others 2.

show: "defer-trace", depth: 3

The arguments are the ones A doubling that arrives two steps late passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

The largest entry left in the active submatrix after each elimination of three interleaved copies of Wilkinson's five-by-five matrix, along the order chosen by looking 3 steps aheadlog₂ of the largest active entry after steps 1 to 14: 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, 16, 16, 16. The final growth is 16. Looking three steps ahead or fewer, the entry doubles every third step; looking four, it stays at 2.W₅ ⊗ I₃, n = 15depth3largest entry160369121501234elimination steplog₂ of the largest active entrypale: the other depthsthe doubling arrives three steps late

log₂ of the largest active entry after steps 1 to 14: 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16, 16, 16, 16. The final growth is 16. Looking three steps ahead or fewer, the entry doubles every third step; looking four, it stays at 2.

show: "defer-noise"

The arguments are the ones A doubling that arrives two steps late passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.

Twenty random relative perturbations of two interleaved copies of Wilkinson's five-by-five matrix at each size: the growth under the greedy rule, looking two steps ahead and looking three10⁻¹²: greedy 2–8, two ahead 2–16 (above 2 on 19), three ahead at most 2.00; 10⁻⁹: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 2.00; 10⁻⁶: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 2.00; 0.001: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 2.00; 0.01: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 1.99. A circle's area is the number of draws at that growth.2481610⁻¹²10⁻⁹10⁻⁶0.0010.01growthsize of the random relative perturbation of every entrygreedytwothreesteps ahead: open greedy, red two, blue threenoise does not lend the two-step rule its third step

10⁻¹²: greedy 2–8, two ahead 2–16 (above 2 on 19), three ahead at most 2.00; 10⁻⁹: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 2.00; 10⁻⁶: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 2.00; 0.001: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 2.00; 0.01: greedy 2–8, two ahead 2–16 (above 2 on 15), three ahead at most 1.99. A circle's area is the number of draws at that growth.

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.

51 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 deferral the table holds

a depth the trace was taken at

a look-ahead depth from one to five

a look-ahead of one or two steps

a look-ahead variant this file measures

a nonzero pivot candidate

a pivot rule this routine implements

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 doubling that arrives two steps late

A pivot rule that looks one elimination ahead chooses Wilkinson's growth row for row, because the doubling it sets up arrives one step later; looking two ahead escapes it. The argument said a matrix whose damage arrives two steps late would defeat the two-step rule the same way. It exists, and it is two Wilkinson matrices interleaved: W ⊗ I₂. Every look-ahead of depth one or two reproduces the greedy rule's growth on it exactly, 4 to 64 from n = 6 to 14, and depth three gives 2. Three copies defeat depth three and yield to four. The growth each depth is held to is 2^(n/d − 1): a fixed depth stretches the exponential and never removes it, at a cost that rises by a factor of about n for every step it looks.

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 doubling is in the row already

Interleave d copies of Wilkinson's matrix and every pivot rule that looks up to d eliminations ahead walks into growth 2^(n/d − 1); escaping costs a look one step deeper, and a deeper look multiplies its trial eliminations. Rook pivoting looks no further than the present step and escapes every one of them — growth exactly 2 at every deferral and every size — for 3.2 times partial pivoting's comparisons whatever the deferral. The doubling a look-ahead hunts for in the future is already visible in the row in front of it. And the leak that was supposed to let the two-step rule escape was placed where no pivot is ever chosen: at every size up to one, it changes nothing.

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