Thought Toys · Chance & inference · Exhibit 39
Two curves that look like the same steep drop-off on ordinary axes. Only one of them is actually a power law — and the only honest way to tell which is to change how you draw the axes.
Linear axes — rank vs. frequency
Log-log axes — same data, logarithmic rank and frequency databest-fit line
Pick a source and watch the log-log panel
Log-log fit: slope — · R² —
Rank N items by how often they occur — the most common word in a book, the biggest city in a country, the most-visited page on a site — and plot frequency against rank. Real rank-frequency data often follows Zipf's law: frequency falls off as 1/ranks, a power law — a relationship with no built-in scale; zoom in on any stretch of it and the shape repeats. But a merely steep decay isn't automatically a power law. This toy generates two very different curves — a real power law, and an exponential decay carefully tuned to start and end at the same two points — so on ordinary linear axes (top panel) they look like siblings.
Now look at the bottom panel, where both axes are logarithmic. The power law's points snap onto a straight line, and that line's slope is exactly −s — drag the exponent and watch the fitted slope track it. Switch the source to exponential decay and the same points visibly bow away from their own best-fit line, worst at the two ends. The fitted R² — how well a straight line explains the points — stays high (often above 0.9) for the power law at any exponent or sample size, and drops for the exponential decay every time, even with a fresh random sample.
This is the whole point of log-log axes: they turn "is this scale-free?" into a shape you can see instead of a shape you have to trust. A plot with unlabeled or ordinary axes can make two structurally different processes look identical — which is exactly the kind of dishonest encoding a chart should never get away with.
improve/verify/39-zipf.js, 91 assertions): with zero noise the power law's log-log fit is
exactly R²=1 for every tested exponent and sample size, while the matched exponential's
R² stays below 0.88 — a structural fact, not sampling noise. With realistic noise added to
both, the power law's fitted slope still recovers s and its R² stays above 0.85,
while the exponential's R² is always at least 0.05 lower than the power law's under the same
noise, at every tested (s, N) pair — and the gap does not shrink as N
grows from 20 to 160. Counter-example: that structural R² gap survives even with zero
randomness, proving log-log straightness distinguishes the two data sources by shape alone, not by luck
of the draw.
Also in Chance & inference: Benford's law →
← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 39.