Benford’s Law
Benford’s law predicts that leading digits are not uniform: 1 appears about 30% of the time. Compare real-looking datasets with the theoretical curve.
Cyan bars are the observed leading-digit frequencies; amber outlines are Benford’s prediction. In data spanning many orders of magnitude, 1 is expected about 30% of the time and 9 under 5%. Small samples fluctuate more, but they converge as the sample grows.
What you are seeing
For many natural datasets, the probability that the first digit is d is log₁₀(1 + 1/d).
This gives about 30.1% for 1, 17.6% for 2, and only 4.6% for 9.
The law appears in values that span multiple orders of magnitude, such as populations, incomes, and physical constants.
Why it matters
Benford’s law is used in forensic accounting, fraud detection, and data-quality checks. Large deviations can be a signal that numbers were fabricated.
Complexity & details
Counting first digits for N values costs O(N). The expected distribution costs O(1).
Frequently asked questions
Does every dataset follow Benford’s law?+
No. It works best for data spanning several orders of magnitude. Uniform random numbers or tightly bounded values do not follow it.
Can Benford’s law prove fraud?+
No. It flags anomalies worth investigating. Legitimate data can also deviate, and fabricated data can be designed to fit.