Martingale: math review and calculations
Winner for sure! but at what cost ?!
A martingale is a betting strategy in games of chance. The objective is to adapt one's behavior (one's bets) according to previous results.
In theory , a martingale ensures a sure win in a game of chance. In theory only, because practice turns out to be less utopian. This is precisely what we are going to see on this page.
In theory , a martingale ensures a sure win in a game of chance. In theory only, because practice turns out to be less utopian. This is precisely what we are going to see on this page.
Classic martingale
Let's take a game of chance, for which we have a probability of winning p with the rule: when we actually win we double our stake whereas in the event of a loss, we simply lose our stake.The bet is, by definition, risky. We can think of a coin toss with p = 1/2 = 50%, or roulette in a casino with p = 18/37, or any other game of chance.
The classic martingale, the best known, is the following strategy.
We initially bet 1 euro.
- If we win, we are happy and we stop with our gain of 2 euros, or 1 euro net (2 euros less the 1 euro stake). The martingale is over, and we can start again.
- If we lose, we play again, betting this time 2 euros.
- If we win this 2nd game we therefore earn 4 euros, or 1 euro net (4 euros less the stakes from the 1st and 2nd games, 1 euro and 2 euros). We then stop with our gain, the martingale is over and we can start again at the beginning if we wish.
- If we lose, we bet again, this time betting 4 euros.
- If we win, …
Expected value for the martingale
The expectation is then calculated according to:
E
=
1×p + 1×(1−p)p + 1(1−p)^{2}p + …
=
p
^{+∞}
∑
_{k=0}
(1−p)^{k}
We recognize here the geometric series, convergent for |x|<1,
S(x) =
^{+∞}
∑
_{k=0}
x^{k}
=
11 − x
So we find the expected value
E
= pS(1−p)
= p11 − (1−p)
= p1p
= 1
and we calculate and clearly demonstrate the obvious result from the beginning: with this martingale, this strategy, we definitely earn 1 euro.
We earn 1 euro every time, IF we are ready to never stop the martingale: this means in particular that we have infinite capital to bet.
Imaginons qu'on ait au contraire un capital fini, et qu'on sache donc dès le début qu'on ne pourra pas miser plus que ce capital. Que devient l'espérance ?
Expected value for the truncated martingale
Let's say for example, to begin with, that we have capital of 10 euros. With a starting bet of 1 euro, you cannot lose more than 3 times consecutively, i.e. the loss of 1+2+4 = 7 euros, and this happens with probability p = 12^{3} = 18 In all other cases, we earn 1 euro as we saw before.We therefore have the law of probability, with a capital limited to 10 euros:
Gain | 1 | −7 |
Probabilité | 7/8 | 1/8 |
E = 1×7/8 + (−7)×1/8 = 0
and the expected value is therefore the same with the martingale or by simply playing the game once.
Well, limiting yourself to 3 games in the martingale may be a little too limited. After all, the probability of losing decreases rapidly with the number of games in the martingale. And if our starting capital allowed us to bet for at least 10 successive games, or 100 games, wouldn't the math expectation be closer to 1 euro which is the expectation of the infinite martingale?
Here we go, let's calculate.
Let n therefore be the number of games on which one can bet successively in the martingale. The probability of losing (which decreases with the number n of games) is then
p = 12^{n}
while you can win 1 euro either in the 1st game with the probability 12 or to the 2nd with the probability 12^{2}, or to the 3rd,…, up to the n−th with the probability 12^{n}.
In summary, my probability of winning 1 euro before n games is therefore the geometric sum
p_{n}
=
^{n}
∑
_{k=1}
12^{k}
=
12
^{n−1}
∑
_{k=0}
12^{k}
=
12×
1 − 12^{n}
1 − 12
=
1 − 12^{n}
and we therefore have the law of probability, limiting to n successive losses
Gain | 1 | −2^{n}+1 |
Probabilité | 1 − 12^{n} | 12^{n} |
E_{n}
=
1×1 − 12^{n}
+ (−2^{n}+1)×12^{n}
=
1 − 12^{n}
+ −1 + 12^{n}
=
0
Ultimately therefore, if we know from the start that we will not be able to continue the martingale indefinitely, the average gain will be the same, over a large number of games, by playing at random each time, or by implementing a strategy of martingale: the martingale does not change expectation!.
This result is not necessarily intuitive, since a martingale is constructed to lead to a sure gain (expectation equal to 1) and we therefore have the impression that by increasing the number of successive games the expectation will also increase to get closer to 1. This is false, and we have just demonstrated in mathematical terms that the expectation E_{n} for a martingale limited to n games verifies the properties:
∀ n∈N , E_{n} = 0
and
^{ }lim_{n+∞} E_{n} = 1
This last result shows that, even more than non-intuitive, this result is even false… It is mathematically impossible for a constant sequence equal to 0 to tend towards 1…
Back to the expectation of the infinite martingale
The calculation of the for the infinite, untruncated martingale was in fact incorrect. We take it again here. To calculate the expectation of the infinite martingale, it is necessary to mathematically calculate the expression of the expectation E_{n} then make n tend towards infinity.With the previous probability tree, we have for n where the loss in the event of n consecutive defeats is −2^{n}+1
E_{n} =
12
+ 12^{2}
+ …
+ 12^{n−1}
+ 12^{n}×(−2^{n}+1)
The first part is again the sum of the terms of a geometric sequence of ratio 1/2, and we then find, as in the preceding calculation of expectation, that for any integer n
E_{n} = 0
which ends up showing how counter-intuitive this is: even if in the martingale we "must end up winning", inevitably, at some point, the expectation remains zero: the martingale brings nothing compared to the fact of playing several times independently at this game.
Back to the expected value of the infinite non-equiprobable martingale
The calculation in the previous paragraph corrects the calculation of the expectation for the infinite and equiprobable martingale, that is to say where the probability of winning, and losing, in each round is p =1/2.What about with any probability 0<p<1.
Here too, by resuming the calculation of the expectation E_{n}, with the probability tree, we calculate this time that
E_{n} =
p
+ p(1−p)
+ p(1−p)^{2}
+ …
+ p(1−p)^{n−1}
+ (1−p)^{n}(−2^{n}+1)
where we find again the sum of the first terms of a geometric sequence of common ratio (1−p):
E_{n} =
p
1−(1−p)^{n}1−(1−p)
+ (1−p)^{n}(−2^{n}+1)
either
E_{n} =
1−(1−p)^{n}
+ (1−p)^{n}(−2^{n}+1)
or, by expanding the last parenthesis and simplifying,
E_{n} =
1−[2(1−p)]^{n}
and so,
- if p>1/2 ⇔ 2(1−p)<1 and then the expectation tends towards 1
- if p<1/2 ⇔ 2(1−p)>1 then the expectation is negative and tends towards −∞
- if p=1/2 then the expectation is unconditionally zero, as we have seen in detail previously
Interpretation of expectation and interest, or no, of a martingale
By betting on this game n times: bet of 1 euro and probability p of winning 2 euros and the rest of losing your bet, and always the same bet of 1 euro, without any strategy, the number of successes over the n games is in average E = np (expectation for a binomial law with parameters n and p precisely).Thus, we expect to win the net gain, over n games:
G = 2np − n = 2np − 12
This result is compared to the expectation calculated in the previous paragraph with a martingale.
- if p>1/2 then the expectation for the martingale is strictly positive, less than 1, and tends towards 1 when the number of consecutive losses increases.
On another side; without martingale, the previous calculation of the gain clearly shows that the expectation is already positive, and even, moreover, greater.
There is therefore no need for a martingale, which is even counterproductive. - if p<1/2 then at each bet the game is unfavorable to the bettor who will therefore lose on average, with or without martingale: the expectation in both cases is negative, and tends towards −&infty with when the number n of repetition increases, in the martingale or not.
But, in fact, what is the idea of betting on an unfavorable game of chance?? (this is the case of roulette in casinos for example, with p = 1837) - if p=1/2 then the expectation is unconditionally zero with or without martingale. What is the point of a martingale then?
In case the previous calculations are not yet sufficiently convincing, "we know that in general" what limits the use of martingales is the risk taken of a black series: a chain of losses, which although in theory necessarily ultimately compensate by the very mechanism of the martingale (do you still believe in it after the previous calculations?), requires having the necessary funds to be able to continue the martingale to the end.
Let's now focus, no longer on the winnings, but on the bets that we will have to invest on average. These are directly related to the number of games. More precisely, in the n−th game you must bet 2^{n} euros.
It remains to know how many games we should expect to play before winning, that is to say also the stake we should prepare to invest.
Average number of games and stake invested
This involves counting the number of games played, on average, before winning and therefore stopping.If we denote X as the random variable equal to the stop rank, that is to say the rank of the first success, we then have the probability law
stop rank X = i | 1 | 2 | 3 | … |
Probability P(X=i) | p | p(1−p) | p(1−p)^{2} | … |
E(X)
=
1×p + 2×(1−p)p + 3(1−p)^{2}p + …
=
^{+∞}
∑
_{k=1}
kp(1−p)^{k−1}
The random variable X thus defined and used follows the geometric probability law with parameter p. As such, we know that his expectated value is
E(X) = 1p
This expected value represents the average number of games played before winning.
Now, in the k−th game we bet 2^{k−1} euros, and therefore, if we win in the n−th game , we will have bet in total on the n successive games
M_{n} = 1 + 2 + 2^{2} + … + 2^{n−1}
which is again a geometric sum equal to
M_{n} = 1 − 2^{n}1 − 2
= 2^{n} − 1
It is this bet, for n = E(X) = 1p, which quickly becomes dizzying and can render this martingale unusable in practice.
Let's see this with some numerical values.
Numerical applications
There is only one parameter here: the probability p of victory in each game.p = 1/2: case of equiprobability
For p=1/2, we have the expectation of the number of games played before the first success, therefore before winning our euro profit and stopping, which is
E(X) = 1p = 2
that is to say that we will win on average every two games.
You should expect to invest stakes of on average
M = 2^{E(X)}−1 = 3
or 3 euros, it's playable.
p = 110: unfavorable case
Likewise, the expectation of the number of games played before the first success, therefore before earning our euro of winnings and stopping, which is
E(X) = 1p = 10
that is to say that we will win on average every 10 games.
You should expect to invest stakes of on average
M = 2^{E(X)}−1 = 1023
i.e. 1023 euros, that is to say also 1023 times the starting stake of 1 euro, and therefore also 1023 times the gain obtained (which is still as safe, of course, but for an amount of only one euro).
p = 120: very unfavorable case
The expectation of the number of games played increases further (logical since we win more rarely) before the first success, and is
E(X) = 1p = 20
that is to say that we will win on average every 20 games.
You should expect to invest stakes of on average
M = 2^{E(X)}−1 ≃ 10^{6}
or around 1 million euros…
The stake to be invested increases considerably with each lost game, and even if you are sure to compensate for it at one point or another, you must be able to afford it!
We also focused on the expectation, but the probability of having a number of consecutive losing draws which exceeds this is not negligible.
Probability of significantly exceeding the expected average
We recall that for a geometric law with parameter p and with q = 1 − p the probability of failure, we have the probabilityP(X > k) = q^{k}
For example, for p = 1/2, we saw that, on average, we expect to play 2 games before winning. It's playable, the investment is low.
On the other hand, in this same case, we have for example
P(X > 6) = 0,5^{6} ≃ 0,016
i.e. approximately 1.6% chance (negligible?) of having to make at least 7 successive draws to win, and therefore 1.6% chance of having to invest the stake
M = 2^{7} − 1 = 127
i.e. 127 times the initial stake and 127 times the winnings…
With a slightly more risky game, for p = 1/4 for example, the expectation is
E(X) = 1p = 4
and the average stake to invest
M = 2^{E(X)}−1 ≃ 15
or around 15 euros… it's 15 times the initial stake, but playable (?).
On the other hand, the probability, for example, of having at least 12 draws before winning is
P(X > 11) = 0,75^{11} ≃ 0,04
or around 4% chance (negligible?)
In this case, the stake to invest is
M = 2^{12} − 1 = 4095
i.e. more than 4000 times the initial stake and therefore also 4000 times the winnings… The profitability is more than questionable!
Conclusion
This martingale, like many others, is therefore clearly effective in theory: a sure gain guaranteed.On the other hand, in practice, the stakes to be invested quickly become dizzying and make its use illusory: it would require having an infinite sum to invest, which is of course not the case for a real human player.
We have studied martingales for games of pure chance here, and the conclusion is now obvious: this strategy should not be used.
What about games that aren't just about pure chance? There, adding information about possible outcomes can turn martingales into an effective strategy. See for example the martingale on a loser or the martingale on draws.