Gambler's ruin

Consider a gambler who at each game is equally likely to either win or lose $1. Suppose the gambler will quit playing further when he (cumulatively) either wins $5000 or loses $2000. Find the expected number of games the gambler plays.


The answer is 10000000.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Abhishek Sinha
Dec 11, 2014

We will use the Optional stopping theorem on two associated Martingales to solve the problem.

Let us denote the gain of the gambler on the i i th game by the random variable X i , i 1 X_i, i\geq 1 , where X i X_i 's are i.i.d. Each of the X i X_i s take values from the set { 1 , 1 } \{1,-1\} with equal probability, thus E X i = 0 , E X i 2 = 1 , i 1 \mathbb{E}X_i=0, \mathbb{E}X_i^2=1, \forall i\geq 1 . Total winnings of the gambler upto n n th game is given by the r.v. S n S_n where S n = i = 1 n X i S_n=\sum_{i=1}^{n}X_i Let the threshold for the gambler for quitting be a a and b -b . Here a = 5000 , b = 2000 a=5000, b=2000 . The gambler quits when S n S_n reaches either a a or b -b . Let T T denote the random time when the gambler quits. Note that T T is a stopping time , w.r.t. the σ \sigma field generated by { S n } n 1 \{S_n\}_{n\geq 1} . It is also clear that the sequence S n T |S_{n\wedge T}| is uniformly bounded. Hence using the optional stopping theorem on the zero-mean martingale Sequence { S n } \{S_n\} and the stopping time T T we conclude that, E S T = 0 \mathbb{E}S_{T}=0 i.e., a P ( S T = a ) b P ( S T = b ) = 0 a\mathbb{P}(S_T=a)-b\mathbb{P}(S_T=-b)=0 Hence, P ( S T = a ) = b a + b , P ( S T = b ) = a a + b \mathbb{P}(S_T=a)=\frac{b}{a+b}, \mathbb{P}(S_T=-b)=\frac{a}{a+b} Finally, we check that the sequence of random variables { Z n } , n 1 \{Z_n\}, n\geq 1 , where Z n = S n 2 n Z_n=S_n^2-n is also a zero-mean martingale. Hence using the Optional Stopping Theorem on { Z n } \{Z_n\} with the stopping time T T , we conclude that E Z T = 0 , i.e. E ( S T 2 T ) = 0 \mathbb{E}Z_T=0, \text{i.e. }\mathbb{E}\big(S_T^2-T\big)=0 . Hence, E ( T ) = E ( S T 2 ) = a 2 b a + b + ( b ) 2 a a + b = a b \mathbb{E}(T)=\mathbb{E}(S_T^2)=a^2\frac{b}{a+b}+(-b)^2\frac{a}{a+b}=ab Hence the expected number of games that the gambler plays is 5000 × 2000 = 10 , 000 , 000 5000\times 2000=10,000,000 .

An interesting and informative analysis, Abhishek. I admit I 'cheated' a bit in answering this question. I used the Gambler's Ruin formula C N ( n ) = n ( N n ) C_{N}(n) = n(N - n) for the expected number of plays before a player reaches $ N N or goes broke, given an initial fortune of $ n n , and just reset a loss of $ 2000 2000 as the 'going broke' threshold. (This formula assumes an equal probability of either winning or losing $ 1 1 per play.) Thus, in effect, the initial starting amount is $ 2000 2000 and the 'win and quit' threshold is $ 7000 7000 , giving us

C 7000 ( 2000 ) = 2000 ( 7000 2000 ) = 10 , 000 , 000 C_{7000}(2000) = 2000*(7000 - 2000) = 10,000,000 .

Brian Charlesworth - 6 years, 6 months ago

Log in to reply

I used the formula ( n k ) × p k × ( 1 p ) n k {n\choose k} \times p^k\times (1-p)^{n-k} to answer the question.

We let x x be our expected number of steps. If the probability of winning and losing is the same, then the gambler will most likely reach -$2000 first, so we'll use this number in our calculation. In our formula, we have n = x n=x , k = x 2 + 2000 k=\frac{x}{2}+2000 , and p = 1 2 p=\frac{1}{2} . Finally this probability formula should equal 1 x \frac{1}{x} because the expected number of steps for a geometric progression of probability P P is 1 P \frac{1}{P} , 1 P = x P = 1 x \frac{1}{P}=x \Longrightarrow P=\frac{1}{x}

1 x = ( x x 2 + 2000 ) × ( 1 2 ) x 2 + 2000 × ( 1 2 ) x ( x 2 + 2000 ) = ( x x 2 + 2000 ) × ( 1 2 ) x \frac{1}{x}={x\choose \frac{x}{2}+2000} \times \Big(\frac{1}{2}\Big)^{\frac{x}{2}+2000}\times \Big(\frac{1}{2}\Big)^{x-(\frac{x}{2}+2000)}={x\choose \frac{x}{2}+2000} \times \Big(\frac{1}{2}\Big)^x

Solving this equation for x x yields x 1182428 x\approx 1182428 . What's wrong with this solution?

Garrett Clarke - 5 years, 11 months ago

An elementary way to solve this problem is to set up a system of recursive equations (similar to Dynamic Programming) as follows.

Let N ( a , b ) N(a,b) denote the expected time for the gambler to quit when his threshold is set at a a and b -b . Then after a single game, his gain will be either + 1 +1 or 1 -1 with equal probability. Since his future gains are independent of the past gains, we can think that he restarts from either of these points with thresholds set at ( a 1 , b + 1 ) (a-1,b+1) and ( a + 1 , b 1 ) (a+1,b-1) respectively. Thus we have, N ( a , b ) = 1 + 1 2 N ( a 1 , b + 1 ) + 1 2 N ( a + 1 , b 1 ) , a , b 0 N(a,b)=1+\frac{1}{2}N(a-1,b+1)+\frac{1}{2}N(a+1,b-1), \hspace{10pt}\forall a,b \geq 0 with the boundary conditions, N ( m , 0 ) = N ( 0 , m ) = 0 , m 0 N(m,0)=N(0,m)=0,\hspace{10pt} \forall m\geq 0 By substitution, it is easy to verify that N ( a , b ) = a b , a , b 0 N(a,b)=ab,\hspace{10pt}\forall a,b \geq 0 is a solution of the above system of linear equations. The hard part is to show that this is the unique solution of the above system. Perhaps one can use the fact that the resulting coefficient matrix is a Toeplitz matrix to prove the uniqueness of the solution. From symmetry we have the result that N ( m , n ) = N ( n , m ) , m , n 0 N(m,n)=N(n,m), \hspace{10pt}\forall m,n\geq 0 This might also help.

Abhishek Sinha - 6 years, 6 months ago

Log in to reply

I'm struggling to understand solutions to the Gambler's ruin problems and it's variants. Why do you add a 1 to 1/2 N(a-1, b+1) + 1/2 N(a+1, b-1) in the first step? What does the m term represent? And what/where are you substituting to verify that N(a,b) = ab?

Juan Eiros - 4 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...