A sequence is random if it has no property that can be detected effectively and that only a null class of sequences shares. Martin-Löf (1966) made this precise by requiring the null class to be covered by open classes of measure at most , enumerated uniformly in . The rate allows all such tests to be combined into a single one, which is the main technical feature of the definition. This lesson introduces the tests, proves the existence of a universal test, shows that random sequences satisfy the law of large numbers, and gives an equivalent definition due to Solovay.
2.1 Tests
A sequence of classes is uniformly if there is a c.e. set such that for every , where . An index of is an index of the sequence.
A Martin-Löf test is a uniformly sequence with for every . A sequence is captured by the test if , and passes it otherwise. A sequence is Martin-Löf random if it passes every Martin-Löf test.
The class captured by a test is a null class, since its measure is at most for every . One may assume the test decreasing: the classes are uniformly , decrease, satisfy the same bound, and have the same intersection. We write MLR for the class of Martin-Löf random sequences.
- A computable sequence is not random: is a Martin-Löf test capturing .
- The covers of Example 1.5 are Martin-Löf tests. So a random sequence has for some , and for every computable infinite set , for some , hence for infinitely many, applying this to the tails of .
The bound can be replaced by any computable bound tending to .
Let be uniformly , and let be a computable sequence of rationals with and . Then no Martin-Löf random sequence belongs to .
For each , let be the least with ; it exists since tends to , and is computable from . The sequence is uniformly , with , and .
2.2 A universal test
There is a Martin-Löf test such that contains every class captured by a Martin-Löf test. So a sequence is Martin-Löf random if and only if it passes .
Let be the standard enumeration of the c.e. subsets of . Every Martin-Löf test is of the form for some , but most indices do not define tests. We transform each into a test, without changing those that already are.
Fix and , and let be the elements of in the order of their enumeration (the list may be finite). Define finite sets , and if , and otherwise. The measure of the open class generated by a finite set of strings is a rational computable from the set, so the sets are computable from , and . Let . Then:
- is uniformly , uniformly in ;
- , as the supremum of the measures of the increasing classes , each at most ;
- if , then every is accepted, since ; so .
So is a Martin-Löf test for every , and every Martin-Löf test is one of them. Let
It is uniformly , and . If is captured by the test , then for every .
2.3 Consequences
Let be a universal Martin-Löf test.
- The class MLR is conull.
- For every , the complement is a class of measure at least consisting of random sequences. So MLR is a class.
- There is a low Martin-Löf random sequence, and a computably dominated one.
- The complement of MLR is , which is null.
- The complement of a class is a class (Proposition 1.7 of “Trees and Π⁰₁ classes”). A sequence outside is outside , hence random by universality. A sequence is random if and only if it is outside , that is, in some .
- is a non-empty class, since its measure is at least . Apply the low basis theorem (Low basis theorem) and the computably dominated basis theorem (Computably dominated basis theorem).
The two random sequences of (3) are very different. A computably dominated sequence that is not computable is not (Definition 3.3 of “Basis theorems”), whereas a low sequence is . The next lesson shows that Chaitin’s is random, giving a random sequence of the degree of .
2.4 The law of large numbers
A random sequence should contain asymptotically as many zeros as ones. This is the law of large numbers, and it follows from a bound on the number of strings with a deviating frequency of ones.
For every and , the number of strings of length with
is at most .
This is a classical estimate of probability theory, admitted here: it is the case of fair coin tosses of the inequality of Hoeffding (1963), and also follows from the Chernoff bound. A weaker bound, sufficient for the argument below, can be obtained from Markov’s inequality applied to the fourth moment of the number of ones.
If is Martin-Löf random, then .
Fix a rational , let be the computable set of strings of length described in Fact 2.6, and let , a uniformly sequence. Let . By subadditivity,
One computes rationals with ; they tend to . If the frequency of ones in differs from by more than for infinitely many , then for every , and is not random by Lemma 2.3. A random therefore has frequencies eventually within of , for every rational .
The same argument, with Hoeffding’s inequality for the independent events “the -th block is ”, each of probability , applies to blocks: for a random and a string of length , the frequency of the occurrences of among the blocks tends to . Since the tails of a random sequence are random (second exercise below), the same holds for the blocks starting at the positions , for each ; so occurs at a position with frequency tending to . Random sequences are therefore normal in base in the sense of Borel.
2.5 Solovay tests
The rate in the definition of tests is convenient for building a universal test, but proving that a given sequence is not random is often easier with a summability condition.
A Solovay test is a uniformly sequence with . A sequence is captured by the test if for infinitely many .
By the Borel–Cantelli lemma, the class captured by a Solovay test is null. A Martin-Löf test is a Solovay test, with , and a sequence in all its components is in infinitely many. The converse requires an argument.
A sequence is Martin-Löf random if and only if it is not captured by any Solovay test.
() A Martin-Löf test is a Solovay test, and a sequence captured by it as a Martin-Löf test is captured by it as a Solovay test.
() Let be a Solovay test, and let be such that . Let be the class of sequences that belong to for at least values of . A sequence captured by the Solovay test belongs to every . We show that is a Martin-Löf test.
Fix an enumeration of the c.e. set defining . For a stage , let be the clopen class generated by the strings enumerated into the -th component by stage , for , and for . Delaying the enumeration of each string to a stage at least does not change the classes ; so we may assume that the strings enumerated by stage have length at most . Each is then a union of cylinders with . Let be the set of strings of length such that for at least values of ; it is computable from and . Counting pairs with and in two ways gives
so . The classes increase with , since the classes do. If belongs to classes , all these memberships are witnessed at some stage , and then . So : it is uniformly , and by continuity. Hence is a Martin-Löf test, and it captures every sequence captured by .
The counting step is Markov’s inequality: the average number of classes containing a sequence is , so the sequences belonging to of them have measure at most times this sum.
2.6 Exercises
Let be Martin-Löf random. Show that for every , some block consists of zeros only. Deduce that contains arbitrarily long runs of zeros.
Solution
Fix , and let be the clopen class of sequences none of whose first blocks of length is . The blocks are independent: , which tends to and is a computable rational. The sequence is uniformly , so by Lemma 2.3 a random sequence is outside some : one of its first blocks is .
Let be Martin-Löf random. Show that is random for every string , and that the tail is random.
Solution
For an open class and a string , write . Then ; this generating set is c.e., uniformly in an index of and in , when is c.e. (if some prefix of is in , it contains the empty string and ). So is uniformly in and in an index of , and , since divides measures by .
If is captured by , then belongs to every , and ; by Lemma 2.3, is not random. For the tail, with . If is captured by , let , a uniformly sequence with ; it captures .
A sequence is weakly 1-generic if it meets every dense c.e. set of strings : some prefix of belongs to . A sequence is Kurtz random if it belongs to no null class. Show that every Martin-Löf random sequence is Kurtz random, that every weakly 1-generic sequence is Kurtz random, and that no weakly 1-generic sequence is Martin-Löf random.
Solution
A null class is covered by clopen classes of measure at most , computable from (second exercise of Measure on Cantor space); this is a Martin-Löf test, so random sequences avoid .
Let be null, with computable. The set of strings not in is computable. It is dense: if some had all its extensions in , then and . A weakly 1-generic has a prefix outside , so .
For each , the set of strings of length at least with at least ones is computable and dense: a string is extended by with , which has at least ones. A weakly 1-generic meets every , so the frequency of ones in is at least for infinitely many . By Proposition 2.7, is not random.
2.7 Notes and references
Martin-Löf (1966) introduced the tests and the universal test; the definition was meant to capture all effective statistical tests, the law of large numbers being the first example. Solovay’s equivalent formulation appears in unpublished notes (1975). Kurtz (1981) introduced the randomness notion of the last exercise. Normal numbers were introduced by Borel (1909), who proved that almost every real is normal.
- P. Martin-Löf, The definition of random sequences, Information and Control 9 (1966), 602–619.
- W. Hoeffding, Probability inequalities for sums of bounded random variables, Journal of the American Statistical Association 58 (1963), 13–30.
- S. A. Kurtz, Randomness and genericity in the degrees of unsolvability, PhD thesis, University of Illinois, 1981.
- R. G. Downey and D. R. Hirschfeldt, Algorithmic Randomness and Complexity, Springer, 2010.