[Math] Calculating the probability to win with martingale in roulette

probability

I've made a python program that uses martingale betting method to see what the probability is to double your starting pot and then stop at European roulette (no double 00). The program works like this, You got $100$ dollars in the beginning and the starting bet is $1$ dollar. The program always bet on red and if it wins it will bet $1$ dollar again. If it loses it will double the initial bet. $1,2,4,8$ etc until it either goes bankrupt or wins. I've made the program do this a million times and then divide the times it doubled it's money by a million and i got $0.304063$.

My question is how would I calculate this value without having to use the program?

The probability of getting red is $\frac{18}{37}$.
You play until you have either won $100$ dollars or lost everything.

Best Answer

If you have from $100$ to $126$ dollars you can bet up to $6$ times in your martingale system, while if you have from $127$ to $199$ dollars you can bet up to $7$ times, since $1+2+2^2+\cdots+2^6=2^7-1=127$.

The probability of not losing $n$ times in a row is $1-\left(1-\dfrac{18}{37}\right)^n$. So the probability of progressing from $100$ dollars to $200$ dollars is $$ \left(1-\left(1-\dfrac{18}{37}\right)^6\right)^{27} \left(1-\left(1-\dfrac{18}{37}\right)^7\right)^{73} \approx 0.3041318$$ which is what your Python program predicted.

Note that if your system fails, you will usually still end up with a positive amount (unless you lose seven times in a row starting with $127$ dollars): for example if you start at $100$ dollars and immediately lose six times you will end up with $37$ dollars when your system requires you to bet $64$ so you have to give up. If your system fails then your expected final amount is about $41.468$ dollars. So, after taking account of the possibility of reaching $200$ dollars, your expected overall finishing amount is about $89.683$ dollars.