Thought Toys · Chance & inference · Exhibit 40

Benford's law

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.

A bar chart of leading-digit frequency for digits 1 through 9. Amber bars show the sample's observed percentage for each digit; a dashed cyan line marks Benford's predicted percentage for each digit, which falls steeply from about 30% at digit 1 to under 5% at digit 9.

Leading-digit frequency, this sample observedBenford's law

Distance from Benford's law: —

your turn — switch to additive and watch the bars stop matching the line

What you're seeing

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.

The rule, exactly. For leading digit d ∈ {1..9}: P(d) = log₁₀(1 + 1/d) giving 30.1%, 17.6%, 12.5%, 9.7%, 7.9%, 6.7%, 5.8%, 5.1%, 4.6% for d=1..9 (they sum to exactly 1). Verified in node (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 →

All 16 in Chance & inference
  1. 05The Galton board
  2. 06The Monty Hall problem
  3. 09Bayes' theorem
  4. 13Buffon's needle
  5. 14The central limit theorem
  6. 28Simpson's paradox
  7. 30Markov chains
  8. 31Averages that never settle
  9. 35The birthday paradox
  10. 38The drunkard's walk
  11. 39Zipf's law
  12. 40Benford's law — you are here
  13. 42The coupon collector's problem
  14. 48The wisdom of crowds
  15. 52Genetic drift
  16. 63The gaps are chaos. The count is law.

← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 40.