Suppose we’re in Monaco (though not Monacan citizens) and itching for some roulette. We roll up to the Monte Carlo and bet $10 on black, but the ball stops on red. “No problem,” we think, “we just got unlucky.” We go to bet another $10, but pause for some quick math. We’re currently $10 in the hole; if we bet another $10, we’ll be down $20, and winning that bet will only bring us back to even. We realize that, in order to meet our original goal and leave the table $10 richer, we need to bet enough to recoup our losses, plus an extra $10, so instead we bet $20. Success! Congratulating ourselves on our brilliant strategy, we decide to spend the rest of the day milking it for all it’s worth, and by the evening we’re broke on the curb.

This sort of strategy is called a martingale, and it’s usually a bad idea, for a few reasons. For one, the Infinite Monkey theorem guarantees that, for any finite-size bankroll, we’ll eventually encounter a string of losses long enough that we can’t continue betting. For another, the size of our required bet grows at least exponentially in the number of consecutive losses, so the number of losses required to bankrupt us can be much lower than what one might expect. That said, the idea of the martingale has always kind of appealed to me (fortunately, I don’t live near Monaco), so I wanted to think about it a bit more quantitatively. Specifically, I wanted to know:

Given some level of risk tolerance and some betting strategy, how much profit can we make playing European roulette (which has slightly better odds than American), betting on black at 1:1 payout, using a martingale, assuming we don’t go bankrupt before hitting our risk threshold?

Let’s say we have N dollars in our bank account, and we adopt the following strategy. On the first spin, we bet some fraction f of our account size Nf. If we lose, we bet to recoup our losses, plus an additional Nf. We repeat this process until we win, in which case the bet resets to Nf, or run out of money.

I’ll make a couple of simplifying assumptions, namely:

we neglect the growth of N as we win

when the required bet size exceeds N, we lose everything

Our bet size after n losses is

bn=n−1∑i=0bi+Nf=Nf(2n+n).

We’d like to know the number of consecutive spins we can lose before going bankrupt nmax, so we set this equation equal to N and solve for n. Unfortunately, this doesn’t have a nice solution in terms of elementary functions, but we can lower bound 2n+n with 2n and upper bound it with 2n+1.

Solving for nmax then gives

nmax=floor(−logf2−1)+1

as a lower bound and

nmax=floor(−logf2)+1

as an upper bound, where the +1 comes from a switch from 0-indexing to 1-indexing. Let’s work with the upper bound for now. The probability of going broke each time we play the martingale (which I’ll call a ’’round”) is then

P(broke)=Pnmaxlose

where Plose is the probability of losing each spin, and for European roulette is .5135. Then the probability of going broke after $k$ rounds is

P(broke,k)=(1−Pnmaxlose)k.

We have a risk tolerance R; we want the probability of going bankrupt to remain below 1−R. We solve for k to find kmax, the number of rounds we can play while remaining below our risk threshold:

If we successfully make it through these kmax rounds, our winnings are

W=kmaxNf

and our winnings as a fraction of our initial bankroll are

WN=kmaxf=floor(lnRln(1−Pfloor(−log2f)lose)f.

Let’s take a look at this function. Our winnings increase as R increases; the higher the risk we can tolerate, the more we stand to win if we get lucky. The behavior in f is a little trickier to intuit, but we can make some sense of it. The denominator increases as f increases, so kmax goes down; the more we bet each spin, the fewer rounds we can play before hitting our risk threshold. On the other hand, the numerator increases linearly in f. Further complicating things is the embedded floor function, which will make the final overall function stepwise. Let’s plot it and see what it looks like:

Nice! We see more or less the expected behavior, with the upper left corner representing betting everything on a single spin, and the upper right corner empty (there’s no way to e.g. bet 80% of your bankroll each spin and still keep your probability of winning above 90%). The lower left hand corner shows some interesting behavior; at first glance, it looks like we can win over 1.3 times our bankroll by betting about 3% per spin. Unfortunately, it’s easy to see that this can’t be right; in this case, our expected profit would be

E[profit]≈(1.3)N(.4865)−.5135N=.119N>0

and there’s no way to make money in expectation by playing a game with losing odds. In reality, this is a result of taking the upper bound mentioned earlier. Looking instead at the lower bound

it’s clear that the martingale can’t do better than betting it all on black if we’re willing to accept a 51% chance of losing, and has negative expectation value everywhere. As rationalists, we don’t want to be playing negative expectation value games, so I suppose it’s time to give up on the martingale…

unless we jack up the probabilities by enough orders of magnitude that we can mumble something about Pascal’s Mugging and go back to spinning that wheel! So let’s do just that.

Suppose we’re Elon Musk and have ∼1011 dollars. We incur about a 1 in 107 risk of death every time we hop on our jet, so we reason that we’re willing to risk our fortune at those odds. How much money can we make using the martingale with these parameters? We can’t solve the WN equation for f, but we can fix N and R and plot our winnings:

By betting about 3e-8 of our fortune each round, we can make between ~$4500 and $9000 (taking the lower and upper bound, respectively) while staying below a 1 in 107 risk of going broke! That covers about half of a first class flight from Austin to Monaco. Even worse, at that betting rate we can only play the martingale once before hitting our risk threshold, so we don’t even get to enjoy the free drinks. Better stake our billions elsewhere.

## On martingales

Suppose we’re in Monaco (though not Monacan citizens) and itching for some roulette. We roll up to the Monte Carlo and bet $10 on black, but the ball stops on red. “No problem,” we think, “we just got unlucky.” We go to bet another $10, but pause for some quick math. We’re currently $10 in the hole; if we bet another $10, we’ll be down $20, and winning that bet will only bring us back to even. We realize that, in order to meet our original goal and leave the table $10 richer, we need to bet enough to recoup our losses, plus an extra $10, so instead we bet $20. Success! Congratulating ourselves on our brilliant strategy, we decide to spend the rest of the day milking it for all it’s worth, and by the evening we’re broke on the curb.

This sort of strategy is called a martingale, and it’s usually a bad idea, for a few reasons. For one, the Infinite Monkey theorem guarantees that, for any finite-size bankroll, we’ll eventually encounter a string of losses long enough that we can’t continue betting. For another, the size of our required bet grows at least exponentially in the number of consecutive losses, so the number of losses required to bankrupt us can be much lower than what one might expect. That said, the idea of the martingale has always kind of appealed to me (fortunately, I don’t live near Monaco), so I wanted to think about it a bit more quantitatively. Specifically, I wanted to know:

Given some level of risk tolerance and some betting strategy, how much profit can we make playing European roulette (which has slightly better odds than American), betting on black at 1:1 payout, using a martingale, assuming we don’t go bankrupt before hitting our risk threshold?Let’s say we have N dollars in our bank account, and we adopt the following strategy. On the first spin, we bet some fraction f of our account size Nf. If we lose, we bet to recoup our losses, plus an additional Nf. We repeat this process until we win, in which case the bet resets to Nf, or run out of money.

I’ll make a couple of simplifying assumptions, namely:

we neglect the growth of N as we win

when the required bet size exceeds N, we lose everything

Our bet size after n losses is

bn=n−1∑i=0bi+Nf=Nf(2n+n).We’d like to know the number of consecutive spins we can lose before going bankrupt nmax, so we set this equation equal to N and solve for n. Unfortunately, this doesn’t have a nice solution in terms of elementary functions, but we can lower bound 2n+n with 2n and upper bound it with 2n+1.

Solving for nmax then gives

nmax=floor(−logf2−1)+1as a lower bound and

nmax=floor(−logf2)+1as an upper bound, where the +1 comes from a switch from 0-indexing to 1-indexing. Let’s work with the upper bound for now. The probability of going broke each time we play the martingale (which I’ll call a ’’round”) is then

P(broke)=Pnmaxlosewhere Plose is the probability of losing each spin, and for European roulette is .5135. Then the probability of going broke after $k$ rounds is

P(broke,k)=(1−Pnmaxlose)k.We have a risk tolerance R; we want the probability of going bankrupt to remain below 1−R. We solve for k to find kmax, the number of rounds we can play while remaining below our risk threshold:

kmax=floor(log(1−Pnmaxlose)R)=floor(lnRln(1−Pnmaxlose)).

W=kmaxNfIf we successfully make it through these kmax rounds, our winnings are

and our winnings as a fraction of our initial bankroll are

WN=kmaxf=floor(lnRln(1−Pfloor(−log2f)lose)f.Let’s take a look at this function. Our winnings increase as R increases; the higher the risk we can tolerate, the more we stand to win if we get lucky. The behavior in f is a little trickier to intuit, but we can make some sense of it. The denominator increases as f increases, so kmax goes down; the more we bet each spin, the fewer rounds we can play before hitting our risk threshold. On the other hand, the numerator increases linearly in f. Further complicating things is the embedded floor function, which will make the final overall function stepwise. Let’s plot it and see what it looks like:

Nice! We see more or less the expected behavior, with the upper left corner representing betting everything on a single spin, and the upper right corner empty (there’s no way to e.g. bet 80% of your bankroll each spin and still keep your probability of winning above 90%). The lower left hand corner shows some interesting behavior; at first glance, it looks like we can win over 1.3 times our bankroll by betting about 3% per spin. Unfortunately, it’s easy to see that this can’t be right; in this case, our

E[profit]≈(1.3)N(.4865)−.5135N=.119N>0expectedprofit would beand there’s no way to make money in expectation by playing a game with losing odds. In reality, this is a result of taking the upper bound mentioned earlier. Looking instead at the lower bound

it’s clear that the martingale can’t do better than betting it all on black if we’re willing to accept a 51% chance of losing, and has negative expectation value everywhere. As rationalists, we don’t want to be playing negative expectation value games, so I suppose it’s time to give up on the martingale…

unless we jack up the probabilities by enough orders of magnitude that we can mumble something about Pascal’s Mugging and go back to spinning that wheel! So let’s do just that.

Suppose we’re Elon Musk and have ∼1011 dollars. We incur about a 1 in 107 risk of death every time we hop on our jet, so we reason that we’re willing to risk our fortune at those odds. How much money can we make using the martingale with these parameters? We can’t solve the WN equation for f, but we can fix N and R and plot our winnings:

By betting about 3e-8 of our fortune each round, we can make between ~$4500 and $9000 (taking the lower and upper bound, respectively) while staying below a 1 in 107 risk of going broke! That covers about half of a first class flight from Austin to Monaco. Even worse, at that betting rate we can only play the martingale once before hitting our risk threshold, so we don’t even get to enjoy the free drinks. Better stake our billions elsewhere.