# Modified gambler's ruin problem: quit when going bankruptcy or losing $k$ dollars in all

In each round, the gambler either wins and earns 1 dollar, or loses 1 dollar. The winning probability in each round is $p<1/2$. The gambler initially has $a$ dollars. He quits the game when he has no money, or he has lost $k>a$ rounds in all by this time, no matter how many rounds he wins. (For example, if $a=2$, $k=3$, and the sequence is +1,+1,+1,-1,+1,-1,-1, he quits now.) What is his expected exit time?

What confuses me is the dependence between these two events. I know the generating function of the exit time in the standard gambler's ruin problem, and the duration until the gambler loses $k$ dollars in all is a negative binomial random variable. But these two stopping times are dependent. I was wondering if anyone could give me some hint. Thanks a lot!

Update: From Ross Millikan's hint: how to calculate the probability that the wealth is $b$ at the end of round $2k-a$, given that the game is not over?

• Welcome to math stack exchange! What does "losing k dollars in all" mean ? I guess, there is a period in which the player loses $k$ dollars. Jun 29, 2016 at 20:02
• @Peter Thanks! The gambler quits when he loses $k$ rounds, even if he wins a lot. Jun 29, 2016 at 20:05
• Just to clarify completely : He quits after $k$ consecutive losses ? Jun 29, 2016 at 20:12
• @Peter cumulative. For example, $a=2$, $k=3$, and if the sequence is +1,+1,+1,-1,+1,-1,-1, he quits now. Thank you! Jun 29, 2016 at 20:15

For the loss of $k$ to kick in, he needs to win $k-a$ times. If he does that, he will never go broke (except maybe on the round he would quit because of the $k$ losses). He needs to win those $k-a$ within the first $2k-a$ games. So compute the chance he goes broke in less than $2k-a$ games and the expected length of a game in that scenario. This gives you the chance he invokes the $k$ losses. Now compute the expected length of a game given that he wins at least $k-a$ in the first $2k-a$
• Thanks@Ross Millikan. The idea is the player cannot quit because of loss of $k$ in the first $2k-a$ rounds. But how to compute the expected length of a game given that he wins at least $k−a$ in the first $2k−a$ rounds? Thank you! Jun 29, 2016 at 23:48
• Winning at least $k−a$ in the first $2k−a$ cannot guarantee that the player is still in at the end of the $k-a$-th round. Jun 30, 2016 at 14:44