37

For a graph $G$, let $W$ be the (random) vertex occupied at the first time the random walk has visited every vertex. That is, $W$ is the last new vertex to be visited by the random walk. Prove the following remarkable fact:

For the random walk on an $n$-cycle, $W$ is uniformly distributed over all vertices different from the starting vertex.

Did
  • 284,245
benny
  • 1,239
  • 2
    A good start would be to reformulate the claim to be about an ordinary random walk on $\mathbb Z$. The claim is then that at the first time $n-1$ different nodes have been visited, the number $u$ of visited nodes to the right of the starting point is uniformly distributed between $0$ and $n-2$. In this form it looks like it should be amenable to an induction proof, if you strengthen it to say something about the probability that the rightmost node (and not the leftmost one) was the last one visited, as a function of $n$ and $u$. – hmakholm left over Monica Mar 04 '12 at 21:54
  • I wish I could accept two answers. I am very grateful to both of you and I wanted to express my gratitude by accepting both answers. And Didier Piau's answer made me realize that your elegant solution requires a notable amount of mathematical maturity, that I may lack. On the other hand, your soultion is elegant indeed. You made me think, I think I change the accepted answer again :) – benny Mar 06 '12 at 05:33
  • 1
    In other words, you accept a solution because (people tell you) it is elegant although you do not understand how it works nor why it is true. O well. (To be clear: PLEASE do not change again.) – Did Mar 06 '12 at 06:07
  • 1
    Note that while you automatically get notified of comments under your post, others that you respond to (me in this case) don't get notified unless you ping them using the @username idiom. – joriki Mar 06 '12 at 11:27
  • @DidierPiau I am afraid you are right. I would like to emphasize that I am very grateful for you clear, detailed and precise answer. You helped me a lot! Thank you so much and sorry for my strange acceptation choice. – benny Mar 06 '12 at 18:25

4 Answers4

28

Consider a simple symmetric random walk on the integer line starting from $0$ and, for some integers $-a\leqslant 0\leqslant b$ such that $(a,b)\ne(0,0)$, the event that the walk visits every vertex in $[-a,b]$ before visiting vertex $-a-1$ or vertex $b+1$. This is the disjoint union of two events:

  • Event 1: Starting from $0$, the walk visits $b$ before visiting $-a$, then, starting from $b$, it visits $-a$ before visiting $b+1$,
  • Event 2: Starting from $0$, the walk visits $-a$ before hitting $b$, then, starting from $-a$, it visits $b$ before hitting $-a-1$.

Recall that the probability that a simple symmetric random walk starting from $i$ visits $i-j\leqslant i$ before visiting $i+k\geqslant i$ is $\frac{k}{k+j}$, for every nonnegative integers $j$ and $k$.

Hence, the probability of Event 1 is $\frac{a}{a+b}\cdot\frac1{a+b+1}$, the probability of Event 2 is $\frac{b}{a+b}\cdot\frac1{a+b+1}$, and the probability of their union is $\frac1{a+b+1}$. Note that this last formula is also valid when $a=b=0$.

If $b=x-1$ and $a=n-x-1$ with $1\leqslant x\leqslant n-1$ and $n\geqslant2$, then $a+b+1=n-1$ hence the computation above shows that the probability that the last visited vertex in the discrete circle $\{0,1,\ldots,n-1\}$ is $x$ is $\frac1{a+b+1}=\frac1{n-1}$. That is, the probability of the event $[W=x]$ is $\frac1{n-1}$ for each $x\ne0$ in the circle, and $W$ is uniformly distributed on the circle minus the starting point of the random walk.

Did
  • 284,245
  • 3
    Usually it tends to be you who finds the more elegant solutions that explain the unexpectedly simple result without undue calculation; this time it's the other way around :-) – joriki Mar 05 '12 at 09:19
  • 5
    @joriki: Yes. But I know as an experimental fact that a rigorous justification of each step of the elegant solution requires a notable amount of mathematical maturity. – Did Mar 05 '12 at 17:56
  • 2
    Didier, I hope my comment in connection with my curiosity about the change of the accepted answer and the subsequent re-change didn't create a "competitive" impression -- I was just pleased to find a solution involving less calculation than yours because it's more often the other way around :-) By the way, I still owe you an answer to an earlier comment -- yes, I do stay up during the night a lot, but I'm trying to cut down on that :-) – joriki Mar 06 '12 at 11:32
  • 3
    @joriki: You certainly do not have to worry about this (and your answer is excellent, naturally). You already know this but let me say it nevertheless: first, I am often puzzled by the acceptation choices on MSE; second, this puzzlement does not concern you as an answerer: you proposed a (mathematically sophisticated) solution, it got accepted hence it can only mean the OP is happy, everything is fine. (Unrelated: in my experience, staying up at night to do maths is a gambit which is difficult to refuse but is often lost, in the long run....) – Did Mar 06 '12 at 13:25
  • Is there a way to come up with recursive equations for this problem (the closed form of which gives the answer) ? – emmy Mar 02 '18 at 20:16
17

This question is rephrased as a game and can be analyzed with no computation!

A class of 30 children is playing a game where they all stand in a circle along with their teacher. The teacher is holding two things: a coin and a potato. The game progresses like this: The teacher tosses the coin. Whoever holds the potato passes it to the left if the coin comes up heads and to the right if the coin comes up tails. The game ends when every child except one has held the potato, and the one who hasn't is declared the winner.

How do a child's chances of winning change depending on where they are in the circle? In other words, what is each child's win probability?

From FiveThirtyEight Puzzle Column

It is equivalent to show that all students have equal probability of winning. To this end, consider the students to the left and the right of the teacher. Call them the teacher's pets. Both teacher's pets have equal probability of winning by symmetry.

The teacher is blue, the teacher's pets are green, and the potato is a lumpy yellow cloud. Small white circles are the other students.

Diagram 1: The teacher is blue, the teacher's pets are green, and the potato is a lumpy yellow cloud. Small white circles are the other students.

Now consider any student who hasn't lost yet. We can show he has the same chance of winning as a teacher's pet. Call this student "Purple".

Purple is a student who hasn't lost yet.

Diagram 2: Purple is a student who hasn't lost yet.

With $100 \%$ certainty, the potato will arrive to Purple's left or to his right eventually. Consider the first time this happens.

The potato touches one of his neighbors for the first time. Red players have lost already.
Diagram 3: The potato touches one of his neighbors for the first time. Red players have lost already.

In that situation, he use the power of imagination! He can image that he himself is a teacher's pet since his situation has become identical to the starting condition, and therefore his probability of winning is the same as that of the teacher's pets.

Purple imagines that he is a teacher's pet.
Diagram 4: Purple imagines that he is a teacher's pet. The arrow should be understood to mean "imagines himself as".

Mark
  • 6,038
  • 2
    This is an excellent intuitive solution! I think it would get more (deserved) attention if the key step was explained better: you're really using a coupling between two copies of the process, one started from the teacher and the other started next to purple. – J Richey Feb 15 '19 at 10:39
  • 1
    Thank you! I'll make an attempt to incorporate your suggestion. There really should be a way to depict it that requires no text at all. – Mark Feb 15 '19 at 13:58
  • 1
    @JRichey I am not completely clear how to use the language of coupling to express the result. Maybe you can submit an answer? – Mark Feb 23 '19 at 23:30
  • 1
    Wow. This is amazing! – Daniel Li Aug 20 '19 at 19:36
  • 1
    Why has the purple student's situation become identical to the starting position? The red players have already lost, including the red person on the other side of the ball, who would be the other teacher's pet in the imagined situation. So the situation is quite different. Also, the purple student in fact has a higher winning probability than a teacher's pet. For instance, if all students except the purple student and her right-hand neighbour have lost, the game reduces to a linear random walk, which the purple student is far more likely to win since the ball is right next to her. – joriki Jan 04 '20 at 09:08
  • 2
    @joriki That is a sensible objection. But in order for the purple player to win, every currently red player must touch the potato again, because losing players do not leave the circle. The purple student can therefore forget which players are currently red. – Mark Jan 04 '20 at 19:30
  • @Mark: Sorry, I should have said "which the purple student is far more likely to lose" (rather than "win"). I'm afraid I don't understand your argument. Can you make it specific to the case where all students except the purple student and her right-hand neighbour have lost? Do you agree that in this case the game reduces to a linear random walk? Do you agree that in this linear random walk the person right next to the ball is far more likely (in fact by a factor of $n-2$) to lose than her right-hand neighbour, who is $n-2$ steps away from the ball? Which part of my argument do you think fails? – joriki Jan 04 '20 at 20:24
  • 1
    The argument fails because the game does not reduce to a linear random walk. The circular structure is not modified at any point in the game. Teacher is allowed to touch the potato/ball and losing players are also still allowed to touch the potato/ball.

    The right-hand neighbor is in immediate danger of losing if the ball happens to travel counter-clockwise through the purple player.

    – Mark Jan 04 '20 at 20:34
  • 2
    @Mark: I'm aware that the teacher and the losing players are allowed to touch the potato. But the potato can't travel to the right-hand neighbour through the purple player. I'm concentrating on the case where the purple player and her right-hand neighbour are the only two players left. In that case, the game ends once the potato reaches either the purple player or the right-hand neighbour. Thus, the potato is never passed from either to the other, and hence the walk reduces to a linear walk with these two at the boundaries. In this case the potato is more likely to reach the closer player. – joriki Jan 04 '20 at 21:37
  • 1
    Oh sorry - I understand now. Let $p$ be the probability that a teacher's pet will win. By the imagination argument, the Purple has also probability $p$ of winning. In the situation you are describing, Purple's neighbor has a probability $1-p$ of winning. Indeed, $1-p$ is greater than $p$. So your argument does not fail. You could then try to generate a paradox by calling Purple's neighbor as Purple2, and claiming he also has a probability $p$ of winning. However, this is forbidden because the imagination argument can only be used when the potato first reaches Purple2's (not Purple's) neighbor! – Mark Jan 04 '20 at 23:01
16

In order to reach $W$ last, the walk has to visit one of $W$'s neighbours for the last time and then go all around the cycle to arrive at $W$ from the other side. Let's call a segment of a random walk on the cycle that starts at some vertex $V$ and reaches one of $V$'s neighbours by going around the cycle without returning to $V$ a final segment. Then the last vertex reached after time $t$ is the final vertex of the first final segment that begins at or after $t$. Consider a random walk on the cycle, and for every final segment that ends at $W$, consider the stretch of times $t$ for which it is the first final segment that begins at or after $t$. If we can show that all vertices except $W$ occur with the same frequency in this stretch, then it will follow that conversely $W$ is reached last with the same probability from all other vertices, and thus all vertices $W$ are reached last with the same probability from a given initial vertex.

But the stretch extends precisely up to the last visit to $W$ before the segment, so the frequency of vertices in it is just that between any two successive visits to $W$, which is just the frequency of occurrence of the vertices other than $W$ in the walk in general, which is the same for all vertices.

P.S.: It's actually not too difficult to determine the probability of each vertex to be the last vertex visited at any stage in the process. The vertices already visited always form an interval. If the current position is at the end of an interval of $k$ visited vertices, every unvisited vertex has the same $1/(n-1)$ probability of becoming the last one, except the first unvisited vertex at the other end of the interval, which has $k/(n-1)$. This is because for all vertices except this one, exactly the same realizations of the walk will make them the last vertex as would be the case if no vertices had been visited yet. Thus, every vertex has a constant probability $1/(n-1)$ of ending up as the last vertex until the walk first visits one of its neighbours.

If the current position is in the interior of the interval of visited vertices, the probability of reaching one end of the interval before the other varies linearly over the interval, and thus so do the probabilities of the two unvisited vertices bordering the interval to become the last vertex – the sum of their probabilities is $(k+1)/(n-1)$, and this shifts by $1/(n-1)$ by each move, in favour of the vertex that the move moves away from.

joriki
  • 242,601
2

A: A easier question is with a simple random walk (no circle), the probability of hitting $+a$ before $-b$ is $\frac{b}{a+b}$ and of hitting $-b$ before $+a$ is $\frac{a}{a+b}$. (To see this, consider that expected position when you stop having hit one of them is always $0$ as this is a martingale.)

B: In the circle walk, for the vertex immediately clockwise from the starting vertex, it is the last to be visited if in A you visit $-(n-2)$ before $+1$, which has probability $\frac{1}{n-1}$. Similarly for the vertex immediately anti-clockwise from the starting vertex.

C: For a vertex $k$ steps clockwise from the starting vertex (i.e. $-(n-k)$ anticlockwise) to be the last to be visited, either you hit $k-1$ before $-(n-k-1)$ with probability $\frac{n-k-1}{n-2}$ as in $A$ and then reverse almost all the way round as in B with probability $\frac{1}{n-1}$, or you hit $-(n-k-1)$ before $k-1$ with probability $\frac{k-1}{n-2}$ and then reverse almost all the way round with probability $\frac{1}{n-1}$. So combining these, the probability is $$\frac{n-k-1}{n-2}\frac{1}{n-1}+\frac{k-1}{n-2}\frac{1}{n-1}=\frac{1}{n-1}$$ and this does not depend on the value of $k$.

Mark's no-calculation solution short-cuts C (and indeed B and A) by saying that for a given point, one of its neighbours will be inevitably be visited before the other neighbour and before the given point is; from there, for the given point to be visited last, you then need to visit the other neighbour going back round before visiting the given point, with the probability of that second event being the same for all possible given points based on the symmetry.

Henry
  • 169,616