Random-like walk based on the parity of digits of a normal number: must it return to the origin

number theoryprime numbersrandom walksequences-and-series

Using the sequence of digits of a normal number, create a random-like walk: starting with the first term, if a term is odd then move up one unit; if it is even then move down one unit.

Will the walk necessarily return to the origin?

Example

Consider the sequence of digits of the Copeland-Erdos constant, which is formed by concatenating the sequence of prime numbers in base $10$:

$2,3,5,7,\color{red}{1},\color{red}{1},\color{blue}{1},\color{blue}{3},\color{orange}{1},\color{orange}{7},\color{brown}{1},\color{brown}{9},\color{green}{2},\color{green}{3},\dots$ (A033308)

Here is the graph of position against step number, for the first $2000$ steps.

enter image description here

(Actually, we know that the walk returns to the origin, because it does so on the second step; so just consider the walk to begin after the first two steps. The approximately horizontal section corresponds to the prime numbers from $2003$ to $2999$.
Numerical data for this example can be found at this question, which my question seeks to generalize.)

If the terms in the sequence behave like random numbers, then the answer would be yes. But the sequence is not random; they can be predicted. I don't know what this implies about the whether the walk will return to the origin.

Best Answer

  1. The asker writes

    Will the walk necessarily return to the origin?

    ...

    If the terms in the sequence behave like random numbers, then the answer would be yes.

    No. This isn't correct. The relevant result (linked in the original question) is that the probability of returning to the origin in finite time is $1$ (for a one- or two-dimensional random walk). This is not quite the same as saying that there is a guarantee that a random walker will return to the origin.

    From a practical point of view, this is a certain bet—but that does not mean that every random walk actually will return to zero in finite time. It is possible (though extraordinarily unlikely) that the walker will go left at every timestep.

  2. Normal numbers are not (necessarily) random. Normality just means that the natural density of each possible digit is uniform. That is, with an "alphabet" of $K$ possible digits, $$ \lim_{n\to\infty} \frac{|\{i : \text{the $i$-th digit is $k$ }\}|}{n} = \frac{1}{K}, $$ where $k \in \{0,1,2,\dotsc,K-1\}$. It is relatively simple to construct normal numbers whose corresponding random walks do not return to zero. For example, consider the binary number $$0.110111001111000111110000\ldots$$ This number consists of alternating sequences of ones and zeros, where the number of zeros after a sequences of ones is always one less than the number of ones in that sequence, and the number ones after a sequence of zeros is always one more than the number of zeros in that sequence. Observe that, after a sequence of $m$ zeros, there have been a total of $$ \frac{1}{2}m(m+1) \text{ zeros}, \qquad\text{and}\qquad \frac{1}{2}(m+1)(m+2) -1 \text{ ones}. $$ The density of zeros is then $$ \frac{\frac{1}{2}m(m+1)}{\frac{1}{2}m(m+1) + \frac{1}{2}(m+1)(m+2) -1} = \frac{\frac{1}{2} m^2 + \text{lower order terms}}{m^2 + \text{lower order terms}} \overset{m\to\infty}{\longrightarrow} \frac{1}{2}.$$ This number is simply normal in base $2$.[1]

    On the other hand, the corresponding "random" walk diverges to infinity. It takes for each natural number $n$, it takes $n+1$ steps to the right, and then $n$ steps to the left, for a net movement of $1$ step to the right. As such the "random" walker moves farther and farther away from its starting point.

    I suspect (though I cannot prove) that something similar is happening with the concatenation of prime numbers. The one's digit of a prime number is always going to be odd (after $2$, anyway). I don't know of any reason to expect that the other digits will have any particular pattern,[2] so it seems reasonable to expect that everything after the ones place will be either even or odd with equal probability. So there is a small bias towards "oddness". If this is true, then the "random" walk will diverge to infinity.


[1] Based on the comments, another example of a number, expressed in binary, which is normal (not just simply normal) and which has an associated random walk which eventually goes away from zero and never returns is $$0.\color{red}{0}\ 0\,1\ \color{red}{0}\ 00\,01\,10\,11\ \color{red}{0}\ 000\,001\,010\,011\,100\,101\,110\,111\ \color{red}{0}\ldots.$$ Thus number is obtained by concatenating all of the binary strings of length $n$, then inserting a $0$ (shown in red, above) between each block of strings. In any block of strings, there are an equal number of ones and zeros, so left and right steps cancel each other out. The extra ones cause the walker to move arbitrarily far to the right. Moreover, this number is normal in base-2 (and I suspect that it is absolutely normal, though I don't know how to prove that at the moment, so it may not be).

[2] Actually, now that I think about it, I would expect to see more $1$s in the leading place, followed by $2$s, followed by $3$s, and so on. This follows from the prime number theorem. Once again, this is not enough to effect the normality of the concatenation of the primes, but it is enough to change the behaviour of the corresponding "random" walk.

Related Question