# Benford's law The distribution of first digits, according to Benford's law. Each bar represents a digit, and the height of the bar is the percentage of numbers that start with that digit. Frequency of first significant digit of physical constants plotted against Benford's law

Benford's law, also called the first-digit law, is a phenomenological law about the frequency distribution of leading digits in many (but not all) real-life sets of numerical data. The law states that in many naturally occurring collections of numbers the small digits occur disproportionately often as leading significant digits. For example, in sets which obey the law the number 1 would appear as the most significant digit about 30% of the time, while larger digits would occur in that position less frequently: 9 would appear less than 5% of the time. If all digits were distributed uniformly, they would each occur about 11.1% of the time. Benford's law also concerns the expected distribution for digits beyond the first, which approach a uniform distribution.

It has been shown that this result applies to a wide variety of data sets, including electricity bills, street addresses, stock prices, population numbers, death rates, lengths of rivers, physical and mathematical constants, and processes described by power laws (which are very common in nature). It tends to be most accurate when values are distributed across multiple orders of magnitude.

The graph here shows Benford's law for base 10. There is a generalization of the law to numbers expressed in other bases (for example, base 16), and also a generalization from leading 1 digit to leading n digits.

It is named after physicist Frank Benford, who stated it in 1938, although it had been previously stated by Simon Newcomb in 1881.

## Mathematical statement A logarithmic scale bar. Picking a random x position uniformly on this number line, roughly 30% of the time the first digit of the number will be 1.

A set of numbers is said to satisfy Benford's law if the leading digit d (d ∈ {1, ..., 9}) occurs with probability $P(d)=\log_{10}(d+1)-\log_{10}(d)=\log_{10} \left(\frac{d+1}{d}\right)=\log_{10} \left(1+\frac{1}{d}\right).$

Numerically, the leading digits have the following distribution in Benford's law, where d is the leading digit and P(d) the probability:

d P(d) Relative size of P(d)
1 30.1%

2 17.6%

3 12.5%

4 9.7%

5 7.9%

6 6.7%

7 5.8%

8 5.1%

9 4.6%

The quantity P(d) is proportional to the space between d and d + 1 on a logarithmic scale. Therefore, this is the distribution expected if the mantissae of the logarithms of the numbers (but not the numbers themselves) are uniformly and randomly distributed. For example, a number x, constrained to lie between 1 and 10, starts with the digit 1 if 1 ≤ x < 2, and starts with the digit 9 if 9 ≤ x < 10. Therefore, x starts with the digit 1 if log 1 ≤ log x < log 2, or starts with 9 if log 9 ≤ log x < log 10. The interval [log 1, log 2] is much wider than the interval [log 9, log 10] (0.30 and 0.05 respectively); therefore if log x is uniformly and randomly distributed, it is much more likely to fall into the wider interval than the narrower interval, i.e. more likely to start with 1 than with 9. The probabilities are proportional to the interval widths, and this gives the equation above. (The above discussion assumed x is between 1 and 10, but the result is the same no matter how many digits x has before the decimal point.)

An extension of Benford's law predicts the distribution of first digits in other bases besides decimal; in fact, any base b ≥ 2. The general form is: $P(d)=\log_{b}(d+1)-\log_{b}(d)=\log_{b} \left(1+\frac{1}{d}\right).$

For b = 2 (the binary number system), Benford's law is true but trivial: All binary numbers (except for 0) start with the digit 1. (On the other hand, the generalization of Benford's law to second and later digits is not trivial, even for binary numbers.) Also, Benford's law does not apply to unary systems such as tally marks.

## Example

Examining a list of the heights of the 60 tallest structures in the world by category shows that 1 is by far the most common leading digit, irrespective of the unit of measurement:

Leading digit meters feet In Benford's law
Count  % Count  %
1 26 43.3% 18 30.0% 30.1%
2 7 11.7% 8 13.3% 17.6%
3 9 15.0% 8 13.3% 12.5%
4 6 10.0% 6 10.0% 9.7%
5 4 6.7% 10 16.7% 7.9%
6 1 1.7% 5 8.3% 6.7%
7 2 3.3% 2 3.3% 5.8%
8 5 8.3% 1 1.7% 5.1%
9 0 0.0% 2 3.3% 4.6%

## History

The discovery of Benford's law goes back to 1881, when the American astronomer Simon Newcomb noticed that in logarithm tables the earlier pages (that started with 1) were much more worn than the other pages. Newcomb's published result is the first known instance of this observation and includes a distribution on the second digit, as well. Newcomb proposed a law that the probability of a single number N being the first digit of a number was equal to log(N + 1) − log(N).

The phenomenon was again noted in 1938 by the physicist Frank Benford, who tested it on data from 20 different domains and was credited for it. His data set included the surface areas of 335 rivers, the sizes of 3259 US populations, 104 physical constants, 1800 molecular weights, 5000 entries from a mathematical handbook, 308 numbers contained in an issue of Reader's Digest, the street addresses of the first 342 persons listed in American Men of Science and 418 death rates. The total number of observations used in the paper was 20,229. This discovery was later named after Benford (making it an example of Stigler's Law).

In 1995, Ted Hill proved the result about mixed distributions mentioned below.

## Explanations

Arno Berger and Ted Hill have stated that, "The widely known phenomenon called Benford’s law continues to defy attempts at an easy derivation".

However, limited explanations of Benford's law have been offered.

### Overview

Benford's law states that the fractional part of the logarithm of the data is uniformly distributed between 0 and 1. It tends to apply most accurately to data that are distributed uniformly across many orders of magnitude. As a rule, the more orders of magnitude that the data evenly covers, the more accurately Benford's law applies.

For instance, one can expect that Benford's law would apply to a list of numbers representing the populations of UK villages, or representing the values of small insurance claims. But if a "village" is defined as a settlement with population between 300 and 999, or a "small insurance claim" is defined as a claim between $50 and$99, then Benford's law will not apply.

Consider the probability distributions shown below, referenced to a log scale. In each case, the total area in red is the relative probability that the first digit is 1, and the total area in blue is the relative probability that the first digit is 8. A broad probability distribution of the log of a variable, shown on a log scale. A narrow probability distribution of the log of a variable, shown on a log scale

For the left distribution, the size of the areas of red and blue are approximately proportional to the widths of each red and blue bar. Therefore, the numbers drawn from this distribution will approximately follow Benford's law. On the other hand, for the right distribution, the ratio of the areas of red and blue is very different from the ratio of the widths of each red and blue bar. Rather, the relative areas of red and blue are determined more by the height of the bars than the widths. Accordingly, the first digits in this distribution do not satisfy Benford's law at all.

Thus, real-world distributions that span several orders of magnitude rather uniformly (e.g. populations of villages / towns / cities, stock-market prices), are likely to satisfy Benford's law to a very high accuracy. On the other hand, a distribution that is mostly or entirely within one order of magnitude (e.g. heights of human adults, or IQ scores) is unlikely to satisfy Benford's law very accurately, or at all. However, it is not a sharp line: As the distribution gets narrower, the discrepancies from Benford's law typically increase gradually.

In terms of conventional probability density (referenced to a linear scale rather than log scale, i.e. P(x)dx rather than P(log x) d(log x)), the equivalent criterion is that Benford's law will be very accurately satisfied when P(x) is approximately proportional to 1/x over several orders-of-magnitude variation in x.

This discussion is not a full explanation of Benford's law, because we have not explained why we so often come across data-sets that, when plotted as a probability distribution of the logarithm of the variable, are relatively uniform over several orders of magnitude. The following sections give examples of how this might happen.

### Outcomes of exponential growth processes

An example of where Benford's law would occur is in measuring the population of bacteria over a period of time. If 1000 cells of bacteria are introduced into a dish full of food, the number of bacteria grows exponentially, doubling each day. Every few hours for 30 days, the number of bacteria that are in the dish are recorded. By the end of 30 days, there will be a trillion bacteria. This list of numbers will follow Benford's law quite accurately.

As the number of bacteria is growing exponentially, doubling each day, on the first day, the number of bacteria is increasing from 1000 towards 2000: The first digit is 1 the whole day. On the second day, there are 2000 bacteria increasing towards 4000: The first digit is 2 for fourteen hours and 3 for six hours. On the third day, there are 4000 bacteria increasing towards 8000: The first digit will pass through 4, 5, 6, and 7, spending less and less time in each digit. The next day, there are 8000 bacteria increasing towards 16,000. The leading digit will pass rapidly through 8 and 9 in a few hours, but then once there are 10,000 bacteria, the first digit will be 1 for a whole 24 hours, until the number of bacteria gets to 20,000. Therefore, the first digit is 1 with the highest probability, and 9 with the lowest.

An exponentially growing quantity is moving rightward on a log-scale at a constant rate. Measuring the number of bacteria at a random time in the 30-day window, gives a random point on the log-scale, uniformly distributed in that corresponding window (about 6 orders of magnitude). As explained in the previous section, this kind of probability distribution satisfies Benford's law with high accuracy.

Many real-world examples of Benford's law arise from multiplicative fluctuations. For example, if a stock price starts at $100, and then each day it gets multiplied by a randomly chosen factor between 0.99 and 1.01, then over an extended period of time the probability distribution of its price satisfies Benford's law with higher and higher accuracy. The reason is that the logarithm of the stock price is undergoing a random walk, so over time its probability distribution will get more and more broad and uniform (see above). (More technically, the central limit theorem says that multiplying more and more random variables will create a log-normal distribution with larger and larger variance, so eventually it covers many orders of magnitude almost uniformly.) Unlike multiplicative fluctuations, additive fluctuations do not lead to Benford's law: They lead instead to normal probability distributions (again by the central limit theorem), which do not satisfy Benford's law. For example, the "number of heartbeats that I experience on a given day" can be written as the sum of many random variables (e.g. the sum of heartbeats per minute over all the minutes of the day), so this quantity is unlikely to follow Benford's law. By contrast, that hypothetical stock price described above can be written as the product of many random variables (i.e. the price change factor for each day), so is likely to follow Benford's law quite well. ### Scale invariance If there is a list of lengths, the distribution of first digits of numbers in the list may be generally similar regardless of whether all the lengths are expressed in metres, or yards, or feet, or inches, etc. This is not always the case. For example, the height of adult humans almost always starts with a 1 or 2 when measured in meters, and almost always starts with 4, 5, 6, or 7 when measured in feet. But consider a list of lengths that is spread evenly over many orders of magnitude. For example, a list of 1000 lengths mentioned in scientific papers will include the measurements of molecules, bacteria, plants, and galaxies. If one writes all those lengths in meters, or writes them all in feet, it is reasonable to expect that the distribution of first digits should be the same on the two lists. In these situations, where the distribution of first digits of a data set is scale invariant (or independent of the units that the data are expressed in), the distribution of first digits is always given by Benford's Law. To be sure of approximate agreement with Benford's Law, the data has to be approximately invariant when scaled up by any factor up to 10. A lognormally distributed data set with wide dispersion has this approximate property, as do some of the examples mentioned above. For example, the first (non-zero) digit on this list of lengths should have the same distribution whether the unit of measurement is feet or yards. But there are three feet in a yard, so the probability that the first digit of a length in yards is 1 must be the same as the probability that the first digit of a length in feet is 3, 4, or 5. Applying this to all possible measurement scales gives the logarithmic distribution of Benford's law. ### Multiple probability distributions For numbers drawn from certain distributions (IQ scores, human heights) the Law fails to hold because these variates obey a normal distribution which is known not to satisfy Benford's law, since normal distributions can't span several orders of magnitude and the mantissae of their logarithms will not be (even approximately) uniformly distributed. However, if one "mixes" numbers from those distributions, for example by taking numbers from newspaper articles, Benford's law reappears. This can also be proven mathematically: if one repeatedly "randomly" chooses a probability distribution (from an uncorrelated set) and then randomly chooses a number according to that distribution, the resulting list of numbers will obey Benford's Law. A similar probabilistic explanation for the appearance of Benford's Law in everyday-life numbers has been advanced by showing that it arises naturally when one considers mixtures of uniform distributions. ## Applications ### Accounting fraud detection In 1972, Hal Varian suggested that the law could be used to detect possible fraud in lists of socio-economic data submitted in support of public planning decisions. Based on the plausible assumption that people who make up figures tend to distribute their digits fairly uniformly, a simple comparison of first-digit frequency distribution from the data with the expected distribution according to Benford's Law ought to show up any anomalous results. Following this idea, Mark Nigrini showed that Benford's Law could be used in forensic accounting and auditing as an indicator of accounting and expenses fraud. In practice, applications of Benford's Law for fraud detection routinely use more than the first digit. ### Legal status In the United States, evidence based on Benford's law has been admitted in criminal cases at the federal, state, and local levels. ### Election data Benford's Law has been invoked as evidence of fraud in the 2009 Iranian elections, and also used to analyze other election results. ### Macroeconomic data Similarly, the macroeconomic data the Greek government reported to the European Union before entering the eurozone was shown to be probably fraudulent using Benford's law, albeit years after the country joined. ### Genome data The number of open reading frames and their relationship to genome size differs between eukaryotes and prokaryotes with the former showing a log-linear relationship and the latter a linear relationship. Benford's law has been used to test this observation with an excellent fit to the data in both cases. ### Scientific fraud detection A test of regression coefficients in published papers showed agreement with Benford's law. As a comparison group subjects were asked to fabricate statistical estimates. The fabricated results failed to obey Benford's law. ## Statistical tests Although the chi squared test has been used to test for compliance with Benford's law it has low statistical power when used with small samples. The Kolmogorov–Smirnov test and the Kuiper test are more powerful when the sample size is small particularly when Stephens's corrective factor is used. These tests may be overly conservative when applied to discrete distribution. Values for the Benford test have been generated by Morrow. The critical values of the test statistics are shown below: α Test 0.10 0.05 0.01 Kuiper Test 1.191 1.321 1.579 Kolmogorov–Smirnov 1.012 1.148 1.420 Two alternative tests specific to this law have been published: first, the max (m) statistic is given by $m = \sqrt{N}\cdot\operatorname*{max}_{i=1}^{9} \Big\{\Pr (X \text{ has FSD}=i)-\log_{10}(1+1/i) \Big\},$ and secondly, the distance (d) statistic is given by $d= \sqrt{N \cdot \sum_{i=1}^{9}\Big[\Pr ( X \text{ has FSD}=i ) - \log_{10}(1+1/i) \Big]^{2}},$ where FSD is the First Significant Digit and $N$ is the sample size. Morrow has determined the critical values for both these statistics, which are shown below: α Statistic 0.10 0.05 0.01 Leemis' m 0.851 0.967 1.212 Cho–Gaines' d 1.212 1.330 1.569 Nigrini has suggested the use of a z statistic $z = \frac { \, | p_o - p_e | - \frac{1}{2n} \, } { s_i }$ with $s_i = \left[ \frac { p_e ( 1 - p_e ) } { n } \right]^{1/2},$ where |x| is the absolute value of x, n is the sample size, 1/2n is a continuity correction factor, pe is the proportion expected from Benford's law and po is the observed proportion in the sample. Morrow has also shown that for any random variable X (with a continuous pdf) divided by its standard deviation (σ), a value A can be found such that the probability of the distribution of the first significant digit of the random variable (X/σ)A will differ from Benford's Law by less than ε > 0. The value of A depends on the value of ε and the distribution of the random variable. A method of accounting fraud detection based on bootstrapping and regression has been proposed. ## Generalization to digits beyond the first It is possible to extend the law to digits beyond the first. In particular, the probability of encountering a number starting with the string of digits n is given by: $\log_{ 10 } \left( n + 1 \right )- \log_{ 10 } \left( n \right ) = \log_{ 10 } \left( 1 + \frac{ 1 }{ n } \right)$ (For example, the probability that a number starts with the digits 3, 1, 4 is log10(1 + 1/314) ≈ 0.0014.) This result can be used to find the probability that a particular digit occurs at a given position within a number. For instance, the probability that a "2" is encountered as the second digit is $\log_{ 10 } \left( 1 + \frac{ 1 }{ 12 } \right ) + \log_{ 10 } \left( 1 + \frac{ 1 }{ 22 } \right )+ \cdots + \log_{ 10 } \left( 1 + \frac{ 1 }{ 92 } \right) \approx 0.109$ And the probability that d (d = 0, 1, ..., 9) is encountered as the n-th (n > 1) digit is $\sum_{ k = 10^{ n - 2 } }^{ 10^{ n - 1 } - 1 } \log_{ 10 } \left( 1 + \frac{ 1 }{ 10k + d } \right )$ The distribution of the n-th digit, as n increases, rapidly approaches a uniform distribution with 10% for each of the ten digits. Four digits is often enough to assume a uniform distribution of 10% as '0' appears 10.0176% of the time in the fourth digit while '9' appears 9.9824% of the time. ## Tests with common distributions Benford's law was empirically tested against the numbers (up to the 10th digit) generated by a number of important distributions, including the uniform distribution, the exponential distribution, the half-normal distribution, the right-truncated normal, the normal distribution, the chi square distribution and the log normal distribution.  In addition to these the ratio distribution of two uniform distributions, the ratio distribution of two exponential distributions, the ratio distribution of two half-normal distributions, the ratio distribution of two right-truncated normal distributions, the ratio distribution of two chi-square distributions (the F distribution) and the log normal distribution were tested. The uniform distribution as might be expected does not obey Benford's law. In contrast, the ratio distribution of two uniform distributions is well described by Benford's law. Benford's law also describes the exponential distribution and the ratio distribution of two exponential distributions well. Although the half-normal distribution does not obey Benford's law, the ratio distribution of two half-normal distributions does. Neither the right-truncated normal distribution nor the ratio distribution of two right-truncated normal distributions are well described by Benford's law. This is not surprising as this distribution is weighted towards larger numbers. Neither the normal distribution nor the ratio distribution of two normal distributions (the Cauchy distribution) obey Benford's law. The fit of chi square distribution depends on the degrees of freedom (df) with good agreement with df = 1 and decreasing agreement as the df increases. The F distribution is fitted well for low degrees of freedom. With increasing dfs the fit decreases but much more slowly than the chi square distribution. The fit of the log-normal distribution depends on the mean and the variance of the distribution. The variance has a much greater effect on the fit than does the mean. Larger values of both parameters result in better agreement with the law. The ratio of two log normal distributions is a log normal so this distribution was not examined. Other distributions that have been examined include the Muth distribution, Gompertz distribution, Weibull distribution, gamma distribution, log-logistic distribution and the exponential power distribution all of which show reasonable agreement with the law. The Gumbel distribution – a density increases with increasing value of the random variable – does not show agreement with this law. ## Distributions known to obey Benford's law Some well-known infinite integer sequences provably satisfy Benford's Law exactly (in the asymptotic limit as more and more terms of the sequence are included). Among these are the Fibonacci numbers, the factorials, the powers of 2, and the powers of almost any other number. Likewise, some continuous processes satisfy Benford's Law exactly (in the asymptotic limit as the process continues through time). One is an exponential growth or decay process: If a quantity is exponentially increasing or decreasing in time, then the percentage of time that it has each first digit satisfies Benford's Law asymptotically (i.e. increasing accuracy as the process continues through time). ## Distributions known to not obey Benford's law Square roots and reciprocals do not obey this law. The 1974 Vancouver, Canada telephone book violates Benford's law because regulations require that telephone numbers have a fixed number of digits and do not begin with 1. Benford's law is violated by the populations of all places with population at least 2500 from five US states according to the 1960 and 1970 censuses, where only 19% began with digit 1 but 20% began with digit 2, for the simple reason that the truncation at 2500 introduces statistical bias. The terminal digits in pathology reports violate Benford's law due to rounding, and the fact that terminal digits are never expected to follow Benford's law in the first place. ## Criteria for distributions expected and not expected to obey Benford's Law A number of criteria—applicable particularly to accounting data—have been suggested where Benford's Law can be expected to apply and not to apply. ### Distributions that can be expected to obey Benford's Law • When the mean is greater than the median and the skew is positive • Numbers that result from mathematical combination of numbers: e.g. quantity × price • Transaction level data: e.g. disbursements, sales • Numbers produced when doing any multiplicative calculations with an Oughtred slide rule, since the answers naturally fall into the right logarithmic distribution. ### Distributions that would not be expected to obey Benford's Law • Where numbers are assigned sequentially: e.g. check numbers, invoice numbers • Where numbers are influenced by human thought: e.g. prices set by psychological thresholds ($1.99)
• Accounts with a large number of firm-specific numbers: e.g. accounts set up to record \$100 refunds
• Accounts with a built-in minimum or maximum
• Where no transaction is recorded

## Moments

Moments of random variables for the digits 1 to 9 following this law have been calculated:

For the first and second digit distribution these values are also known:

A table of the exact probabilities for the joint occurrence of the first two digits according to Benford's law is available, as is the population correlation between the first and second digits: ρ = 0.0561.