Let's consider a situation when two gamblers bet on whether a coin tossed is head or tail. Assume gambler A has x dollars and gambler B has y dollars. And gambler A always bets on head whereas gambler B always bets on tail. For each round, they bet one dollar. Then, if the probability of tossing a head is p and that of tail is q (= 1-p) and they gamble until one of them is ruined (running out of money), what is the probability that gambler A wins all the money at the end?
Let s1, s2, ....., sn be a sequence of random variables such that
Let us put S0=0, Sk = s1 + s2 + ..... + sk, 1<=k<=n. In other words, the sequence, S0, S1, ....., Sn as the path of the random fluctuation between the two extremas where either gambler A or gambler B is ruined with starting point at zero. In this problem, Sk can be regarded as the amount won by gambler A from gambler B after k turns. It directly follows that for k<=n (this only means that k is finite) the first time Sk=y is the condition that B is ruined, whereas Sk=-x is the condition that A is ruined.
Let m be an integer between -x and y. It denotes the money gambler A is gained at a particular instant.
Let the event "A wins within k turns given m dollar is gained at the beginning" = imk
Let Imk = P(imk)
Imk
= P(imk)
= P(imk and s1=1) +
P(imk and s1=-1)
= P(imk | s1=1)P(s1=1)+
P(imk | s1=-1)P(s1=-1)
= pP(imk | s1=1)+
qP(imk | s1=-1)
It would be convenient to determine Imk if P(imk | s1=1) = P(im+1k-1)
To prove this crucial equality, we notice the fact that imk is in a one-one correspondence to the path
Hence,
P(imk | s1=1)
= P((m, m+S1, ....., m+Sk) | s1=1)
= P((m+1, m+1+s2, ....., m+1+s2+...+sk))
(note: we eliminate the cases where s1 not equal 1)
= P((m+1, m+1+s1, ....., m+1+s1+...+sk-1))
(note: index shifting)
= P(im+1k-1)
As a result for all -x<=m<=y and k<=n,
We observe that as imk-1 is a subset of imk, it follows that Imk-1<=Imk<=1 (and the fact that I is a probability measure). Therefore I is monotonic increasing and bounded above. Hence, its limit exists.
Let Im be the limit.
We obtain the second order recursive equation,
The characteristic equation for this recursive equation is
The solutions for r is (1±(2p-1))/(2p), ie 1 or q/p
Note that the solution implies that if q does not equal to p, then it will be the case of real distinct root.
Hence, by solving the following system of equations using the boundary conditions,
Solving the system of equation, we have
c1 = (q/p)-x/((q/p)y - (q/p)-x) and c2 = 1/((q/p)y - (q/p)-x)
By substitution and some algebra, we arrive at the solution for the case q does not equal p
(q/p)m+x - 1
Im =
------------
(q/p)x+y - 1
For the case p = q = 1/2, we use partial derivative once. The partial derivative of rm with respect to m is m×rm-1. In this case r=1, therefore another independent solution is m(1)m-1 = m. Hence, now the system of equations become:
Then, c1 = x/(x + y) and c2 = 1/(x + y)
m + x
Im =
------
x + y