Benford's law refers to probability distributions that seem to govern the significant digits in real data sets. The law is named for the American physicist and engineer Frank Benford, although the law

was actually discovered earlier by the astronomer and mathematician Simon Newcomb.

To understand Benford's law, we need some preliminaries. Recall that a positive real number $x$ can be written uniquely in the form $x=y10^{n}$ (sometimes called scientific notation) where $y\in \left[1/10 , 1\right)$ is the mantissa and $n\in \mathbb{Z}$ is the exponent (both of these terms are base 10, of course). Note that

$$\lg x=\lg y+n$$where the logarithm function is the base 10 common logarithm instead of the usual base $e$ natural logarithm. In the old days BC (before calculators), one would compute the logarithm of a number by looking up the logarithm of the mantissa in a table of logarithms, and then adding the exponent. Of course, these remarks apply to any base $b> 1$, not just base 10. Just replace 10 with $b$ and the common logarithm with the base $b$ logarithm.

Suppose now that $X$ is a number selected at random from a certain data set of positive numbers. Based on empirical evidence from a number of different types of data, Newcomb, and later Benford, noticed that the mantissa $Y$ of $X$ seemed to have distribution function $F(y)=1+\lg y$ for $y\in \left[1/10 , 1\right)$. We will generalize this to an arbitrary base $b> 1$. Thus, let

$$F(y)=1+_{b}(y)\text{,\hspace{1em}}\frac{1}{b}\le y< 1$$Show that $F$ satisfies the mathematical properties of a distribution function for a continuous distribution on $\left[\frac{1}{b} , 1\right)$.

Note that the corresponding probability density function is $f(y)=\frac{1}{y\ln b}$ for $y\in \left[\frac{1}{b} , 1\right)$,

Show that

- $(Y)=\frac{b-1}{b\ln b}$
- $\sigma(Y)^2=\frac{b-1}{b^{2}\ln b}(\frac{b+1}{2}-\frac{b-1}{\ln b})$

For the standard base 10 decimal case

- Sketch the graph of $f$.
- Compute the mean and variance explicitly.

Assume now that the base is a positive integer $b\in \mathbb{N}_{+}$, which of course is the case in standard number systems. Suppose that the sequence of digits of our mantissa $Y$ (in base $b$) is $\left(\begin{array}{c}N_{1}\\ N_{2}\\ \end{array}\right)$, so that

$$Y=\sum_{k=1}^{\infty} N_{k}b^{-k}$$Thus, our leading digit $N_{1}$ takes values in $\{1, 2, , b-1\}$, while each of the other significant digits takes values in $\{0, 1, , b-1\}$. Our goal is to compute the joint probability density function of the first $k$ digits. But let's start, appropriately enough, with the first digit law, the discrete probability density function of the leading digit:

Show that
$(N_{1}=n)=_{b}(1+\frac{1}{n})=_{b}(n+1)-_{b}(n)$
for
$n\in \{1, 2, , b-1\}$.
*Hint*: Note that
$N_{1}=n$
if and only if
$Y\in \left[\frac{n}{b} , \frac{n+1}{b}\right)$.

Consider the standard base 10 decimal case.

- Explicitly compute the values of the probability density function of $N_{1}$ and sketch the graph.
- Find $(N_{1})$
- Find $\sigma(N_{1})^2$

Now, to compute the joint probability density function of the first $k$ significant digits, some additional notation will help. If $n_{1}\in \{1, 2, , b-1\}$ and $n_{j}\in \{0, 1, , b-1\}$ for $j\in \{2, 3, , k\}$, let

$$n_{1}n_{2}n_{k}_{b}=\sum_{j=1}^{k} n_{j}b^{(k-j)}$$Of course, this is just the base $b$ version of what we do in our standard base 10 system: we represent integers as strings of digits between 0 and 9 (except that the first digit cannot be 0). Here is a base 5 example:

$$324_{5}=35^{2}+25^{1}+45^{0}$$Show that

$$(N_{1}=n_{1}, N_{2}=n_{2}, , N_{k}=n_{k})=_{b}(1+\frac{1}{n_{1}n_{2}n_{k}_{b}})$$*Hint*: Note that
$\{N_{1}=n_{1}, N_{2}=n_{2}, , N_{k}=n_{k}\}=\{Y\in \left[\frac{n_{1}n_{2}n_{k}_{b}}{b^{k}} , \frac{n_{1}n_{2}n_{k}_{b}+1}{b^{k}}\right)\}$.
Now use the distribution function of
$Y$
and properties of logarithms.

In the standard base 10 decimal case, explicitly compute the values of the joint probability density function of $\left(\begin{array}{c}N_{1}\\ N_{2}\end{array}\right)$.

Of course, the probability density function of a given digit can be obtained by summing the joint probability density over the unwanted digits in the usual way. However, except for the first digit, these functions do not reduce to simple expressions.

Show that

$$(N_{2}=n)=\sum_{k=1}^{b-1} _{b}(1+\frac{1}{kn_{b}})=\sum_{k=1}^{b-1} _{b}(1+\frac{1}{kb+n})\text{,\hspace{1em}}n\in \{0, 1, , b-1\}$$Consider the standard base 10 decimal case.

- Explicitly compute the values of the probability density function of $N_{2}$, and sketch the graph.
- Find $(N_{2})$
- Find $\sigma(N_{2})^2$

Comparing Exercise 6 and Exercise 10, note that the distribution of $N_{2}$ is flatter than the distribution of $N_{1}$. In general, it turns out that distribution of $N_{k}$ converges to the uniform distribution on $\{0, 1, , b-1\}$ as $k\to \infty $. Interestingly, the digits are dependent.

Use the results of Exercise 6, Exercise 8, and Exercise 10 to show that $N_{1}$ and $N_{2}$ are dependent in the standard base 10 decimal case.

In the standard base 10 decimal case, find each of the following.

- $(N_{1}=5, N_{2}=3, N_{3}=1)$
- $(N_{1}=3, N_{2}=1, N_{3}=5)$
- $(N_{1}=1, N_{2}=3, N_{3}=5)$

Aside from the empirical evidence noted by Newcomb and Benford (and many others since), why does Benford's law work? For a theoretical explanation, see the article A Statistical Derivation of Significant Digit Law, by Ted Hill.