Benford law (source code)

= Benford law
{c}
{title2=$\mathbb P(D=d)=\log_{10}(1+1/d)$}

For a positive <random variable> $X$, let $D\in\{1,\ldots,9\}$ be its first nonzero base-ten digit. The <Benford law> is the <discrete probability distribution> with <probability mass function>
$$
\mathbb P(D=d)=\log_{10}\!\left(\frac{d+1}{d}\right)=\log_{10}(1+1/d),\qquad d=1,\ldots,9.
$$
Here $X$ need not be an <integer>: $0.0042$, $4.2$ and $4200$ all have $D=4$. Multiplication by an <integer> power of ten changes the decimal point's position and leaves the first nonzero digit unchanged. Zero has no first nonzero digit, so exclude it. For negative inputs one may explicitly use their <absolute values>, still excluding zero; that convention must be stated rather than applying a <logarithm> to a negative number.

The <Benford law> favors small digits: $\mathbb P(D=1)=\log_{10}2\approx0.301029996$, whereas $\mathbb P(D=9)=\log_{10}(10/9)\approx0.04575749$. Thus the model assigns about $30.10\%$ to digit one and $4.58\%$ to digit nine. The masses are positive and their normalization is a finite <telescoping series>:
$$
\sum_{d=1}^9\mathbb P(D=d)=\sum_{d=1}^9\bigl(\log_{10}(d+1)-\log_{10}d\bigr)=\log_{10}10-\log_{10}1=1.
$$

\Image[/benford-leading-digit-probabilities.png]
{title=Benford probabilities compared with equal leading-digit probabilities in two constructed laws}

Why can digit one be so common? In a <decimal significand> interval $[1,10)$, the digit-one region $[1,2)$ occupies a larger fraction of the <logarithmic scale> than the digit-nine region $[9,10)$. The precise assumption is that the <fractional part> of the base-ten <logarithm> is distributed uniformly on $[0,1)$; <Benford law from logarithmic uniformity> turns those unequal interval lengths into <probabilities>. This makes a surprising digit pattern into a simple geometry of multiplicative size. The logarithmic explanation is also presented in https://pdodds.w3.uvm.edu/pocs/docs/2025-2026pocsverse-benfordslaw-freeze-dried.pdf[Peter Sheridan Dodds, Benford's Law, essential story].

The <Benford law> is useful as a proposed model for leading digits when the mechanism supports logarithmic uniformity or an appropriate limiting argument, such as <Benford frequencies for powers of an integer>. Merely spanning many powers of ten does not establish that assumption. A discrepancy from the <Benford law> can prompt investigation of the model and data collection; by itself it does not establish fraud, and agreement does not establish authenticity.

Simon Newcomb's 1881 paper, \i[Note on the Frequency of Use of the Different Digits in Natural Numbers], appeared in the \i[American Journal of Mathematics] 4, pp. 39–40. Its opening connects unequal leading-digit frequencies with the faster wear of early pages in <logarithm> tables. The publication metadata and original opening excerpt are available in https://www.jstor.org/stable/2369148[Newcomb (1881), original publication record] and https://www.benfordonline.net/fullreference/414[Newcomb (1881), reproduced opening excerpt]{ref}. Frank Benford's \i[The Law of Anomalous Numbers], \i[Proceedings of the American Philosophical Society] 78 (1938), pp. 551–572, likewise discusses worn <logarithm> tables on p. 551 and tabulates observations on p. 553. See https://pdfcoffee.com/the-law-of-anomalous-numbers-pdf-free.html[Benford (1938), transcription of the original paper with page numbers and publication metadata]. These observations motivated study of the digit pattern; they do not make the <Benford law> universal.