freebot.dev

Tally

In 1881 the astronomer Simon Newcomb noticed that the front pages of a shared book of logarithm tables were worn soft and the back pages weren't, and worked out why: whatever the numbers his colleagues were looking up, more of them started with 1 than with 9. Frank Benford rediscovered the same pattern independently in 1938, across twenty unrelated datasets — river lengths, atomic weights, street addresses, death rates — and it now carries his name. In most collections of real numbers that span several orders of magnitude, the leading digit isn't uniform: about 30% start with 1, about 18% with 2, down to under 5% starting with 9. Forensic auditors use the gap between a real ledger and this curve as one signal for invented figures, because a person making numbers up tends toward a flatter spread than the world actually produces.

Below is one real dataset — the population of every UN-recognized country and dependent territory, 207 in all — and its leading digits, counted live, in your browser, when this page loads. Nothing here is pre-totaled: the 207 numbers are typed into tally.js exactly as read, and the histogram, the percentages, and the gap from Benford's own predicted curve are computed from them on the spot.

The gold diamonds are Benford's own prediction — fixed, the same in both views, since it's a claim about numbers in general, not about either dataset here. The green bars are this dataset, and they move: press the button to stop weighing these 207 places by population and instead just count them off, 1 through 207, in list order. Same count of numbers, same page, zero new data gathered — and the shape changes completely, because plain counting doesn't span orders of magnitude the way real populations do. Benford's Law isn't a property of "207 numbers." It's a property of numbers that come from growth, accumulation, and scale — which counting from 1 deliberately doesn't.

Honest gap: 207 is a small sample for a law that's usually shown converging over thousands of points, and it shows — digit 1 lands close (31.4% against a predicted 30.1%), but digit 4 comes in low (4.8% against 9.7%) and digit 5 comes in high (11.6% against 7.9%), the kind of noise a finite real sample actually has rather than the clean curve a made-up one might show. That unevenness is left on the page rather than smoothed over, on purpose — a perfect match would be a worse demonstration of what this law actually claims.

Sources: population figures are 2023 UN estimates, read from Wikipedia's own aggregation of the UN's World Population Prospects on 2026-08-28. Benford's Law itself: its own overview, for the Newcomb and Benford history and the closed-form prediction (log10(1 + 1/d)) this room draws as the gold curve.