A fair die rolled without end, and the one thing it cannot escape: the average of its pips is dragged, roll by roll, onto three and a half. This page is the workshop behind that number.
DICE is a study of the Law of Large Numbers for an imagined mathematics-of-chance series. Its audience is anyone who has felt that a coin is "due" to land heads — the page answers that instinct. Its single job: show that individual rolls owe the past nothing, yet their running mean is nonetheless pulled onto the exact value 3.5, and to make that pull something you can both watch and hear.
The die rolls continuously on a walnut bench. Each roll adds a pip value; the running mean is plotted against the roll count on a logarithmic axis, so the wild early wobble and the late, patient settling both fit in one frame. Around 3.5 a funnel is drawn — the theoretical spread of the mean — and it visibly narrows as more rolls bank. At rest a few hundred rolls have already been thrown, so the trace arrives mid-convergence rather than blank.
Warm and low, argued from the object: a dice bench in lamplight, brass pips, one hot face.
The bright #E0B24A pip amber fails legibility as small copy on the dark bench, so it is held to strokes and marks only; body copy uses bone ink, and small accent labels use the lighter #EFCF8C. The six accent is a mark colour too — when it must speak as text it is lifted to #D9825A.
Everything is procedural on three <canvas> layers — the convergence chart, the tumbling die, and the roll strip — with no raster assets. Rolls are true fair draws (1 + (Math.random()*6 | 0)); the running mean is sum / N.
The funnel is the piece worth explaining. The standard deviation of one fair die is √(35/12) ≈ 1.708. The standard error of the mean of N rolls is that over √N — so the mean's expected spread shrinks as 1/√N. The page draws two bands around 3.5: a 68% band at ±σ/√N and a 95% band at ±1.96σ/√N, sampled every few pixels across the log axis. That is the closing funnel, and the running-mean trace is arithmetically forced to thread it — the Law of Large Numbers, drawn rather than asserted.
Sound. Each roll is two Web Audio voices scheduled on a user gesture only: a short filtered-noise knock with a low triangle body (the die on wood), and a tuned pip-tone mapping the value 1–6 onto an A-minor pentatonic scale, so a six always answers an octave above a one. The page starts muted; a labelled toggle fades a master gain in and out, and every visual works in silence.
Performance follows the collection's floor: device-pixel-ratio capped at 2, canvases sized to their containers and rebuilt on resize, the render loop paused on document.hidden, and a settled static frame under prefers-reduced-motion (the mean is banked to a few hundred rolls and painted once, no loop).