3.5 WHAT IS A RANDOM SEQUENCE? 161 Definition R3. A [0 . . 1) sequence is said to be “random” if each of its infinite subsequences is ∞ -distributed. Once again, however, the definition turns out to be too strict; any equidistributed sequence ⟨ U n ⟩ has a monotonic subsequence with U s 0 < U s 1 < U s 2 < · · · The secret is to restrict the subsequences so that they could be defined by a person who does not look at U n before deciding whether or not it is to be in the subsequence. The following definition now suggests itself: Definition R4. A [0 . . 1) sequence ⟨ U n ⟩ is said to be “random” if, for every effective algorithm that specifies an infinite sequence of distinct nonnegative integers s n for n ≥ 0 , the subsequence U s 0 , U s 1 , U s 2 , . . . corresponding to this algorithm is ∞ -distributed. The algorithms referred to in Definition R4 are effective procedures that compute s n , given n (See the discussion in Section 1.1.) Thus, for example, the sequence ⟨ π n mod 1 ⟩ will not satisfy R4, since it is either not equidistributed or there is an effective algorithm that determines an infinite subsequence s n with ( π s 0 mod 1) < ( π s 1 mod 1) < ( π s 2 mod 1) < · · · Similarly, no explicitly defined sequence can satisfy Definition R4 ; this is appropriate, if we agree that no explicitly defined sequence can really be random. The explicit-looking sequence ⟨ θ n mod 1 ⟩ actually does, however, satisfy Definition R4, for almost all real numbers θ > 1; this is no contradiction, since almost all θ are uncom- putable by algorithms. J. F. Koksma proved that ⟨ θ s n mod 1 ⟩ is 1-distributed for almost all θ > 1, if ⟨ s n ⟩ is any sequence of distinct positive integers [ Com- positio Math. 2 (1935), 250–258]; H. Niederreiter and R. F. Tichy strengthened Koksma’s theorem, replacing “1-distributed” by “ ∞ -distributed” [ Mathematika 32 (1985), 26–32]. Only countably many sequences ⟨ s n ⟩ are effectively definable, so ⟨ θ n mod 1 ⟩ almost always satisfies R4. Definition R4 is much stronger than Definition R1; but it is still reasonable to claim that Definition R4 is too weak. For example, let ⟨ U n ⟩ be a truly random sequence, and define the subsequence ⟨ U s n ⟩ by the following rules: s 0 = 0; and if n > 0, s n is the smallest integer ≥ n for which U s n − 1 , U s n − 2 , . . . , U s n − n are all less than 1 2 . Thus we are considering the subsequence of values following the first consecutive run of n values less than 1 2 . Suppose that “ U n < 1 2 ” corresponds to the value “heads” in the flipping of a coin. Gamblers tend to feel that a long run of “heads” makes the opposite condition, “tails,” more probable, assuming that a true coin is being used; and the subsequence ⟨ U s n ⟩ just defined corresponds to a gambling system for a man who places his n th bet on the coin toss following the first run of n consecutive “heads.” The gambler may think that Pr( U s n ≥ 1 2 ) is more than 1 2 , but of course in a truly random sequence ⟨ U s n ⟩ will be completely random. No gambling system will ever be able to beat the odds! Definition R4 says nothing about subsequences formed according to such a gambling system, so apparently we need something more. Let us define a “subsequence rule” R as an infinite sequence of functions ⟨ f n ( x 1 , . . . , x n ) ⟩ where, for n ≥ 0, f n is a function of n variables, and the 162 RANDOM NUMBERS 3.5 value of f n ( x 1 , . . . , x n ) is either 0 or 1. Here x 1 , . . . , x n are elements of some set S (Thus, in particular, f 0 is a constant function, either 0 or 1.) A sub- sequence rule R defines a subsequence of any infinite sequence ⟨ X n ⟩ of elements of S as follows: The n th term X n is in the subsequence ⟨ X n ⟩R if and only if f n ( X 0 , X 1 , . . . , X n − 1 ) = 1 Note that the subsequence ⟨ X n ⟩R thus defined is not necessarily infinite, and it may in fact contain no elements at all. For example, the gambler’s subsequence just described corresponds to the following subsequence rule: “ f 0 = 1; and for n > 0, f n ( x 1 , . . . , x n ) = 1 if and only if there is some k in the range 0 < k ≤ n such that the k consecutive parameters x m , x m − 1 , . . . , x m − k +1 are all < 1 2 when m = n but not when k ≤ m < n .” A subsequence rule R is said to be computable if there is an effective algorithm that determines the value of f n ( x 1 , . . . , x n ), when n and x 1 , . . . , x n are given as input. We had better restrict ourselves to computable subsequence rules when trying to define randomness, lest we obtain an overly restrictive definition like R3 above. But effective algorithms cannot deal nicely with arbitrary real numbers as inputs; for example, if a real number x is specified by an infinite radix-10 expansion, there is no algorithm to determine if x is < 1 3 or not, since all digits of the number 0 333 . . . have to be examined. Therefore computable subsequence rules do not apply to all [0 . . 1) sequences, and it is convenient to base our next definition on b -ary sequences. Definition R5. A b -ary sequence is said to be “random” if every infinite sub- sequence defined by a computable subsequence rule is 1 -distributed. A [0 . . 1) sequence ⟨ U n ⟩ is said to be “random” if the b -ary sequence ⟨⌊ bU n ⌋⟩ is “random” for all integers b ≥ 2 Note that Definition R5 says only “1-distributed,” not “ ∞ -distributed.” It is interesting to verify that this may be done without loss of generality. For we may define an obviously computable subsequence rule R ( a 1 . . . a k ) as follows, given any b -ary number a 1 . . . a k : Let f n ( x 1 , . . . , x n ) = 1 if and only if n ≥ k − 1 and x n − k +1 = a 1 , . . . , x n − 1 = a k − 1 , x n = a k Now if ⟨ X n ⟩ is a k -distributed b -ary sequence, this rule R ( a 1 . . . a k ) — which selects the subsequence consisting of those terms just following an occurrence of a 1 . . . a k — defines an infinite sub- sequence; and if this subsequence is 1-distributed, each of the ( k + 1)-tuples a 1 . . . a k a k +1 for 0 ≤ a k +1 < b occurs with probability 1 /b k +1 in ⟨ X n ⟩ Thus we can prove that a sequence satisfying Definition R5 is k -distributed for all k , by induction on k . Similarly, by considering the “composition” of subsequence rules — if R 1 defines an infinite subsequence ⟨ X n ⟩R 1 , then we can define R 1 R 2 to be the subsequence rule for which ⟨ X n ⟩R 1 R 2 = ( ⟨ X n ⟩R 1 ) R 2 — we find that all subsequences considered in Definition R5 are ∞ -distributed. (See exercise 32.) The fact that ∞ -distribution comes out of Definition R5 as a very special case is encouraging, and it is a good indication that we may at last have found the definition of randomness we have been seeking. But alas, there still is a problem. It is not clear that sequences satisfying Definition R5 must satisfy Definition R4. The “computable subsequence rules” we have just specified always enumerate 3.5 WHAT IS A RANDOM SEQUENCE? 163 subsequences ⟨ X s n ⟩ for which s 0 < s 1 < · · · , but ⟨ s n ⟩ does not have to be monotone in R4; it must only satisfy the condition s n ̸ = s m for n ̸ = m To meet this objection, we may combine Definitions R4 and R5 as follows: Definition R6. A b -ary sequence ⟨ X n ⟩ is said to be “random” if, for every effective algorithm that specifies an infinite sequence of distinct nonnegative integers ⟨ s n ⟩ as a function of n and the values of X s 0 , . . . , X s n − 1 , the subsequence ⟨ X s n ⟩ corresponding to this algorithm is “random” in the sense of Definition R5. A [0 . . 1) sequence ⟨ U n ⟩ is said to be “random” if the b -ary sequence ⟨⌊ bU n ⌋⟩ is “random” for all integers b ≥ 2 The author contends* that this definition surely meets all reasonable philo- sophical requirements for randomness, so it provides an answer to the principal question posed in this section. D. Existence of random sequences. We have seen that Definition R3 is too strong, in the sense that no sequence can satisfy that definition; and the formulation of Definitions R4, R5, and R6 above was carried out in an attempt to recapture the essential characteristics of Definition R3. In order to show that Definition R6 is not overly restrictive, it is still necessary for us to prove that sequences satisfying all these conditions exist. Intuitively, we feel quite sure that there is no problem, because we believe that a truly random sequence exists and satisfies R6; but a proof is really necessary to show that the definition is consistent. An interesting method for constructing sequences satisfying Definition R5 has been found by A. Wald, starting with a very simple 1-distributed sequence. Lemma T. Let the sequence of real numbers ⟨ V n ⟩ be defined in terms of the binary system as follows: V 0 = 0 , V 1 = 1 , V 2 = 01 , V 3 = 11 , V 4 = 001 , . . . V n = .c r . . . c 1 1 if n = 2 r + c 1 2 r − 1 + · · · + c r ( 29 ) Let I b 1 ...b r denote the set of all real numbers in [0 . . 1) whose binary representa- tion begins with 0 .b 1 . . . b r ; thus I b 1 ...b r = (0 .b 1 . . . b r ) 2 . . (0 .b 1 . . . b r ) 2 + 2 − r ( 30 ) Then if ν ( n ) denotes the number of V k in I b 1 ...b r for 0 ≤ k < n , we have ν ( n ) /n − 2 − r ≤ 1 /n. ( 31 ) Proof. Since ν ( n ) is the number of k for which k mod 2 r = ( b r . . . b 1 ) 2 , we have ν ( n ) = t or t + 1 when ⌊ n/ 2 r ⌋ = t . Hence ν ( n ) − n/ 2 r ≤ 1. It follows from ( 31 ) that the sequence ⟨⌊ 2 r V n ⌋⟩ is an equidistributed 2 r -ary sequence; hence by Theorem A, ⟨ V n ⟩ is an equidistributed [0 . . 1) sequence. In- deed, it is pretty clear that ⟨ V n ⟩ is about as equidistributed as a [0 . . 1) sequence can be. (For further discussion of this and related sequences, see J. G. van der * At least, he made such a contention when originally preparing this material in 1966.