The Newcomb–Benford law, also known as the first-digit law, gives the probability distribution associated with the first digit of a dataset so that, for example, the first significant digit has a probability of 30.1% of being 1 and 4.58% of being 9. This law can be extended to the second and next significant digits. This article presents an introduction to the discovery of the law and its derivation from the scale invariance property as well as some applications and examples. Additionally, a simple model of a Markov process inspired by scale invariance is proposed. Within this model, it is proved that the probability distribution irreversibly converges to the Newcomb–Benford law, in analogy to the irreversible evolution toward equilibrium of physical systems in thermodynamics and statistical mechanics.

## I. INTRODUCTION

In the late 19th century, an astronomer and mathematician visits his institution's library and consults a table of logarithms to perform certain astronomical calculations. As on previous occasions, he is struck by the fact that the first pages (those corresponding to numbers that start at 1) are much more worn than the last ones (corresponding to numbers that start at 9). Intrigued, this time he decides not to overlook the matter. He closes his eyes to concentrate, sketches a few calculations on a piece of paper, and finally smiles. He has found the answer and it turns out to be enormously simple and elegant.

A little over half a century later, a physicist and electrical engineer, who is unaware of his predecessor's discovery, observes the same curious phenomenon on the pages of logarithm tables and arrives at the same conclusion. Both have understood that, in a long list of records ${rn}$ obtained from measurements or observations, the fraction *p _{d}* of records beginning with the significant digit $d=1,2,\u2026,9$ is not $pd=1/9$, as one might naively expect, but rather follows a logarithmic law. More specifically,

The numeric values of *p _{d}* are shown in the second column of Table I. We see that the records that start with 1, 2, or 3 account for around 60% of the total, while the other six digits must settle for the remaining 40%.

Digit . | First . | Second . | Third . | Fourth . |
---|---|---|---|---|

d
. | p
. _{d} | $pd(2)$ . | $pd(3)$ . | $pd(4)$ . |

0 | … | 0.119 68 | 0.101 78 | 0.100 18 |

1 | 0.301 03 | 0.113 89 | 0.101 38 | 0.100 14 |

2 | 0.176 09 | 0.108 82 | 0.100 97 | 0.100 10 |

3 | 0.124 94 | 0.104 33 | 0.100 57 | 0.100 06 |

4 | 0.096 91 | 0.100 31 | 0.100 18 | 0.100 02 |

5 | 0.079 18 | 0.096 68 | 0.099 79 | 0.099 98 |

6 | 0.066 95 | 0.093 37 | 0.099 40 | 0.099 94 |

7 | 0.057 99 | 0.090 35 | 0.099 02 | 0.099 90 |

8 | 0.051 15 | 0.087 57 | 0.098 64 | 0.099 86 |

9 | 0.045 76 | 0.084 90 | 0.098 27 | 0.099 82 |

Digit . | First . | Second . | Third . | Fourth . |
---|---|---|---|---|

d
. | p
. _{d} | $pd(2)$ . | $pd(3)$ . | $pd(4)$ . |

0 | … | 0.119 68 | 0.101 78 | 0.100 18 |

1 | 0.301 03 | 0.113 89 | 0.101 38 | 0.100 14 |

2 | 0.176 09 | 0.108 82 | 0.100 97 | 0.100 10 |

3 | 0.124 94 | 0.104 33 | 0.100 57 | 0.100 06 |

4 | 0.096 91 | 0.100 31 | 0.100 18 | 0.100 02 |

5 | 0.079 18 | 0.096 68 | 0.099 79 | 0.099 98 |

6 | 0.066 95 | 0.093 37 | 0.099 40 | 0.099 94 |

7 | 0.057 99 | 0.090 35 | 0.099 02 | 0.099 90 |

8 | 0.051 15 | 0.087 57 | 0.098 64 | 0.099 86 |

9 | 0.045 76 | 0.084 90 | 0.098 27 | 0.099 82 |

Our 19th century character is Simon Newcomb (Fig. 1) and he published his discovery in a modest two-page note.^{1} The second character is Frank Benford (Fig. 2) and he wrote a 22-page article^{2} in which, in addition to mathematically justifying Eq. (1), he showed its validity in the analysis of more than 20 000 first digits taken from sources as varied as river areas, populations of American cities, physical constants, atomic and molecular weights, specific heats, numbers taken from newspapers or the Reader's Digest, postal addresses, …, and the series $n\u22121,\u2009n$, *n*^{2}, or $n!$, among others, with $n\u2208[[1,100]]$.

With such overwhelming evidence, it is not surprising that Eq. (1) is usually known as *Benford's law* (or first-digit law), even though it was found nearly sixty years earlier by Newcomb. This is one more manifestation of the so-called Stigler's law, according to which no scientific discovery is named after the person who discovered it in the first place. In fact, as Stigler himself points out,^{3} the law that bears his name was actually spelled out in a similar way twenty-three years earlier by the American sociologist Robert K. Merton. In order not to fall completely into Stigler's law, many authors refer to Eq. (1) as *Newcomb–Benford's law* and that is the convention (by means of the acronym NBL) that we will follow in this article.

While the literature on the NBL in specialized journals is vast,^{4} and several books on the topic are available,^{5,6} the number of papers in general or science education journals is much scarcer.^{7–9} In this paper, apart from revisiting the NBL and illustrating it with a few examples, we construct a Markov-chain model inspired by the invariance property of the NBL under the operation of a change of scale.

The remainder of the paper is organized as follows. The connection between the NBL (and some of its generalizations) with the property of scale invariance is formulated in Sec. II. This is followed by a few examples in Sec. III. The most original part is contained in Sec. IV, where our Markov-chain model is proposed and solved. Finally, the paper is closed in Sec. V with some concluding remarks. For the interested reader, Appendices A–C contain the most technical and mathematical parts of Secs. II and IV.

## II. ORIGIN OF THE LAW

Oftentimes, when one first speaks to a friend, relative, or even a colleague about the NBL, their first reaction is usually of skepticism. Why is the first digit not evenly distributed among the nine possible values? A simple argument shows that, if a robust distribution law exists, it cannot be the uniform distribution whatsoever.

Imagine a long list of river lengths, mountain heights, and country surfaces, for example. It is possible that the lengths of the rivers are in km, the heights of the mountains in m, and the surfaces of countries in km^{2}, but they could also be expressed in miles, feet, or acres, respectively. Will the distribution *p _{d}* depend on whether we use some units or others, or even if we mix them? It seems logical that the answer should be negative; that is, the

*p*distribution should be (statistically) independent of the units chosen; in other words, it is expected that the

_{d}*p*distribution is

_{d}*invariant under a change of scale*. The uniform distribution $pd=19$ obviously does not follow that property of invariance. Suppose we start from a dataset in which all the values of the first digit are equally represented. If we multiply all the records in the dataset by 2, we can see that those records that started before with 1, 2, 3, and 4 then start with either 2 or 3, either 4 or 5, either 6 or 7, and either 8 or 9, respectively. On the other hand, all those that started with 5, 6, 7, 8, or 9 start now with 1. All those possibilities are schematically shown in Fig. 3. Therefore, if $pd=19$ initially, then $p1=59$ and $p2+p3=p4+p5=p6+p7=p8+p9=19$ after doubling all the records, thus destroying the initial uniformity.

Thus, the most identifying hallmark of the NBL is that it must be applied to records that have units or, as Newcomb himself writes,^{1} “As natural numbers occur in nature, they are to be considered as the ratios of quantities.”

While relatively formal mathematical proofs of the NBL can be found in the literature,^{10–12} in Appendix A, we present a sketch of a simpler, physicist-style derivation of the law by imposing invariance under a change of scale.^{13}

Equation (1) can be generalized beyond the first digit. The probability that the *m* first digits of a record match the ordered string $(d1,d2,\u2026,dm)$, where $d1\u2208{1,2,\u2026,9}$ and $di\u2208{0,1,2,\u2026,9}$ if $i\u22652$, is given by (see Appendix A)

As an example, the probability that the first three digits of a record form precisely the string $(3,1,4)$ is $p3,1,4=log101+1/314=0.001\u200938$.

Once we have $pd1,d2,\u2026,dm$, we can calculate the probability $pd(m)$ that the *m*th digit is *d*, regardless of the values of the preceding $m\u22121$ digits, just by summing for all possible values of those preceding $m\u22121$ digits,

In Table I, the law for the first digit, *p _{d}*, is accompanied by the laws for the second, third, and fourth digits, obtained from Eqs. (2) and (3). As the digit moves to the right, the probability distribution becomes less and less disparate.

In Fig. 3 we saw that, when multiplying a dataset ${rn}$ by 2, part of the records that started with $d=1,2,3,4$, specifically those that start with the first two digits $(d,0),\u2009(d,1),\u2009(d,2),\u2009(d,3)$, or $(d,4)$, will start with 2*d*, while the rest will start with $2d+1$. Let us call *α _{d}* the fraction of records that, initially starting with $d=1,2,3,4$, start with 2

*d*by doubling all the records. Thus,

If the dataset fulfills the NBL, then one has

We will use these values later in Sec. IV.

## III. APPLICATIONS AND EXAMPLES

The applications and verifications of the NBL are numerous and cover topics as varied and prosaic as the study of the genome,^{14} atomic,^{15} nuclear,^{8,16} and particle^{17} physics, astrophysics,^{18} quantum correlations,^{19} toxic emissions,^{20} biophysics,^{21} medicine,^{22} dynamical systems,^{23} distinction of chaos from noise,^{24} statistical physics,^{25} scientific citations,^{26} tax audits,^{5,27} electoral^{28} or scientific^{29} frauds, gross domestic product,^{30} stock market,^{9,31} inflation data,^{32} climate change,^{33} world wide web,^{34} internet traffic,^{35} social networks,^{36} textbook exercises,^{37} image processing,^{38} religious activities,^{39} dates of birth,^{40} hydrology and geology,^{41} fragmentation processes,^{42} the first letters of words,^{43} or even COVID-19.^{44} Other examples can be seen in the link of Ref. 45. In this section, we will present some additional examples.

Let us start with one of the situations that Benford himself studied in his classic paper:^{2} city populations. Using data from the Spanish National Institute of Statistics,^{46} we have considered the 2019 population of the 165 municipalities in the province of Badajoz (plus the total population of the province of Badajoz), of the 223 municipalities of the province of Cáceres (plus the total population of the province of Cáceres), and the total population of the 388 municipalities of the Spanish region of Extremadura, which encompasses the provinces of Badajoz and Cáceres (plus the total populations of the provinces of Badajoz and Cáceres). We have also considered the population (according to the 2016 census) of the $8\u2009110$ Spanish municipalities. For all these lists of records, we have analyzed the frequency of those starting with $d=1,2,\u20269$ and the results are compared in Fig. 4. There is a good general agreement between the population data and the NBL predictions. This is interesting, since it is not obvious that the distribution of the number of inhabitants of municipalities should be invariant under a change of scale.

Let us now turn to two examples from astronomy. In the first one, we take the distance from Earth (in light-years and in parsecs) to the 300 brightest stars.^{47} In the second case, the data are the daily number of sunspots from 1818 to the present.^{48} As seen in Fig. 5, the distances between our planet and the 300 brightest stars agree reasonably well with the NBL, despite the fact that the list is not excessively long (only 300 data points) and that there are “local” deviations (for example, $p6<p7$ in the two choices of units). This general agreement was to be expected, since the distribution of digits in distances (which are expressed in units) is a clear example of invariance under a change of scale. However, in the case of the daily number of sunspots, quantitative (although not qualitative) differences are observed with the NBL, especially in the *d* = 1, 3, 4, and 5 cases. It should be noted that, although the series is rather long (more than $59\u2009000$ records, after excluding days without data or with zero spots), each record only has one, two, or three digits (the maximum number of sunspots was 528 and corresponded to August 26, 1870), thus producing a certain bias to records starting with 1. Moreover, the daily number of sunspots cannot be expressed in units and therefore may not be scale-invariant.

Finally, we have analyzed the prices of $1\u2009016$ items from a chain of fashion retailers^{49} and of $1\u2009373$ products from a chain of hypermarkets.^{50} The results are shown in Fig. 6. In this case, the discrepancies with the NBL are more pronounced. Although the highest frequencies occur for *d* = 1 and *d* = 2, the observed values of *p _{d}* do not decrease monotonically with increasing

*d*. In the case of the fashion retailers, we have $p4>p3$ and $p9>p8>p6>p7$; in the prices of the chain of hypermarkets, $p8>p9>p7>p6$. In principle, one might think that, since they can be expressed in euro, pound, dollar, peso, ruble, yen, …, prices should satisfy the property of invariance under a change of scale inherent to the NBL. However, commercial and artificial pricing strategies must be superimposed on this invariance, which generates relevant deviations with respect to the NBL.

## IV. A SIMPLE MODEL OF A MARKOV CHAIN BASED ON THE SCALE INVARIANCE PROPERTY OF THE NEWCOMB–BENFORD DISTRIBUTION

As already said, NBL, Eq. (1), is invariant under a change of scale; that is, if we start from a dataset ${rn}$ that fulfills the NBL and multiply all the records by a constant *λ* (other than a fractional power of 10), the resulting dataset ${\lambda rn}$ still fulfills the NBL.

It is tempting to conjecture that the NBL should be an *attractor* of this process. This would mean that, if we started from an initial dataset ${rn(0)}$ that *does not* fulfill the NBL and generated new sets ${rn(t)}={\lambda trn(0)}$ at times $t=1,2,\u2026$ by multiplying each successive dataset by *λ*, the first-digit distribution ${pd(t)}$ of the generated sets would converge toward the NBL. However, this is not the case. As illustrated in Fig. 7 for the case *λ* = 2 and an initial dataset of 10^{4} random numbers, the time-dependent distribution ${pd(t)}$ exhibits a quasiperiodic oscillatory pattern around the NBL distribution without any apparent amplitude attenuation. In fact, since $210=1024\u2243103$, the distribution nearly returns to the uniform initial one at times $t=10,20,30,\u2026$. This behavior is reminiscent of the Poincaré recurrence time in mechanical systems and the associated Zermelo paradox about irreversibility.^{51}

In the transformation ${rn(t)}\u2192{rn(t+1)=2rn(t)}$, the first-digit distribution changes, according to Fig. 3, as

*α*($d=1,2,3,4$) are defined by Eq. (4). Note that, in general, the fractions

_{d}*α*depend on the distributions of the first digit, $pd(t)$, and of the

_{d}*first two digits*, $pd,d2(t)$, of the dataset ${rn(t)}$ [see Eq. (4)]. As a consequence, (i) Eqs. (6) do not make a closed set and (ii) the parameters

*α*depend on

_{d}*t*.

At this point, we construct a simplified dynamical model in which the four unknown and time-dependent parameters *α _{d}* in Eqs. (6) are replaced by

*fixed*constants. In matrix notation,

where $p(t)=(p1(t),p2(t),\u2026,p9(t))\u2020$ is a column vector ($\u2020$ denotes transposition) and

is a fixed square matrix. Equation (7) fits the canonical description of Markov chains,^{52} where $W$ is the so-called transition matrix, and ${\alpha d}$ correspond to transition probabilities. In this way, we may forget about the meaning of ${pd(t)}$ as the first-digit distribution of the dataset ${rn(t)}$ and look at the numerals $1,2,\u2026,9$ as labels of nine distinct internal states of a certain physical system, which follow each other in the prescribed order sketched by Fig. 3.

Note that the matrix $W$ is singular, that is, not invertible. This implies the *irreversible* character of the transition ${pd(t)}\u2192{pd(t+1)}$. The stationary solution $p\u2217$ to Eq. (7) satisfies the condition $p\u2217=W\xb7p\u2217$. Such a stationary solution will be an *attractor* of our Markov process if $limt\u2192\u221ep(t)=p\u2217$ for *any initial condition* $p(0)$. This property, along with the exact solution of Eq. (7), is proved in Appendix B. If we choose for *α _{d}* the values given by Eqs. (5), the stationary solution coincides exactly with the NBL, as could be expected. This will be the choice made in the rest of this section.

To illustrate the irreversible evolution of $p(t)$ toward $p\u2217$, we are going to consider two different initial conditions. First, we start from a uniform distribution, that is, $pd(0)=19$. The result is shown in Fig. 8, where we see that the evolution is oscillatory (see Appendix B for an explanation) and the oscillations are rapidly damped to attain the stationary solution. As a second example, we take an NBL inverted initial distribution, that is, $pd(0)=p10\u2212d\u2217$, so that, initially, state 9 is the most probable and state 1 is the least probable. In this second example, as shown in Fig. 9, the initial oscillations are of greater amplitude but, as before, the stationary distribution is practically reached after a few iterations. Comparison between Figs. 7 and 8 shows that the main difference between our Markov model and the non-Markovian evolution of ${pd(t)}$ in a real dataset is that the oscillation amplitudes are attenuated in the model and not in the original framework.

It seems convenient to characterize the evolution of the set of probabilities ${pd(t)}$ obeying the Markov process [Eq. (7)] toward the attractor ${pd\u2217}$ by means of a single parameter that, in addition, evolves monotonically, thus representing the irreversibility of evolution. It is expected that these properties are verified by the Kullback–Leibler divergence,^{53} which in our case is defined as

This quantity represents the opposite of the Shannon entropy^{54} of ${pd(t)}$, except that it is measured with respect to the stationary distribution ${pd\u2217}$. In the context of our Markov-chain model, $DKL$ is related to information theory. On the other hand, the mathematical structure of $DKL$ can be extended to physical systems, thus providing a statistical-mechanical basis to the thermodynamic entropy,^{54,55} as exemplified below.

Figure 10 shows the evolution of $DKL(t)$ for the same initial conditions as in Figs. 8 and 9. Both cases confirm the desired monotonic evolution of $DKL(t)$. Also, the asymptotic decay $DKL(t)\u21920$ occurs essentially exponentially with a rate independent of the initial probability distribution. This is proved in Appendix C, as well as the monotonicity property,

with the equality not holding for two successive times unless $pd(t)=pd\u2217$, in which case $DKL=0$.

Thus, we can say that the NBL in our Markov model plays a role analogous to the equilibrium state in thermodynamics and statistical mechanics. In this analogy, the “entropy” of the out-of-equilibrium system would be (except for a constant) $S=\u2212DKL$, so that *S* increases irreversibly in the evolution toward equilibrium.

This analogy is put forward in Table II, where we compare a system described by the Markov chain [Eq. (7)] to a classical dilute gas as an example of a well-known physical system. In both cases, a statistical description is constructed by introducing the adequate probability distribution: the velocity distribution function (gas) and the probability of the internal state *d* (Markov chain); while $f(v\u2192,t)$ is continuous in both $v\u2192$ and *t*, $pd(t)$ is discrete in *d* and *t*. The evolution equation for the probability distribution function is the Boltzmann equation (gas, under the molecular chaos ansatz^{56}) and Eq. (7) (Markov chain). The equilibrium state is characterized by the Maxwell–Boltzmann distribution^{57} $fMB(v\u2192)$ (gas) and the NBL distribution $pd\u2217$ (Markov chain). In both classes of systems, the nonequilibrium entropy functional *S*(*t*) can be defined, within a constant, as the opposite of the Kullback–Leibler divergence^{53,58} of the equilibrium distribution from the time-dependent one. Boltzmann's celebrated *H*-theorem^{56,59} (gas) and the result presented in Eq. (10) (Markov chain) show that the entropy *S*(*t*) never decreases, irreversibly evolving toward its equilibrium value.

. | Dilute gas . | Markov chain . |
---|---|---|

Probability distribution | Velocity distribution function: $f(v\u2192,t)$ | Probability of the internal state d: $pd(t)$ |

Normalization | $\u222bd3v\u2192\u2009f(v\u2192,t)=1$ | $\u2211d=19pd(t)=1$ |

Evolution equation | Boltzmann equation: $\u2202f(v\u2192,t)/\u2202t=J[v\u2192|f(t),f(t)]$ | $p(t+1)=W\xb7p(t)$ |

Equilibrium state | Maxwell–Boltzmann: $fMB(v\u2192)=(m/2\pi kBT)3/2e\u2212mv2/2kBT$ | NBL: $pd\u2217=log10(1+d\u22121)$ |

Entropy functional | $S(t)=\u2212\u222bd3v\u2192\u2009f(v\u2192,t)\u2009ln\u2009f(v\u2192,t)/fMB(v\u2192)$ | $S(t)=\u2212\u2211d=19pd(t)\u2009ln\u2009pd(t)/pd\u2217$ |

Irreversibility equation | $dS(t)/dt\u22650$ | $S(t+1)\u2212S(t)\u22650$ |

. | Dilute gas . | Markov chain . |
---|---|---|

Probability distribution | Velocity distribution function: $f(v\u2192,t)$ | Probability of the internal state d: $pd(t)$ |

Normalization | $\u222bd3v\u2192\u2009f(v\u2192,t)=1$ | $\u2211d=19pd(t)=1$ |

Evolution equation | Boltzmann equation: $\u2202f(v\u2192,t)/\u2202t=J[v\u2192|f(t),f(t)]$ | $p(t+1)=W\xb7p(t)$ |

Equilibrium state | Maxwell–Boltzmann: $fMB(v\u2192)=(m/2\pi kBT)3/2e\u2212mv2/2kBT$ | NBL: $pd\u2217=log10(1+d\u22121)$ |

Entropy functional | $S(t)=\u2212\u222bd3v\u2192\u2009f(v\u2192,t)\u2009ln\u2009f(v\u2192,t)/fMB(v\u2192)$ | $S(t)=\u2212\u2211d=19pd(t)\u2009ln\u2009pd(t)/pd\u2217$ |

Irreversibility equation | $dS(t)/dt\u22650$ | $S(t+1)\u2212S(t)\u22650$ |

## V. CONCLUDING REMARKS

One of the main goals of this article was to show that, contrary to what might be initially thought, the first significant digit *d* of a dataset extracted from measurements or observations of the real world is not evenly distributed among the nine possible values, but typically the frequency is higher for *d* = 1 and decreases as *d* increases. The NBL, Eq. (1), gives a mathematical expression to this empirical fact, although it does not always need to be rigorously verified due to statistical fluctuations (as happens with populations in Fig. 4 and with distances in Fig. 5), limitations of the sample (as in the sunspot case in Fig. 5), or an artificial bias (as in the case of prices of articles in Fig. 6). It is to be expected that, except for unavoidable statistical fluctuations, the law is fulfilled in datasets in which quantities are measured in units, so that the distribution of the first digit is independent of the units chosen due to its invariance under a change of scale. More generally, the NBL is satisfied when the mantissa of the logarithms of the considered data is uniformly distributed. That makes lists not directly related to physical quantities, such as Fibonacci numbers or powers of 2, also satisfy the NBL.

Gaining inspiration from the scale invariance property of the NBL, we have constructed a Markov-chain model for a nine-state system that evolves in time according to the scheme depicted in Fig. 3. The initial-value model can be exactly solved, the solution showing an irreversible relaxation toward the NBL probability distribution. Moreover, we have proved that the associated (relative) entropy monotonically increases, in analogy with the second law of thermodynamics in physical systems.

Until the 1970s (which is when scientific pocket calculators began to be used), physicists used tables of logarithms (or their application in slide rules) for small everyday scientific calculations. Those calculations are nowadays performed on pocket calculators, cellular phones, or personal computers with a wide variety of existing mathematical programs. Since the data that are manipulated in physics are extracted from “real” situations, such as experiments, models, physical constants, …, we can conclude, as a tribute to Newcomb and Benford and their logarithmic tables, that keyboard button 1 will be the one that presents the greatest wear and tear, while that of 9 will be the least used.

## ACKNOWLEDGMENTS

A.S. acknowledges financial support from Grant No. FIS2016-76359-P/AEI/10.13039/501100011033 and the Junta de Extremadura (Spain) through Grant No. GR18079, both partially financed by Fondo Europeo de Desarrollo Regional funds.

### APPENDIX A: DERIVATION OF THE NBL AND SOME GENERALIZATIONS

Consider a long list of records ${rn}$ that, without loss of generality for the matter at hand, we will assume positive. Each record can be written in the form $rn=xn\xd710kn$, where *k _{n}* is an integer and $xn\u2208[1,10)$ is the

*significand*. Obviously, it is the distribution of the significand that is relevant for the NBL. The significand

*x*is directly related to the

_{n}*mantissa μ*of the decimal logarithm of

_{n}*r*, that is, $\u2009log10rn=kn+\mu n$, where $\mu n=log10xn\u2208[0,1)$.

_{n}Let $Px(x)dx$ be the probability that the significand lies between *x* and $x+dx$, so that the normalization condition is $\u222b110dx\u2009Px(x)=1$. The probability that the first significant digit of any record is *d* is then given by the integral,

More generally, if we consider an ordered string $(d1,d2,\u2026,dm)$ made up of the first *m* digits, where $d1\u2208{1,2,\u2026,9}$ and $di\u2208{0,1,2,\u2026,9}$ if $i\u22652$, it is obvious that the records whose *m* first digits match the string $(d1,d2,\u2026,dm)$ will be those whose significand *x* is greater than or equal to $d1+d2\xd710\u22121+\cdots +dm\xd710\u2212(m\u22121)$ and less than $d1+d2\xd710\u22121+\cdots +(dm+1)\xd710\u2212(m\u22121)$. Consequently,

If the distribution $Px(x)$ is actually invariant under a change of scale, that means that $Px(\lambda x)=f(\lambda )Px(x)$ with arbitrary *λ*. Taking into account the normalization condition in the form $\u222b\lambda 10\lambda d(\lambda x)\u2009Px(\lambda x)=1$, it follows that necessarily $f(\lambda )=\lambda \u22121$, that is, $Px(\lambda x)=\lambda \u22121Px(x)$. Differentiating both sides of the equation with respect to *λ* and then taking *λ* = 1, we easily obtain $xPx\u2032(x)=\u2212Px(x)$, which, according to Euler's theorem, implies that $Px(x)$ is a homogeneous function of degree −1, that is, $Px(x)\u221dx\u22121$. The constant of proportionality is obtained from the normalization condition, finally yielding

This is the *unique* distribution of significands that is invariant under a change of scale. From Eq. (A3), and applying Eqs. (A1) and (A2), it is straightforward to obtain NBL, Eq. (1), and its generalization, Eq. (2). As a consistency test of Eq. (2), it is easy to check that

It is interesting to note that the inverse law for the significand, Eq. (A3), implies a uniform law for the mantissa (and vice versa). Let $P\mu (\mu )d\mu $ be the probability that the mantissa lies between *μ* and $\mu +d\mu $. Since $P\mu (\mu )d\mu =Px(x)dx$ and $d\mu =(x\u22121/\u2009ln\u200910)dx$, Eq. (A3) gives us $P\mu (\mu )=1$. In Newcomb's words,^{1} “The law of probability of the occurrence of numbers is such that all mantissæ of their logarithms are equally probable.” An immediate consequence is that, if *μ* is a random variable uniformly distributed between 0 and 1, then the random variable $x=10\mu $ fulfills the NBL. This is in fact an easy way to generate a list of random records matching the NBL.

There are deterministic series that also satisfy the NBL. Suppose the series ${rn=a\alpha n+b\beta n,n=1,2,\u2026}$, where *a*, *b*, *α*, and *β* are real numbers with $a>0,\u2009\alpha >\beta \u22650$, and $\u2009log10\alpha =irrational$.^{12} In that case, $limn\u2192\u221e\u2009log10rn=n\u2009log10\alpha +log10a$ has a uniformly distributed mantissa, so ${rn}$ satisfies the NBL. That includes, for example, the series ${2n},\u2009{3n}$, and ${Fn}$, where $Fn=15[\phi n\u2212(\u2212\phi \u22121)n]$ are the Fibonacci numbers, $\phi \u226112(1+5)$ being the golden ratio. Similarly, the series ${n!}$ also verifies the law.^{12}

Another important property is that if a list ${rn}$ fulfills the NBL, so does the list ${rna}$, *a* being a real number. Indeed, if $\u2009log10rn=kn+\mu n$, the mantissa *μ _{n}* being uniformly distributed, then the mantissa of $\u2009log10rna=a(kn+\mu n)$ is also evenly distributed. This is directly related to the fact that the NBL is not only invariant under a change of scale but also under

*base change*,

^{11}as would be expected, given the artificial character of the decimal base. To see it, let us assume a base

*b*and build the list ${rna}$, with $a=log10b$, from a list ${rn}$ that fulfills the NBL. In that case, $rna=yn\xd7bkn$, where $yn=xna\u2208[1,b)$ is the significand of $rna$ in the base

*b*. The probability distribution $Py(y)$ is related to the distribution $Px(x)$ through the equation $Py(y)dy=Px(x)dx$, so that Eq. (A3) leads to

Therefore, NBL in an arbitrary base *b* takes the form,

### APPENDIX B: EXACT SOLUTION OF THE MARKOV-CHAIN MODEL

Note first that Eqs. (6) verify the normalization condition $\u2211d=19pd(t+1)=\u2211d=19pd(t)=1$. Therefore, only eight of the probabilities ${pd,d=1,2,\u2026,9}$ are linearly independent, so we can eliminate one of them. If we choose $p9=1\u2212\u2211d=18pd$, Eq. (6a) gives us $p1(t+1)=1\u2212p1(t)\u2212p2(t)\u2212p3(t)\u2212p4(t)$. Although it is not strictly necessary, it is mathematically convenient to split the column vector $p(t)$ into the subsets $pI(t)\u2261(p1(t),p2(t),p3(t),p4(t))\u2020$, $pII(t)\u2261(p5(t),p6(t),p7(t),p8(t))\u2020$, and $p9(t)$. As a consequence, the matrix equation (7) can be decomposed into

where $q=(1,0,0,0)\u2020$ and

In this way, one deals with two independent 4 × 4 matrices instead of the 9 × 9 transition matrix introduced in Eq. (8). Moreover, only the equation for the projected vector $pI$ in Eq. (B1) needs to be solved. Once the solution is obtained, the solution for the complementary projected vector $pII$ is straightforward.

By recursion, it is easy to check that the solution to the initial-value problem posed by Eq. (B1) is

*unique*stationary solution. From the normalization condition, one has $p9\u2217=\alpha 1\alpha 2(1\u2212\alpha 4)/(3+\alpha 1\alpha 2)$. Note that, as seen from Eqs. (B3), the initial values $pII(0)$ do not influence the evolution of either $pI(t)$ or $pII(t)$.

The stationary solution will be an *attractor* if $limt\u2192\u221epI(t)=pI\u2217$ and $limt\u2192\u221epII(t)=pII\u2217$ for any initial condition $pI(0)$. According to Eqs. (B3), this implies $limt\u2192\u221eAt=0$.

To check the above condition, let us obtain the four eigenvalues ${ai,i=0,1,2,3}$ of $A$. It is easy to see that the characteristic equation is $a(\alpha 1\alpha 2+a+a2+a3)=0$. Therefore, the eigenvalues are $a0=0$ and

Consequently

where

From Eqs. (B5), it can be verified that $|a1|<|a2,3|<1$ for $0<\alpha 1\alpha 2<1$, so that $limt\u2192\u221eait=0$ for *i* = 1, 2, 3. Therefore, $limt\u2192\u221eDt=0$ and hence $limt\u2192\u221eAt=0$. This proves the character of the stationary distribution $p\u2217$ as an attractor of the dynamics. Moreover, since both the real eigenvalue (*a*_{1}) and the real part of the complex eigenvalues ($a2,3$) are negative, the evolution of each $pd(t)$ to $pd\u2217$ is *oscillatory*, as can be observed in Figs. 8 and 9. Note that, in the analysis above, the eigenvalues 0 (double), $1\u2212\alpha 3$, and *α*_{4} of the matrix $B$ are not needed.

If we choose $\alpha d=12$, then Eqs. (B4) provide the stationary solution $p1\u2217=413\u22430.308,\u2009p2=p3=213\u22430.154,\u2009p4=p5=p6=p7=113\u22430.077,\u2009p8=p9=126\u22430.038$. These values are not too different from those of true NBL, as can be seen from Table I. On the other hand, the most natural choice is provided by Eqs. (5), in which case the stationary solution coincides exactly with the NBL.

### APPENDIX C: PROPERTIES OF THE KULLBACK–LEIBLER DIVERGENCE IN THE MARKOV MODEL

The Kullback–Leibler divergence is defined by Eq. (9). In order to analyze its asymptotic decay, let us consider times that are long enough so that the deviations $\delta pd(t)\u2261pd(t)\u2212pd\u2217$ can be considered small. In this regime, we can expand Eq. (9) in a power series and retain the dominant terms. The result is

On the other hand, for times long enough, $|a1|t\u226a|a2,3|t$ (note that $|a1|=0.4261$ and $|a2,3|=0.8692$), so that, according to Eqs. (B3), $\delta pd(t)\u223c|a2,3|t$. Thus,

This asymptotic behavior is represented in Fig. 10.

Evolution equations (6) and the stationarity condition $p\u2217=W\xb7p\u2217$ can be rewritten as

Therefore,

Given the stationary values ${pd\u2217,d=5,\u2026,9}$, the difference $\Delta DKL(t+1)$ is a function of the five probabilities ${pd(t),d=5,\u2026,9}$. To find the maximum value of $\Delta DKL(t+1)$, we take the derivative

The unique solution to the extremum conditions $\u2202\Delta DKL(t+1)/\u2202pd(t)=0$ is $pd(t)=\gamma pd\u2217$ ($d=5,\u2026,9$), where $0<\gamma <1/\u2211d=59pd\u2217$ is arbitrary. In such a case, $\Delta DKL(t+1)=0$. To see that this is actually a maximum value, suppose, for instance, that $pd(t)=0$ except if *d* = *d*_{0} (with $d0=5,\u2026,9$). In that case, it is easy to find $\Delta DKL(t+1)=pd0(t)\u2009ln\u2009(pd0\u2217/\u2211d=59pd\u2217)<0$. We then conclude that $\Delta DKL(t+1)\u22640$, i.e., we obtain Eq. (10), the equality holding only if $pd(t)=\gamma pd\u2217$ ($d=5,\u2026,9$). Note that, even though $\Delta DKL(t+1)=0$ if $pd(t)/pd\u2217=constant$ for $d=5,\u2026,9$, this proportionality property is broken down at *t* + 1 unless *γ* = 1. As a result, $\Delta DKL(t+2)<0$, even though $\Delta DKL(t+1)=0$, except in the stationary solution.