5

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.

Dan
  • 22,158
  • 1
    @MarkBennet According to the link in the question, it is normal in base $10$. – Dan Jul 24 '23 at 08:25
  • 2
    I stand corrected. It looks like there is a bias to odd digits too small to interfere with normality. – Mark Bennet Jul 24 '23 at 08:28
  • 1
    @MarkBennet Yes; then, is the bias to odd digits too small to interfere with returning to the origin? – Dan Jul 24 '23 at 08:30
  • 1
    I suspect that the fact that you get all the $n-$digit numbers beginning with $1$ before the $n-$digit numbers beginning with $2$ will maintain the bias. In the second position the $0$ comes before $1$ but there are only a tenth as many of those, and the final digit will be odd except for the prime $2$. So I think the pattern you have will persist. I was thinking whether I could insert digits into a normal number to force a bias. (I can do that if they are sparse enough, and as the number remains normal I can repeat the process) – Mark Bennet Jul 24 '23 at 09:04
  • 3
    A number is already normal , if every finite digit sequence appears in the expected frequency. It is not necessary that there is a point where the number of odd and even digits is equal. – Peter Jul 24 '23 at 12:33

1 Answers1

6
  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.

  • I think I get your point about probability $1$ not being a gaurantee. Is it like: If I choose a uniformly random point inside a circle, the probability of not choosing the centre point is $1$, but that doesn't mean I will never choose the centre point? – Dan Jul 24 '23 at 14:12
  • Does your construction $0.110111001111000111110000\ldots$ match this property of normal numbers from the link: "A normal number is an irrational number for which any finite pattern of numbers occurs with the expected limiting frequency in the expansion in a given base (or all bases)." – Dan Jul 24 '23 at 14:12
  • 1
    The number is simply normal in base $2$. I have no idea if it is absolutely normal. However, the numbers that you are constructing can be reduced to base $2$, since you are only interested in parity. Other bases aren't particularly relevant. It is possible to build more complicated examples (e.g. concatenate all of the $n$-digit binary numbers, then throw in a $1$, then concatenate all of the $n+1$-digit binary numbers, then throw in a $1$, etc) which have even nicer normality, and which still have corresponding walks which diverge. – Xander Henderson Jul 24 '23 at 14:13
  • 4
    The point is that it only takes a very little bit of bias to totally wreck a "random" walk, and this bias needn't change the normality of a number at all. – Xander Henderson Jul 24 '23 at 14:17
  • "...and which still have corresponding walks which diverge." I see why they diverge. But diverging is not necessarily incompatible with returning to the origin an infinite number of times. I'm imagining a walk whose graph looks roughly like the function $|x\sin x|$: it goes further and further away, but it also returns to the $x$-axis an infinite number of times. – Dan Jul 25 '23 at 11:17
  • @Dan If it diverges then, by definition, for any $N$, there exists $n$ such that the distance from the origin to the location of the walker at the $n$-th step is greater than $N$ for all $n > N$. So if a "random" walk diverges, then it eventually gets arbitrarily far from the start, and never returns. If it returned to the start before then, just consider the walk, but starting at a later timestep. – Xander Henderson Jul 25 '23 at 13:19
  • OK, but then by that definition of "diverge", I don't see why the example you gave (concatenate all of the $n$-digit binary numbers, then throw in a $1$, then concatenate all of the $n+1$-digit binary numbers, then throw in a $1$, etc) would diverge. The starting points of each section (by section, I mean the strings between the thrown in $1$s) would certainly drift away from the origin, but the amplitudes of the sections increase, so maybe the graph looks roughly like $|x \sin x|$. – Dan Jul 25 '23 at 13:47
  • @Dan Among all the binary strings of length $n$, there are $n/2$ ones, and $n/2$ zeros. For example, the strings with length two are 00, 01, 10, and 11. So all of the "lefts" and "rights" in the strings of length $n$ completely cancel each other out. Adding a 1 at the end moves you one step to the right. Then the next block doesn't have any net effect, and the 1 at the end moves you one step to the right. And so on. – Xander Henderson Jul 25 '23 at 13:52
  • And the situation is worse if you don't include the leading zeros, (so, for example, if you declare that 001 is not a number), since that just gets rid of some leftward steps. – Xander Henderson Jul 25 '23 at 13:53
  • Yes, the starting points of the "blocks" drift away from the origin. But we still need to consider the amplitude of the blocks. Take for example the block of binary strings of length $5$. (Let $1=$ move away from origin one step, $0=$ move toward origin one step.) At one point in this block, the walker is $6$ steps closer to the origin, compared to the start of the block. So even though the starting position of the blocks drift away from the origin, we still need to consider the amplitude of the blocks. – Dan Jul 25 '23 at 14:10
  • 1
    @Dan If you change the inserted digit from a 1 to a 0, perhaps it is more clear? Since the leftward steps all happen earlier in the sequence, the walker moves left a large amount, then inches back to the right, eventually getting to where they started. – Xander Henderson Jul 25 '23 at 14:14
  • I think I'm happy with that. Thank you so much! – Dan Jul 25 '23 at 14:25
  • Another bias towards odd numbers in the Copeland–Erdős constant stems from the fact that the leading digit of any prime is never $0$ (by definition). – Emil Jeřábek Jul 26 '23 at 13:25