# Particle moving around a circle and Gambler's Probability

I can't understand the logic.

I'm specifically referring to this book. from p.78 to p.79.

It's telling that the 'Particle moving around a circle' has something to do with the 'Gambler's probability'.

Particle moving around a circle is arguing that when you start at state(node) 0, stop when every nodes have been visited, probability that state(node) $$i, i \in \left \{ 1,2, ..., m \right \}$$ is the last one visited is $$\frac{1}{m}$$.

And after that, book is saying that the above can be used to Gambler's Probability.

When it is equally likely to either win or lose one unit on each gamble, the probability that you up by 1 before being down by n is $$\frac{n}{n+1}$$.

But, I don't think this is the same situation with 'Particle moving around a circle', because in that case, you could go clockwise or counter-clockwise. Which means $$i-1\equiv m$$ when $$i = 0$$ and $$i+1 \equiv 0$$ when $$i = m$$, which is not the case for gambler's probability.

To summarize, the question is, I don't get why the probability that you up by 1 before being down by n is $$\frac{n}{n+1}$$.

Suppose the nodes are numbered $$0$$ to $$10$$ and that we are at node $$5$$, without having visited either node $$6$$ or node $$7$$ yet. The only way to visit node $$7$$ before visiting node $$6$$ is to visits each of nodes $$4,3,2,1,0,10,9,8,7$$ before visiting node $$6.$$ If we think of this as the winning direction, then the gambler has a net gain of $$9$$. On the other hand, if he visits $$6$$ first, then he has a net loss of $$1.$$
You don't have to worry about the circle any more. He won't wrap around from $$7$$ to $$6$$ because once he gets to $$7$$ he stops. (Perhaps he's broken the bank?) He also, won't wrap from $$6$$ to $$7,$$ because he's broke.