Generator

diagonal-exact

One function in the trace library, called 8 times across 5 essays. Below: what it draws at its defaults, what it draws at every value an essay asks for, the 9 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 the running estimate of a diagonal 40×40 matrix's trace, from the two probe distributions. Two curves of the running average against the number of probes. The ±1 probe returns 98.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 177.66 and is still 0.029 away after 60 of them.

diagonal-exact is one function in lib/figures/trace.js — counting the diagonal without looking — two probes, and one of them is free. 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.

The running estimate of a diagonal 40×40 matrix's trace, from the two probe distributionsTwo curves of the running average against the number of probes. The ±1 probe returns 98.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 177.66 and is still 0.029 away after 60 of them.1112131415193111.365129.731148.096166.461probes takenrunning estimate of the tracenormal±1one probe, no errorthe exact trace99±1 variance, this matrix0±1 variance, rotated57normal variance545the same spectrum in a general basiscosts the ±1 probe its whole advantage

Two curves of the running average against the number of probes. The ±1 probe returns 98.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 177.66 and is still 0.029 away after 60 of them.

n: 40

The arguments are the ones A coin flip that fixes the average passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

The running estimate of a diagonal 40×40 matrix's trace, from the two probe distributionsTwo curves of the running average against the number of probes. The ±1 probe returns 98.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 177.66 and is still 0.029 away after 60 of them.1112131415193111.365129.731148.096166.461probes takenrunning estimate of the tracenormal±1one probe, no errorthe exact trace99±1 variance, this matrix0±1 variance, rotated57normal variance545the same spectrum in a general basiscosts the ±1 probe its whole advantage

Two curves of the running average against the number of probes. The ±1 probe returns 98.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 177.66 and is still 0.029 away after 60 of them.

n: 200

The arguments are the ones A norm that overflows before it is a norm passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

The running estimate of a diagonal 200×200 matrix's trace, from the two probe distributionsTwo curves of the running average against the number of probes. The ±1 probe returns 498.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 620.39 and is still 0.0086 away after 60 of them.11121314151489517.279545.557573.836602.114probes takenrunning estimate of the tracenormal±1one probe, no errorthe exact trace499±1 variance, this matrix0±1 variance, rotated297normal variance2785the same spectrum in a general basiscosts the ±1 probe its whole advantage

Two curves of the running average against the number of probes. The ±1 probe returns 498.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 620.39 and is still 0.0086 away after 60 of them.

n: 8

The arguments are the ones Counting what cannot be looked at passes. A value drawn at the generator's defaults instead would be a picture no essay asked for and no assertion has been run against.

The running estimate of a diagonal 8×8 matrix's trace, from the two probe distributionsTwo curves of the running average against the number of probes. The ±1 probe returns 18.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 14.259 and is still 0.099 away after 60 of them.111213141511114.714918.429722.144625.8595probes takenrunning estimate of the tracenormal±1one probe, no errorthe exact trace19±1 variance, this matrix0±1 variance, rotated10normal variance97the same spectrum in a general basiscosts the ±1 probe its whole advantage

Two curves of the running average against the number of probes. The ±1 probe returns 18.5 — the exact trace — from its first draw and never moves, because zᵀAz is Σ a_ii z_i² and every z_i² is 1. The normal probe starts at 14.259 and is still 0.099 away after 60 of them.

What it checked while drawing

Every figure above asserted its own claims on the way to being drawn, and a claim that failed would have failed the build rather than drawn a wrong picture. Those assertions 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.

9 distinct claims across 4 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.

a size the sweep can afford

and the first normal one is not

and the same spectrum in a general basis is not free either

enough probes for the running average to settle

every ±1 running average is the exact trace

matmul shapes agree

the ±1 probe's variance on a diagonal matrix is exactly zero

though its trace is the same

while the normal probe's is not

Against the rule

The rule does not apply to it. It factorises nothing, so there is no residual it could be withholding. That is worth stating rather than leaving blank: a site that reported the rule as satisfied by every generator would be counting mostly generators the rule never reached.

Across the library: the rule bites on 90 of 174 generators — 75 print a residual and 15 are exempt with a published reason; 84 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.

The arithmetic underneath

A coin flip that fixes the average

Add 0.1 to 256 a thousand times at eight significand bits and the answer is 256. Not approximately — the total never moves, not once, and no error bound says so. Round up one time in twenty instead of never, and it arrives at 348 against a true 356.

The arithmetic underneath

A norm that overflows before it is a norm

The vector of sixteen thousands has a Euclidean norm of 4,000, which fp16 represents exactly. Written as the square root of the sum of squares it returns infinity, because squaring doubles the exponent — and the expression costs half the format's range on the one computation every iterative method performs at every step.

The arithmetic underneath

Cancellation takes the answer, not a digit

Subtracting two nearly equal numbers is exact. That is what makes it dangerous — the subtraction introduces no error at all, it exposes error the operands were already carrying, and the exposure can consume every significant figure at once.

Randomised, and the guarantee that changes kind

Counting what cannot be looked at

The trace is n additions and one of the most expensive quantities in the subject to estimate, because the matrices whose trace is wanted are never stored. Hutchinson's estimator is unbiased with one line of algebra — and its variance depends on which random vector is used, by a factor that is a property of the matrix, and on a diagonal matrix one choice is exact from the first probe and the other is not.

The arithmetic underneath

The order they are added in

Addition is associative in the algebra and is not associative in the arithmetic. The same million numbers, added in a different order, give answers that differ in the third significant figure — and the fix is not a wider float, it is a different order.

The whole library · All essays · What must fail