Skip to main content
Proceedings of the National Academy of Sciences of the United States of America logoLink to Proceedings of the National Academy of Sciences of the United States of America
. 2012 Nov 2;109(47):19145-19150. doi: 10.1073/pnas.1215998109

A zoo of computable binary normal sequences

Steve Pincus a,1, Burton H Singer b
PMCID: PMC3511067  PMID: 23125196

Abstract

Historically there has been a virtual absence of constructive methods to produce broad classes of “certifiably random” infinite sequences, despite considerable interest in this endeavor. Previously, we proved a theorem that yielded explicit algorithms to produce diverse sets of normal numbers, reasonable candidates for random sequences, given their limiting equidistribution of subblocks of all lengths. Herein, we develop this algorithmic approach much further, systematizing the normal number generation process in several ways. We construct delineated, distinct sets of normal numbers (classified by the extent to which initial segments deviate from maximal irregularity), with virtually any allowable specified rate of convergence to 0 of this deviation, encompassing arbitrarily fast and slow rates, and accommodating asymmetric behavior above or below a centered median. As a corollary, we provide an explicit construction of a normal number that satisfies the Law of the Iterated Logarithm. We also produce distinct families of “biased” normal numbers, with virtually any specified rate of convergence of the bias (to 0). This latter theory is in part motivated by the remarkable observation that the binary version of Champernowne’s number, which is also normal, is biased—any initial segment has more 1s than 0s. Finally, we construct an interesting normal sequence with arbitrarily fast convergence to equidistribution of singleton blocks, yet arbitrarily slow convergence of pairs, which has profound implications both for probability theory, and for metrics to evaluate the “near-randomness” of sequences.

Keywords: approximate entropy, maximally irregular, deficit from equidistribution


The need for broad collections of “truly random” infinite sequences and numbers arises in myriad contexts across mathematics, and the natural and social sciences. As discussed previously, although probability theory, algorithmic complexity, and cryptoanalysis have intuitive appeal as potential sources of such collections, there is no extant methodology to actually construct, designate, or display certifiably random individual sequences from these theories (1, 2). In contrast, in 1909 Borel formulated the concept of a normal number to a base b (3), for which all possible k-tuples (blocks) of consecutive digits from the set {0,1,2,…,b - 1} occur with limiting frequency 1/bk. This equidistribution characterization provides a verifiable specification for individual sequences, as described more than 60 years ago by Paul Erdos—“a normal number being one whose digits exhibit a complete randomness” (4). However, Borel’s theorem that such numbers form a set of Lebesgue measure 1 in the unit interval (i.e., almost all numbers are normal) (3) neither indicates, nor is naturally convertible to attendant algorithms for explicit constructions. Indeed, there are remarkably few sets of known explicitly computable normal numbers.

Probably best known among them is Champernowne’s number .1234567891011… (5), although an earlier example that seems to have been overlooked in much of the literature on normal numbers was put forth by Norbert Wiener in 1930 (ref. 6, pp. 201–203). Champernowne’s result was thematically generalized by Besicovitch (7), Copeland and Erdos (4) and Davenport and Erdos (8) to include, e.g., sequences of consecutive squares and primes such as 0.1491625… and 0.235711…. Subsequently, Stoneham (9) and Korobov (10) established normality for rapidly converging sums of reciprocals of powers of highly specified (e.g., ergodic prime) sequences; Bailey and Crandall (11) generalized this work, and also show normality for certain specially synchronized “perturbed” random number generators. These examples and the accompanying proofs, while interesting in their own right, reinforce the considerable difficulty involved in verifying that a particular number is normal, and thus underscore the need for broadly applicable methods to produce general classes of normal numbers.

Previously we specified constructive methods to produce large classes of certifiably binary normal numbers (1, 2), both by appropriate concatenations of finite maximally irregular sequences (Theorem Pr-2), and by an innocuous-looking yet essential perturbation strategy applied to established normal numbers (Theorem Pr-4). These emerged from consideration of C-random sequences, an equivalent characterization of normality based on a measure of sequential irregularity, approximate entropy (ApEn) (1). The purposes of this paper are twofold. First, we provide a much more systematic and extended development of this approach, which facilitates construction of normal numbers satisfying a diversity of distributional constraints. Second, we introduce two previously unexplored aspects of the behavior of normal sequences: (i) bias; and (ii) convergence rates of k-tuples to equidistribution for k≥2, which in particular accommodates (potentially dramatic) variation with k of these rates within the same normal number.

There frequently appears to be an implicit presumption that normality is an ultimate endpoint in the characterization of the randomness of infinite-sequence expansions of numbers (e.g., ref. 12). Yet we can probe more sharply than asymptotic equidistribution, or, following the phrasing of Erdos, “refine randomness.” In virtually any application, one utilizes the initial segment of a putatively random sequence. Thus we should want to assess the degree to which these initial segments are not maximally irregular [or satisfy other standard criteria for finite random sequences—e.g., those given by Knuth (13) or Golomb (14)]. As part of the development of ApEn, we also quantify the extent to which any sequence deviates from maximal irregularity, via a set of deficit (defm) functions. It is relatively straightforward to show that there exists no infinite sequence with the property that all finite initial segments are maximally irregular (Theorem 1, ref. 1), and accordingly, all defm functions have “nontrivial asymptotic dynamics” (i.e., are positive infinitely often). Previously, we demonstrated sharp distinctions among normal numbers on the basis of asymptotic rates of convergence of def0 to 0 (1, 2). In the present paper, we go much further—not only do we utilize def0 to classify and distinguish normal numbers, but we now effectively engineer normal numbers to virtually any allowable (def0) specification.

With this background at hand, below we provide four primary new results. As prologue, Theorem 1 establishes that the binary version of Champernowne’s number, rescaled to a sequence with values ± 1, has a “surprising” attribute—namely, partial sums of any initial segment are always positive. Thus we can regard this as a biased normal number. This recognition motivated further study of the identification of bias in normal numbers. In Theorem 2, we provide an algorithmic technique to produce normals with virtually any specified extent of bias, relative to the constraint of normality of the infinite sequence. In turn, Theorem 2 became an essential input for the more general, two-sided Theorem 3, which provides the algorithmic basis for construction of classes of (unbiased) normal numbers with virtually any allowable rate of convergence of def0 to 0, encompassing arbitrarily fast and conversely slow rates. Accordingly, Theorems 2 and 3 provide an extensive collection of delineated normal sequences. Lastly, we construct a normal number denoted Seq(0vs1), with sharp contrast between asymptotic characteristics of blocks of differing lengths, here between singletons and pairs. Subject to the constraint of normality, Seq(0vs1) has rapid convergence of the frequency of occurrence of 1-blocks to ½, yet slow convergence of the frequency of 2-blocks to ¼. This is the prototype for constructing normal numbers with rates of convergence of the frequency of k-tuples to equidistribution that vary substantially with k.

Herein, we provide the central ideas for construction of broad classes of normal numbers, and statements of our main new results, Theorems 1–3 and the construction of Seq(0vs1). Complete proofs are given in the SI Appendix. We distinguish between theorems that we previously proved and new results by denoting the former by Theorems Pr-1 through Pr-4, and new findings by Theorems 1–3. Throughout, we restrict attention to binary sequences of 0s and 1s.

Basic Ideas and Previous Results

Approximate Entropy (ApEn).

We recall several definitions and results from prior work (1, 2, 15). First, we quantify irregularity utilizing approximate entropy, ApEn (precise definition in SI Appendix). For a length N sequence of real numbers Inline graphic measures the logarithmic frequency with which blocks (subsequences of contiguous sequence points) of length m that are close together—i.e., within a tolerance range r—remain close together for blocks augmented by one position. Larger values of ApEn imply greater irregularity in Inline graphic, while smaller values correspond to more instances of recognizable patterns in the sequence.

In our binary setting, we set r < 1 as our measure of resolution, and observe that we monitor exact matches in blocks. With this restriction at hand we suppress the dependence of ApEn on r below. In this setting, an alternative formulation of ApEn (Theorem S1, SI Appendix) provides an appealing interpretation of ApEn as a difference between m-block and m + 1-block Shannon entropies, defined along single sequences. Specifically, for a sequence Inline graphic and a k-block {v1,v2,…,vk}∈{0,1}k, define Inline graphic in Inline graphic, with Inline graphic denoting the frequency of such occurrences. Let Inline graphic. Then we deduce that Inline graphic

A length N sequence Inline graphic is defined as {m,N}-irregular if it achieves the maximal ApEn(m,N) value among all sequences of length N; and is defined as N-irregular (N-random) if it is {m,N}-irregular for m = 0,1,2,…,mcrit(N), where we specify mcrit(N) = max(m∶2m < N) (2). This choice of mcrit(N) is consistent with the intuitive idea of finite random sequence, as shown previously (16):

Theorem Pr-1.

Let X(m) be as defined above. A sequence Inline graphic is N-random if and only if for 1 ≤ m ≤ mcrit(N) + 1, the expression Inline graphic is a minimum (among length N sequences).

Thus Theorem Pr-1 gives a useful equivalence of maximally irregular ApEn sequences and maximally equidistributed sequences, while grading the remaining sequences in terms of proximity to maximality.

Note that while the existence and identification of {m,N} random sequences is straightforward, it is not a priori apparent that maximally irregular (N-random) sequences exist for all lengths N, i.e., that sequences exist that satisfy maximality of ApEn values for all values of m ≤ mcrit(N) simultaneously. It has been known for many years that such maximal sequences exist for full cycle sequences of length N = 2L for any L (17, 18). Indeed, a subset of full-cycle (deBruijn) sequences can be generated by linear shift registers associated with primitive polynomials of degree k, which exists for all degrees k (17); an outstanding source for algorithms to construct full cycles is Fredricksen (18). However, the non–“power of 2” case had been an open question until recently, when both Carpi and DeLuca (19) and Spindler (20) proved the existence of maximally irregular sequences for all lengths N, by independent methods. Carpi and DeLuca do so via the study of uniform words (seen as equivalent to our definition of maximally irregular sequences), and moreover, show this existence over any finite length alphabet. Spindler proves the result for the binary case alone. Notably, both proofs lead to relatively efficient and fast algorithms for the production of maximal sequences. Furthermore, both proofs elucidate Theorem Pr-1. Specifically, given a maximally irregular sequence Inline graphic of any length N, for all 1 ≤ m ≤ mcrit(N) + 1, the numbers of occurrences of any two length m blocks in Inline graphic differ by at most 1, and thus approximate a frequency of 1/2m as closely as possible.

For infinite sequences Inline graphic, and Inline graphic, assuming this limit exists. Asymptotic ApEn(m) values converge to log 2 along maximally random binary sequences (1). This fact motivates the following formulation of an infinite “random sequence.”

Definition 1:

An infinite binary sequence Inline graphic is called computationally random, denoted as C-random, iff Inline graphic for all m≥0.

Importantly, observe that the normality of a binary number reduces to the condition that Inline graphic for all m≥0. Similarly, for an infinite sequence of binary random variables with probability p = 1/2 each of 0 and 1, joint independence as defined by probability theory implies C-randomness of realizations with probability 1. Thus both these fundamental notions are seen as limit statements, without rates of convergence, which we refine below.

Next, recall the technology to quantify proximity of a finite sequence to maximal irregularity.

Definition 2:

For a length N sequence Inline graphic, let Inline graphic.

For infinite sequences Inline graphic these deficit functions measure how close an initial segment Inline graphic of length N is to being {m,N}-irregular. Normality reduces to the condition that Inline graphic (1).

For a length N sequence Inline graphic, define Inline graphic by Inline graphic. This mapping of {0,1}N to {-1,1}N allows direct comparisons of our constructions to the almost sure (a.s.) laws of probability theory.

We previously defined excess functions for singleton blocks (1).

Definition 3:

For a length N sequence Inline graphic, define Inline graphic in Inline graphic in Inline graphic; Inline graphic in Inline graphic in Inline graphic; and Inline graphic.

Note that Inline graphic; Inline graphic; and Inline graphic, where Inline graphic.

Also, we observed (1) that for small values of def0,

graphic file with name pnas.1215998109eq127.jpg [1]

We illustrate several of the above definitions by representative calculations, applied to a Prefer-one deBruijn sequence (18) of length 64, left-shifted so that the 6-block of 1s leads. This sequence Inline graphic.

For the initial segment of length 24, Inline graphic; Inline graphic; Inline graphic. Accordingly, Inline graphic; Inline graphic; Inline graphic. Also, Inline graphic; Inline graphic; Inline graphic. For singletons, these calculations manifest many more 1s than 0s (17 vs. 7); the ApEn(1,24) and Inline graphic calculations calibrate a non-equidistribution of pairs, with 12 occurrences of {1,1}, 2 of {0,0}, 5 of {1,0}, and 4 of {0,1}. Furthermore, Inline graphic, and Inline graphic, with corresponding values Inline graphic, and Inline graphic; and Inline graphic and Inline graphic. Note that a comparison of Inline graphic and Inline graphic affirms Eq. 1. Also, observe that although at the cycle endpoint, there is maximal equidistribution (with Inline graphic, initial segments for N < 64 are typically nonmaximal, confirmed by the defn calculations above.

Further intuition about ApEn and defn can be obtained by reviewing binary sequences of lengths 5 and 6, a comparison of two binary sequences of length N = 20, and the first N digits in the binary and decimal expansions of e, π , √2 , and √3 (1, 16).

Lastly:

  1. For a sequence Inline graphic, Inline graphic, i.e., Inline graphic Inline graphic for each entry j;

  2. for a finite sequence Inline graphic, Inline graphic—i.e., the sequence of digits of Inline graphic written in reversed order;

  3. Inline graphic denotes the length of sequence Inline graphic;

  4. Inline graphic denotes the concatenation of sequences Inline graphic and Inline graphic.

Essential Previous Results.

The central result of our paper (2) was a theorem that provides explicit rules for concatenating maximally irregular sequences of nondecreasing length such that the limiting infinite sequences are normal numbers, indicated next. This also utilizes a wrap-around version of ApEn, denoted ApEnw, in which we consider sequences of length N in a cyclical arrangement, and (analogous to ApEn) we define N-wr-irregular sequences. One essential aspect of the proof was the demonstration that for any ε > 0 and positive integer k, there exists (explicitly calculated) Nk,ε such that for all N > Nk,ε, the N-irregular and N-wr-irregular sequences are all Besicovitch (k, ε)-normal (7).

Theorem Pr-2.

(ref. 2). Define the base-2 sequence Inline graphic, with Lt(vi) a nondecreasing integer-valued function of i. Let Inline graphic. If for all i, (i) vi is either a Lt(vi)-irregular or a Lt(vi)-wr-irregular sequence, (ii) lim i→∞Lt(vi) → ∞, and (iii) nLt(vn) = O(Ln), then Inline graphic is normal in base 2.

The length restrictions on concatenates imposed by Theorem Pr-2 allow for substantial variation in sequence structure, and accordingly, a means to produce large collections of normal numbers, since diverse classes of functions f(i)≔Lt(vi) satisfy the conditions of the theorem, including both polynomial and slowly varying functions.

Below we require a collection of highly irregular normal numbers. We produce a family of such numbers by controlling the length function in the concatenations of finite maximally irregular sequences to be the nearest even integer at or below the n-fold iterate of log(i) for large i, a very slowly growing mapping.

Definition 4:

Fix n. Define Inline graphic Define Inline graphic for N≥ExpIter-n(1); fn(N)≔0 otherwise. Then define gn(N) as the greatest even integer ≤ fn(N), and FIterLog-n(N)≔ max (6, gn(N)).

Now for all i, select a maximally irregular sequence vi of length FIterLog-n(i). Let Inline graphic, where wm = v1v2 ∨ …vm. By Theorem Pr-2, Seq(FIterLog-n) is normal in base 2 (2). Furthermore:

Theorem Pr-3.

(ref. 2). Define Inline graphic. Then for Inline graphic, for all sufficiently large N, Inline graphic.

Remark 1:

The Seq(FIterLog-n) provide a nearly “best possible” class of normal numbers, in terms of rapidity of convergence of lim sup N→∞def0 to 0. It is easy to show that for any normal Inline graphic, Inline graphic must infinitely often be at least as large as the order of 1/N2 (ref. 2, p. 10372). By comparison, Inline graphic for Seq(FIterLog-n) is bounded above by 1/N2 times a function that can be chosen to increase arbitrarily slowly (2).

We also produce large classes of normal numbers via a perturbation strategy:

Theorem Pr-4.

(ref. 1). Assume we are given a binary normal number Inline graphic, a binary sequence Inline graphic, and fZ+ → R+ such that f(N)/N → 0 as N → ∞. If {the number of i ≤ N such that u(i) ≠ v(i)} ≤ f(N) for all N, then Inline graphic is a binary normal number.

Fig. 1 of ref. 2 illustrates highly pronounced differences among several normal numbers in the asymptotic rates of convergence for Inline graphic, based on constructions derived from Theorems Pr-2–Pr-4.

The Peculiarity of BinChamp

Denote the binary analogue of Champernowne’s number as BinChamp≔.11011100101… . This sequence of binary digits written in ascending order is known to be a binary normal number, by virtually the same proof as Champernowne produced to show normality for the base-10 sequence (5). Indeed, it is generally viewed as the canonical constructive example of such a number. Yet, as noted previously (2), there is a pronounced local bias of excess 1s in BinChamp; e.g., Inline graphic. We now report the following curious feature:

Theorem 1.

There are always more 1s than 0s in any initial segment of BinChamp—i.e., in the first N digits for any N.

Proof Sketch.

It is straightforward to establish a local excess of 1s at natural breakpoints, by observing that the subsequence comprising {2i,2i + 1,…,2i+1 - 1}base2 is composed of the concatenation of the 2i blocks of all possible i-tuples of 1s and 0s, each headed by 1, thus contributing a local excess of 2i. We then apply a relatively straightforward induction argument to bound local intermediate fluctuations, showing that any counterdirectional fluctuations vary more slowly.

If we map u≔BinChamp to a sequence of 1s and -1s via Inline graphic, and consider the partial sums Inline graphic, the above theorem tells us that SN is positive for all N. This implies that BinChamp, despite being a normal number (with asymptotic frequency for both 1s and 0s of ½), should not be used as a model for a realization of fair (“random”) coin tossing. Symmetric binary one-dimensional random walks are recurrent (21), with the normative properties of an infinite number of sign changes (zero crossings) and returns to {0} for SN, while SN specified from BinChamp lacks these attributes. This peculiarity of BinChamp is vividly illustrated in Fig. 1, in which BinChamp is contrasted with output (“RNG”) derived from Knuth’s (updated) recommended portable random-number generator (13). This latter algorithm, based on lagged Fibonacci sequences with subtraction, produces “random” integers between 0 and 230, from which we define a binary projection by Wi = 1 if Xi/230 > 1/2, Wi = 0 otherwise.*

In Fig. 1, two differences between BinChamp and RNG are glaringly apparent. First, in Fig. 1A we see that the deviation of BinChamp from 0 is orders of magnitude larger than that for RNG. We can quantify this—in ref. 2, p. 10371, we showed that for Inline graphic, Inline graphic. This convergence rate for def0(N) thus measures the very slow rate at which the bias of excess 1s in BinChamp decreases towards asymptotic equidistribution. In contrast, RNG appears to be a “typical” random sequence that, to first order, satisfies the Law of the Iterated Logarithm (LIL). For sequences that satisfy the LIL, we showed (2) that Inline graphic, which converges to 0 orders of magnitude more quickly than does the BinChamp rate, consistent with Fig. 1A. Second, we note the stark contrast between the absence of zero crossings for BinChamp and the recurrent nature of RNG, manifested here in 601 zero crossings of RNG for N ≤ 400,000 (most apparent in Fig. 1B and in a close-up view in SI Appendix, Fig. S1).

Furthermore, the theory of symmetric random walk not only establishes an infinite number of zero crossings (for SN), but actually provides an explicit normal approximation for the distribution of the number of such zero crossings prior to N (which qualitatively agrees with our count for the RNG for N ≤ 400,000). More generally, the theory produces an important distributional requirement, an explicit arc sine law for sojourn times and zero crossings.

Fig. 1.

Fig. 1.

Number of 1s − number of 0s in first N digits of (i) BinChamp, .11011100101… (binary numbers written in ascending order) and (ii) a “typical” binary pseudorandom sequence denoted RNG (see text for specification): (A) full range; (B) y-axis absolute values ≤ 750. Note that this difference is > 0 for all N for BinChamp (proved in the text), in contrast to the large number of zero crossings for RNG. Also observe the magnitude difference in variation from 0 between these two series. Both the absence of sign changes and the relatively huge deviations from centrality vividly illustrate the atypicality of BinChamp, the canonical constructive example of a binary normal number, yet also highlight the need for quantitative technology to delineate normal numbers into subclasses of different types.

Biased Normal Numbers

We next construct biased (more colloquially, ‘tilted’) binary normal numbers, and then partition them into a continuum of distinct subclasses by the rate of convergence of lim Inline graphic to 0.

Theorem 2.

Pick any function gR+ → R+ such that (i) lim x→∞g(x) = 0; (ii) Inline graphic is nondecreasing, and diverges to ∞ as x → ∞; and (iii) there exists n such that for Inline graphic, when g is restricted to Z+, Inline graphic. Then

(A) we can construct a binary normal sequence Inline graphic such that Inline graphic.

Moreover, if g is a regularly varying function, then

(B) we can construct a binary normal sequence Inline graphic such that Inline graphic, i.e., Inline graphic

and (C), we can do (B) such that Inline graphic is ultimately biased, i.e., there exists some Nmax so that for all N > Nmax, Inline graphic.

Corollary 2.1.

Assuming the conditions in Theorem 2, if g is regularly varying, we can construct a biased binary normal sequence Inline graphic (i.e., with Inline graphic for all N) such that Inline graphic.

Proof:

In the construction above, upon initial specification of Inline graphic, replace all 1s with 0s for all N ≤ Nmax. This change to a finite initial segment neither affects the normality nor the asymptotic convergence rates of Inline graphic.

Thus we can construct a vast range of distinct classes of biased normal numbers, delineated by the rate of convergence of def0 to 0, for which any initial segment always has more 0s than 1s (or conversely, more 1s than 0s). Observe that all functions in the parametrized families gβ(x) = x and hβ(x) = (log x), for 0 < β < 2, are regularly varying and satisfy conditions (i) through (iii) in Theorem 2. Thus we can produce biased normals with arbitrarily fast (possible) convergence rates (Remark 1), and conversely, arbitrarily slow rates, by respectively selecting β for gβ(x) to be as close to 2, or to 0, as required.

Two-Sided Rates of Convergence

Theorem 2 implies that we can construct collections of sequences with a range of rates of convergence of def0 to 0. However, the sequences satisfying Theorem 2 are all biased. We wish to construct more symmetric normal sequences that asymptotically behave like specified functions both above and below the centered midline, which we do next. Although in the context of the general theory the defn functions are most natural in quantifying the difference from maximal irregularity, for the next theorem we distinguish between above and below the midline, and accordingly, cast this theorem in an EXC0,1 formulation, which provides the requisite detail.

Theorem 3.

Let Ψ be the set of all regularly varying functions kR+ → R+ such that (i) lim N→∞k(N)/N → 0; (ii) k(N) is nondecreasing, and lim N→∞k(N) → ∞; and (iii) there exists some n such that lim N→∞k(N)/FIterLog-n(N) → ∞. Let functions g, h be members of Ψ. Then we can construct a binary normal sequence Inline graphic such that

Theorem 3.

Proof Sketch.

We apply a “zig-zag” procedure, in which we alternate locally positively and negatively biased excursions of exponentially increasing lengths, with the local unidirectional excursions specified by Theorem 2 to achieve the stated convergence rates, and with intermediate recentering to 0 (via negation, in reversed order) to facilitate estimates.

One subset of C-random sequences merits particular mention. The LIL, an a.s. property of sums of independent, identically distributed (i.i.d.) random variables, is a cornerstone of modern probability theory. It refines both the Strong Law of Large Numbers (SLLN) and the Central Limit Theorem (CLT), providing a sharp (normalizing) factor for maximal and minimal values of partial sums. The LIL, interpreted for individual sequences Inline graphic on {0,1}, is equivalent to Inline graphic which identifies a narrowly specified subclass among all normal numbers.

Define Inline graphic, and observe that lil(x) is a member of Ψ defined in the statement of Theorem 3. Then we deduce

Corollary 3.1.

Let g(x) = h(x) = lil(x). Then any sequence constructed according to the procedure specified in Theorem 3 is a normal number that satisfies the LIL.

Hence we now have algorithmically constructed examples of normal numbers that satisfy the LIL. Of note, we are unaware of the existence of any explicitly constructed normal numbers that were previously proved to satisfy this law. Conversely, by applying Theorem 3 to any functions g(N) or h(N) that are not asymptotic to lil(N), we can produce many distinct families of normal numbers that do not satisfy the LIL.

Finally, note that Theorems 2 and 3 are remarkably general. First, assuming regularly varying functions, Theorem 2 actually yields convergence, i.e., a lim (not only a lim sup) result. Also, when the conditions of the theorems are viewed in the language of EXC, as in Theorem 3, they are seen to be very modest–(normative) regular variation, k(N) monotonically divergent to infinity at rate o(N), plus a technical condition (iii) that is almost always satisfied. Indeed, given regular variation and conditions (i) and (ii), condition (iii) is violated only by relatively pathologic counterexamples (SI Appendix).

A Normal Number with Contrasting Convergence Rates for Singletons and Pairs

Our delineation of normal numbers above focuses on the def0 rate, which already provides a considerable means to stratify normal numbers. We next present a normal sequence denoted by Seq(0vs1) that, subject to the constraint of normality, has arbitrarily fast convergence to equidistribution of singletons (given by def0). Yet Seq(0vs1) also has arbitrarily slow convergence of pairs (given by def1), manifesting regularities in pairs, in particular systematic bias against (1,1). Recast, the distribution of singletons in initial segments of Seq(0vs1) will hover extremely closely to ½ 1s and ½ 0s, yet pairs {0,0}, {0,1}, {1,0}, and {1,1} will be much less equidistributed than that for a typical binary infinite sequence.

There are two keys to this construction. First, we concatenate maximally irregular sequences of very slowly increasing lengths to ensure that single digit distributions hew closely to maximal equidistribution. The second, decisive theme is an intermediate negation step that prohibits occurrences of {1,1} and {0,0} at liaison (interface) blocks.

I. Specification. Recalling Definition 4, define GIterLog-n(N)≔greatest power of 2 ≤ FIterLog-n(N). For each i, define vi as a periodic portion of a full-cycle deBruijn sequence of length GIterlog-n(i) such that vi starts and ends with 1. Then let Seq(GIterlog-n)≔ lim m→∞wm, where wm = v1v1-negv2v2-neg… ∨ vmvm-neg. This is our “interesting” sequence, also denoted by Seq(0vs1).

Note that Seq(0vs1) commences as 1001011010010110…; typical 8-block concatenation regions are 11000101001110101100010100111010… Observe a relative shortage of {1,1} and {0,0} blocks. For the first 16 terms, there are 8 1s and 8 0s (Seq(0vs1) is perfectly equidistributed in singletons), yet 2 occurrences each of {1,1} and {0,0}, with 6 occurrences of {1,0} and 5 of {0,1}.

II. Normality. Since deBruijn sequences are maximally irregular, negations of maximally irregular sequences are also maximal, and the lengths of successive terms are nondecreasing, it follows from Theorem Pr-2 that Seq(GIterlog-n) is normal in base 2.

III. def0 estimate. Define Inline graphic. Then for Inline graphic, for all sufficiently large N, Inline graphic. Thus these Seq(GIterlog-n) [like their Seq(FIterlog-n) counterparts) provide a nearly best possible class of normal numbers, insofar as rapidity of convergence of lim sup N→∞def0 to 0.

IV. def1 estimate. We observe a wild contrast between singleton and pairwise dynamics, relative to the normality constraint.

A. Bias. Choose any m, with Lt(vm) = 2k. Then

graphic file with name pnas.1215998109eq129.jpg [2]

Thus if k = 2, the fraction of occurrences is ≤ 1/8; if k = 3, the fraction is ≤ 3/16.

The essential observations are that for all i ≤ m, (i) vivi-neg has (Lt(vi)/4) - 1 occurrences of {1,1} strictly within vi, and Lt(vi)/4 occurrences of {1,1} strictly within vi-neg; and (ii) crucially, there is never a liaison {1,1} from the last digit of vi to the first digit of vi-neg (this is always {1,0}), nor from the last digit of vi-neg to the first digit of vi+1 (this is always {0,1}). Observation (i) follows from the property that the deBruijn sequence vi has Lt(vi)/4 occurrences of {1,1}, when viewed in a cyclical setting, but “loses” one (the wrap-around) occurrence in a direct count, since each vi starts and ends with 1. Observation (ii) follows from the fact that all vis start and end with 1, and all vi-negs start and end with 0.

It then follows readily from Eq. 2 that the frequency

graphic file with name pnas.1215998109eq130.jpg [3]

Therefore the bias against {1,1} converges to 0 extraordinarily slowly as a function of m, namely, O(1/ log(log(… log(m)))).

B. We then apply a frequency-based equivalent formulation of ApEn (Theorem S1) to Eq. 3 to produce the following upper bound: For all m suitably large, Inline graphic, which in turn readily allows us to deduce that Inline graphic for all large N, at concatenate endpoints along {wm}.

Finally, by the specification of FIterLog-n(N) as approximately Inline graphic, we can select “n” in IterLog-n so that def1(Seq(0vs1)(N)) can be made to converge to 0 arbitrarily slowly.

Thus we have shown that there can be remarkable contrast between asymptotic characteristics of blocks of differing lengths for normal numbers. Moreover, we have produced another example of a biased normal number, here in pairwise blocks.

Additionally, note that we critically require the intermediate negations to achieve the desired contrast. If we study v1v2v3 … with the vi’s defined as in this construction, the limit is normal, with both def0 and def1 converging extremely rapidly to 0.

Perspectives

1. Inline graphicOur primary objective was to produce constructive methods to generate diverse sets of normal numbers. Of course, many of these sequences are very predictable, reinforcing that (approximate) equidistribution, irregularity, and normality are orthogonal concepts to algorithmic complexity.

The pronounced differences among normal numbers reinforce the perspective that grouping all normal numbers into a single asymptotically equidistributed category is often inadequately nonspecific. In particular, this highlights a critical limitation of classical probability theory—each of the normal numbers constructed above would be candidate members of a single “RANDOM SEQUENCE” category. However, rates of convergence (to equidistribution) of the defn functions, or the presence and extent of a bias are now seen as well-defined characteristics of a specified sequence. This is especially important in virtually any application, in which we typically utilize the initial segment of a putatively random sequence, and thus should want to assess the degree to which these segments are not maximally irregular.

A further, yet arbitrary, question concerns the choice of constraints beyond normality that one might impose to designate a sequence as “random.” For pseudorandom finite sequences, there are usually a relatively short list of standard properties, e.g., (i) well-distribution relative to arithmetic progressions and (ii) small multiple correlations—see Golomb (14) and Knuth (13) for detailed discussions. However, for infinite sequences, normality implies that most if not all of these properties are satisfied, including (i) and (ii) (22). For infinite sequences, beyond normality, researchers often mandate that “random” sequences satisfy the a.s. laws of probability theory, in particular the LIL. Such mandates, however, lead to conundrums; we now see that sequences satisfying the LIL are less asymptotically equidistributed than a continuum of explicitly constructed normal numbers. Additionally, distributional requirements including, e.g., the arc sine law for sojourn times for classical random walks noted above have not, to our knowledge, been tendered as a necessary attribute for “randomness,” and such would likely further constrain sets of candidate sequences as, for example, in a Kollektiv in the sense of von Mises (23).

Nonetheless, probability and statistical theory retain vast utility, but now properly viewed as a tool to discern distributional characteristics of generic ensemble populations, as opposed to specific attributes of individual sequences, and critically, with the aforementioned caveats on the term generic.

2. Inline graphicIn ref. 1, we define the deficit from maximal equidistribution Inline graphic as the maximum of the Inline graphic functions for m ≤ mcrit(N). Thematically similar is the normality measure of pseudorandomness Inline graphic for finite sequences (22), in which a maximum is further taken along all initial subsegments of Inline graphic. In either case, a highly irregular or pseudorandom sequence is one in which the maximum is small. However, as illustrated in the juxtaposition of def0 and def1 for Seq(0vs1), we now see that by considering each block length (defn) distinctly, rather than aggregating them into a single composite measure, we provide a more complete understanding of asymptotic sequence variation. To reinforce this point, for Seq(0vs1), on finite initial segments, both De and Inline graphic would in effect monitor and identify the lack of pairwise equidistribution, with the nearly perfect equidistribution of singletons “under the radar” or unquantified.

Furthermore, note that the verification of many classical limit theorems in probability theory, including the SLLN, CLT, and LIL, reduces to evaluation of the distributional characteristics of normalized summands SN (of the first N sequence elements). In particular (since partial summands SN are directly and easily related to def0 via Definition 3 and Eq. 1), this can be recast in terms of single-digit variation from centrality. Thus these limit theorems have essentially nothing to say about higher-order block dynamics, i.e., defn for n≥1.

These points highlight the considerable utility that the collection of higher-order defn functions can provide. More broadly, we anticipate that the study of distributional characteristics of blocks of length > 1 by defn for n≥1 will result in new findings in numerous contexts.

Finally, these considerations raise serious questions about exactly what is (or should be) meant by a normal number-based model of fair coin tossing as realizations of i.i.d. binary random variables. Higher-order “atypical” block dependencies or biases among normal numbers can emerge, even if classical 1-block distributions are nicely behaved. We will probe this much further in a forthcoming paper.

3. Inline graphic Historically, there has been a significant dichotomy between finite and infinite length approaches to the development of highly irregular or nearly equidistributed sequences. Finite-sequence developments have centered on the study of linear congruential random-number generators (13), and also on linear shift registers, with primitive (irreducible) polynomials and k-ergodic primes essential objects of interest, as are algorithms to produce full cycles (deBruijn sequences) of length 2n. More recently, long, highly irregular sequences have been demonstrated from constructions based on the Liouville function and the Legendre symbol (22), and by Alon et al. (24), via the concatenation of multiple copies of specified realizations of primitive polynomials over a finite field. However, these methods have not been directly extendable to an infinite sequence setting. In contrast, infinite length constructions towards producing normal numbers have focused on theorems that either assure Besicovitch (k, ε)—normality for almost all concatenates, for any k and ε, or carefully estimate and control exponential sums as indicated above.

A central perspective above is that we provide a natural liaison between finite- and infinite-sequence construction and evaluation, both via Theorem Pr-2 (construction), and via ApEn definitions in both settings (evaluation), the infinite case being a limit of the finite one. This link allows us to view the finite-sequence results in a larger framework, and also enhances the utility of identifying efficient algorithms for (nearly) maximally irregular finite sequences.

Finally, one can extend Theorem Pr-2 to variants in which we relax the maximality of irregularity condition to a near-maximality of irregularity of concatenates, so long as the proximity to maximal ApEn varies suitably with concatenate length. These allow for broader collections and numbers of the concatenates (some of which may be considerably easier to produce than true maximal elements), leading to further classes of normal numbers.

Supplementary Material

Supporting Information

Footnotes

The authors declare no conflict of interest.

This article contains supporting information online at www.pnas.org/lookup/suppl/doi:10.1073/pnas.1215998109/-/DCSupplemental.

*Knuth’s algorithm was applied with recommended choices of long lag = 100, short lag = 37, and seed = 310952. The study of RNGs remains an actively evolving area, including, e.g., 64-bit Xorshift methods for suitable processors. For the present purpose, the stated choice should be fine; indeed, Knuth notes that it passes Marsaglia’s “Die Hard” battery of tests for randomness.

References

  • 1.Pincus S, Singer BH. Randomness and degrees of irregularity. Proc Natl Acad Sci USA. 1996;93:2083–2088. doi: 10.1073/pnas.93.5.2083. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Pincus S, Singer BH. A recipe for randomness. Proc Natl Acad Sci USA. 1998;95:10367–10372. doi: 10.1073/pnas.95.18.10367. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Borel E. Les probabilités dénombrables et leurs applications arithmétiques. Rend Circ Mat Palermo. 1909;27:247–271. [Google Scholar]
  • 4.Copeland AH, Erdos P. Note on normal numbers. Bull Amer Math Soc. 1946;52:857–860. [Google Scholar]
  • 5.Champernowne DG. The construction of decimals normal in the scale of ten. J London Math Soc. 1933;8:254–260. [Google Scholar]
  • 6.Wiener N. Generalized harmonic analysis. Acta Math. 1930;55:117–258. [Google Scholar]
  • 7.Besicovitch AS. The asymptotic distribution of the numerals in the decimal representation of the squares of the natural numbers. Math Z. 1934;39:146–156. [Google Scholar]
  • 8.Davenport H, Erdos P. Note on normal decimals. Canad J Math. 1952;4:58–63. [Google Scholar]
  • 9.Stoneham RG. On absolute (j, ε)-normality in the rational fractions with applications to normal numbers. Acta Arith. 1973;22:277–286. [Google Scholar]
  • 10.Korobov N. Continued fractions of certain normal numbers. Math Zametki. 1990;47:28–33. [Google Scholar]
  • 11.Bailey DH, Crandall RE. Random generators and normal numbers. Exp Math. 2002;11:527–546. [Google Scholar]
  • 12.Weiss B. Single Orbit Dynamics. Providence, RI: Am Math Soc; 2000. [Google Scholar]
  • 13.Knuth DE. Seminumerical Algorithms: The Art of Computer Programming. 3rd ed. Vol 2. Reading, MA: Addison-Wesley; 1997. pp. 1–193. [Google Scholar]
  • 14.Golomb SW, Gong G. Signal Design for Good Correlation for Wireless Communication, Cryptography, and Radar. Cambridge, UK: Cambridge Univ Press; 2005. [Google Scholar]
  • 15.Pincus SM. Approximate entropy as a measure of system complexity. Proc Natl Acad Sci USA. 1991;88:2297–2301. doi: 10.1073/pnas.88.6.2297. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Pincus S, Kalman RE. Not all (possibly) “random” sequences are created equal. Proc Natl Acad Sci USA. 1997;94:3513–3518. doi: 10.1073/pnas.94.8.3513. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Peterson W, Weldon E. Error-Correcting Codes. 2nd ed. Cambridge, MA: MIT Press; 1972. [Google Scholar]
  • 18.Fredricksen H. A survey of full length nonlinear shift register cycle algorithms. SIAM Rev. 1982;24:195–221. [Google Scholar]
  • 19.Carpi A, de Luca A. Uniform words. Adv Appl Math. 2004;32:485–522. [Google Scholar]
  • 20.Spindler M. Swiss Federal Institute of Technology; 2000. On concepts of randomness in finite sequences. Ph.D. thesis, Diss. ETH No. 13470. [Google Scholar]
  • 21.Feller W. An Introduction to Probability Theory and its Applications. 3rd ed. Vol 1. New York: Wiley; 1968. pp. 67–97. [Google Scholar]
  • 22.Mauduit C. Finite and infinite pseudorandom binary words. Theoret Comput Sci. 2002;273:249–261. [Google Scholar]
  • 23.Von Mises R. Probability, Statistics, and Truth. 2nd ed. New York: Macmillan; 1957. [Google Scholar]
  • 24.Alon N, Kohayakawa Y, Mauduit C, Moreira CG, Rodl V. Measures of pseudorandomness for finite sequences: Minimal values. Combin Probab Comput. 2006;15:1–29. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supporting Information

Articles from Proceedings of the National Academy of Sciences of the United States of America are provided here courtesy of National Academy of Sciences

RESOURCES