How many times can you expect to play before you lose your bankroll in a Martingale bet system

probabilityrandom variablesstatistics

Suppose that you have 127 money units and you want to bet on Double-Zero Roulette using the Martingale system. You want to calculate the expected number of bet that you can do before loosing all your money.

What I have figure out until now is this:

The maximum number of bets you can lose in a row before losing your bankroll is 7.

  • Bet 1: Lose \$1, bankroll is now \$126
  • Bet 2: Lose \$2, bankroll is now \$124
  • Bet 3: Lose \$4, bankroll is now \$120
  • Bet 4: Lose \$8, bankroll is now \$112
  • Bet 5: Lose \$16, bankroll is now \$96
  • Bet 6: Lose \$32, bankroll is now \$64
  • Bet 7: Lose \$64, bankroll is now \$0

The probability of lose 7 bets in a row is $(\frac{20}{38})^7$. the total expected value for each application of the betting system is:

$$
E[X] = -127 \cdot \left(\frac{20}{38}\right)^7 + 1 \cdot \left(1 – \left(\frac{20}{38}\right)^7\right) = – 0.5232
$$

So, you're losing money and sooner or later you will run out of money using this questionable system. But I don't how to calculate the average number of times that you will bet before losing all.

What I know is -> you need to lose 7 bet in a row in order to lose all your money, this ring a bell for me and I tried to model it as a Geometric Random Variable, so the expected value should be:

$$
E[X] = \frac{1-p}{p} = 88.38
$$

Where $p$ is the probability of lose 7 in a row. But I have made a simulation in R and the result are not matching.


event <- replicate(10000 , {
  bankroll <- 127
  num_rounds <- 0
  nth_bet <- 0
  while (bankroll > 0) {
    num_rounds <- num_rounds + 1
    bet_result <- sample(x = c(0, 1), size = 1, prob = c(20/38, 18/38))
    if (bet_result == 0) {
      bankroll <- bankroll - 2^nth_bet
      nth_bet <- nth_bet + 1
    } else {
      bankroll <- 127
      nth_bet <- 0
    }
  }
  num_rounds
})

mean(event)

It should be around 185.6542 if my simulation is correct. So something is wrong, it could be that I'm using the wrong model (Geometric Random Variable), my simulation is wrong, or maybe both.

NOTE: I'm assuming that if you win one time, the amount of money reset with what you started. Otherwise I think it could be harder to calculate. On the simulation it's just change the following line:

bankroll <- bankroll + 2^nth_bet

Best Answer

We can model this as an absorbing Markov chain with transition matrix $$ P=\left( \begin{array}{cccccccc} \frac{9}{19} & \frac{10}{19} & 0 & 0 & 0 & 0 & 0 & 0 \\ \frac{9}{19} & 0 & \frac{10}{19} & 0 & 0 & 0 & 0 & 0 \\ \frac{9}{19} & 0 & 0 & \frac{10}{19} & 0 & 0 & 0 & 0 \\ \frac{9}{19} & 0 & 0 & 0 & \frac{10}{19} & 0 & 0 & 0 \\ \frac{9}{19} & 0 & 0 & 0 & 0 & \frac{10}{19} & 0 & 0 \\ \frac{9}{19} & 0 & 0 & 0 & 0 & 0 & \frac{10}{19} & 0 \\ \frac{9}{19} & 0 & 0 & 0 & 0 & 0 & 0 & \frac{10}{19} \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{array} \right). $$ Write $$ P=\begin{pmatrix}Q&R\\ \mathbf 0&I\end{pmatrix} $$ where $Q$ is the submatrix of $P$ corresponding to transitions between transient states and $R$ the submatrix of $P$ corresponding to transitions from transient states to the absorbing state. The expected number of steps to absorbtion is given by the first entry of $N\mathbf 1$ where $\mathbf 1$ is a column vector whose entries are identically $1$ and $$ N = \sum_{k=0}^\infty Q^k = (I-Q)^{-1}. $$ This quantity is $$ \frac{1865951449}{10000000}\approx186.595, $$ agreeing with your simulation.