Thought Toys · Chance & inference · Exhibit 40
Pick a number at random from the real world — a city's population, an invoice total, a physical constant — and its first digit is far more likely to be 1 than 9. Draw thousands of numbers two different ways and watch only one of them find that pattern.
Leading-digit frequency, this sample observedBenford's law
Draw a sample and compare the bars to the line
Distance from Benford's law: —
Two ways of generating "random" numbers. Multiplicative draws a magnitude uniformly on a logarithmic scale — pick a random power of ten, then a random mantissa — which is how quantities that grow by percentages (populations, prices, file sizes, physical constants) actually spread themselves across magnitudes. Additive draws a number uniformly on an ordinary linear scale within one fixed range (100 to 1000) — an arbitrary bounded quantity with no particular reason to favor small numbers over large ones.
Leave the source on multiplicative and watch the amber bars, as the sample grows, settle onto the dashed Benford curve — the exact prediction, log₁₀(1 + 1/d), for how often each leading digit should appear: digit 1 leads about 30% of the time, digit 9 only about 4.6%. Now switch to additive. The bars settle too — sampling always settles with enough data — but onto a flat line at roughly 11% each, not the Benford curve. More data doesn't fix it, because there's nothing to fix: the additive sample is correctly converging to a genuinely different, non-Benford answer. The decades slider only matters in multiplicative mode, and even there it doesn't change the outcome — Benford's law holds for two decades exactly as well as six, because it depends only on the sampling being uniform on a log scale, not on how wide that scale is.
This is also why Benford's law catches fabricated numbers: real multiplicative data — sales figures, census counts, expense reports — obeys it automatically, while numbers a person invents by hand tend to spread out closer to uniform, exactly like the additive sampler here.
improve/verify/40-benford.js, 30 assertions):
the multiplicative sampler's leading-digit distance from Benford's law (total variation) shrinks more
than 5× as the sample grows from 200 to 200,000, reaching under 0.01 at the largest size, for every
tested decade-count from 1 to 6 — confirming the scale-invariance claim directly, not just asserting it.
Counter-example: the additive sampler's distance from Benford never drops below 0.20 at
any sample size from 200 to 200,000 — instead its distance from a flat uniform distribution
(1/9 each) shrinks the same way the multiplicative sampler's distance from Benford does, proving the
additive sampler is converging correctly, just to the wrong target.
Also in Chance & inference: The coupon collector's problem →
← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 40.