Long repetitive patterns in random sequences

SummaryAppearances of long repetitive sequences such as 00...0 or 1010...101 in random sequences are studied. The expected length of the longest repetitive run of any specified type in a random binary sequence of length n is shown to tend to the binary logarithm of n plus a periodic function of log n. Necessary and sufficient conditions are derived to ensure that with probability 1 an infinite random sequence should contain repetitive runs of specified lengths in given initial segments. Finally, the number of long repetitive runs of a specified kind that occur in a random sequence is studied. These results are derived from simple expressions for the generating functions for the probabilities of occurrences of various repetitive runs. These generating functions are rational, and lead to sharp asymptotic estimates for the probabilities.