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?