Playing the St. Petersburg Lottery until I lose everything

This question continues the following question: Calculating the probability of winning at least $128$ dollars in a lottery St. Petersburg Paradox

Here is a lottery: A fair coin is flipped repeatedly until it produces "heads." If the first occurrence of heads is on the $n$th toss, you are paid $2^{n−1}$. So for instance, if heads appears on the first toss, you are paid 1 dollar; if heads appears for the first time on the second toss, you are paid 2 dollars, and so on.

Say the cost of entering the lottery is 10 dollars and I start with 100 dollars. I'll play the lottery again and again until I have more than 10 dollars to play the game.

Now my question is, what is the probability that I can go on playing the game?

Example: Say during the first game, I get a heads on the first toss then I'll be left with 91(=100-10+1) dollars. I'll play the game again by paying 10 dollars and this time I may get a heads on the 7 toss and now I'll have 145(=91-10+64) dollars and so on.

Edit: Or Is it possible to find the probability of surviving the nth round given that I have survived all the previous rounds??


I do not see an easy approach, so I tried a simulation in R using the following code, which sees whether you lose in the first million games, repeated $100000$ times:

set.seed(2015)
subgames   <- 10
supergames <- 100000 # maximum games is supergames*subgames
cases      <- 100000 
gain     <- function(x, y=10){ ifelse(y<10, y, y + 2^-ceiling(log(x,2)) -10) }
position <- matrix(rep(NA,(subgames+1) * cases), nrow=cases)
position[, 1] <- 100 # start with 100
for (r in 1:supergames){
    subcases <- nrow(position)
    udata <- matrix( runif(subgames * subcases ), nrow=subcases )
    for (n in 1:subgames ){ position[, n+1] <- gain(udata[,n], position[,n]) } 
    position[, 1] <- position[, subgames+1]     # ready to restart 
    position <- position[position[,1] >= 10, ] # remove lost games
    }
nrow(position)/cases

It produced the result 0.00021, suggesting that the simulation lost $99979$ times but failed to lose $21$ times. Of those $21$ cases, after a million games the surviving bankrolls were in the range $68183$ to $17492689$ in this particular simulation, so there was a net average gain.

Obviously there is uncertainty associated with any simulation and there may be further losses as the number of games increases further, but this suggests the probability of not losing overall is extremely small. About $82\%$ of losses seemed to have happened in the first twenty games and about $97\%$ of losses in the first hundred games, so the unbounded potential gains do not often offset the price of playing repeated games.


Let $P_n$ be the probability of losing (not indefinitely having enough money to play) if you start with $n$ dollars. Now, we can observe that the probabilities don't change after one step, except it's now distributed over the possible values of $n$. As such, we can express that, for $n\geq 10$, $$ P_n = \frac{P_{n-9}}2 + \frac{P_{n-8}}4 + \frac{P_{n-6}}8 + \cdots + \frac{P_{n-10+2^k}}{2^{k+1}} + \cdots $$ which states our requirement that the limit to infinity doesn't change. We also have that $P_n=1$ for $n<10$.

Investigations of this system using Octave, by constructing the matrix system for this, while taking $P_n=0$ for $n>n_{max}$ (this creates an $(n_{max}-9)\times(n_{max}-9)$ matrix system), produce an interesting result:

As we increase $n_{max}$, $P_n$ gets larger for each $n$... in a way that suggests that they are tending to 1. That is, it is looking as though, for any finite $n$, the final result will actually be $P_n=1$, meaning that, given enough time, the player will run out of money at some point. For instance, for $n_{max}=5009$, we get $P_{100}\approx 0.9960939$. For $n_{max}=10009$, we get $P_{100}\approx 0.9977098$. Here are the probability curves that result for $n_{max}$ = 2509, 5009, and 10009 (note: x coordinate is shifted by 9, so the first curve runs from 1 to 2500 rather than 10 to 2509):

Probabilities P_n

Note that these effectively show the probability of losing if the player has $n$ dollars at the start and the house has $n_{max}-n$ dollars that they can give - that is, if the player wins enough to reach $n_{max}$, then they have cleaned out the house's bank, and have "won", while if the player drops below 10 dollars, they have "lost". Reminder: the $P_n$ shown in the graph shows the probability of losing.