Benford's Law and Data Spread

Benford's law is the observation that for many datasets, the distribution of their first significant digit follows a nonuniform law given by:
Probability(leading digit = ) = .
Thus the probability that the leading digit is 1 is 30%, while for the digit 7 to lead, the probability is merely 6%. An underlying reason for this is that data that spans many orders of magnitude has the errors within each order cancel out (see Details section). Thus datasets with large logarithmic spread will naturally follow the law, while datasets with small spread will not.
This Demonstration shows any of the scatter plots of 130 datasets derived from the data on countries in Mathematica; the points in a scatter plot are of the form (logarithmic spread, Benford deviation). Here spread is computed by taking base-10 logarithms and eliminating extreme outliers; the Benford deviation is the norm of the vector difference of the observed frequencies and the Benford predictions, normalized to lie between 0 and 1. Below the scatter plot are plots of the raw distribution, the agreement of the digit probabilities with Benford's law, and the distribution of the base-10 logarithms of the data. Note that the scatter plot supports the explanation remarkably well: all properties with large spread have small Benford deviation, and all properties with small spread have large Benford deviation.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The connection between Benford's law and the spread of the data is lucidly described in [1] (see also Chapter 21 of [3] and Chapter 1 of [3]). The idea is that when viewing a distribution in a base-10 log scale, the proportion of the axis corresponding to numbers beginning with 1 is . Hence, so long as there are several orders of magnitude, the error between this proportion and the proportion of the area lying above these numbers should be small.
[1] R. M. Fewster, "A Simple Explanation of Benford's Law," The American Statistician, 63(1), 2009 pp. 26-32.
[2] Benford's Law: Theory and Applications, edited by Steven J. Miller, Princeton: Princeton Univ. Pr., 2015.
[3] S. Wagon, Mathematica in Action, 3rd ed., New York: Springer, 2010.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2018 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+