As a professional gambler, it seems natural to start with gambler’s ruin.
As a professional gambler, I’m extremly senstive about the house edge. That’s why I mostly just play fair games like flipping a coin. After a coin is flipped, I win 1 dollar for head (H) and lose 1 dollar for tail (T). I play until I got broke or the casino got broke (ambitious plan). As ridiculous it seems, I almost always got broke, even though it’s a “fair” game.
Let’s consider a more general version of the problem. Two gamblers Alice and Bob flip a biased coin with probability p to get a head and q=1−p to get a tail. Alice wins 1 dollar from Bob if head is flipped and loses 1 dollar to Bob if tail is flipped. Alice has a dollars and Bob has b=n−a dollars to start with. The game ends when one party owns all n dollars.
Let Ai be the probability that Alice gets all n dollars starting with i dollars, and Bi be the probability that Bob gets all n dollars starting with i dollars. We have An=Bn=1 and A0=B0=0.
Suppose Alice has i dollars now and they flip a coin. If a head comes, Alice will own i+1 dollars and the probability that she wins in the end is exactly Ai+1; similarly, the probability that she wins is Ai−1 if a tail is flipped. Thus, we have
Ai=pAi+1+qAi−1⟹Ai+1−Ai=pq(Ai−Ai−1)
Using the equations on the right recursively, we have that
Ai−Ai−1=pq(Ai−1−Ai−2)=(pq)2(Ai−2−Ai−3)=⋯=(pq)i−1(A1−A0)=(pq)i−1A1
Using the equations on the right and A0=0, we have
Ai=Ai−A0=j=1∑iAj−Aj−1=Aij=1∑i(pq)j−1=⎩⎪⎪⎪⎪⎨⎪⎪⎪⎪⎧iAi1−pq1−(pq)iA1q=p=21q=p
Substitute in An=1,
A1=⎩⎪⎪⎪⎪⎨⎪⎪⎪⎪⎧n11−(pq)n1−pqq=p=21q=p
Thus, we have
Ai=⎩⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎧ni1−(pq)n1−(pq)iq=p=21q=p
By symmetry, we have
Bi=⎩⎪⎪⎪⎪⎪⎨⎪⎪⎪⎪⎪⎧ni1−(qp)n1−(qp)iq=p=21q=p
It takes some algebra to show that Ai+Bn−i=1. This apparently makes sense, since either Alice wins or Bob wins. However, it is actually a non-trivial result because it suggests the game is finite.