Is Playing Roulette with The Martingale Betting Strategy a Good Idea?
If there is one thing we all know about casinos is that the house always wins. However, this doesn’t stop many from trying to outsmart the system. In this article, we will for one and for all determine whether or not playing the roulette with the martingale betting strategy is a good idea.
SPOILERS ALERT: It isn’t.
How to Play:
In a standard American casino, a roulette wheel consists of 38 numbered pockets in total: 18 red, 18 black, and 2 green. As the ball is whirling around the roulette wheel, the player has the option to bet on numbers (1 to 38), colors (red or black), or a combination of the two. For the purpose of this article, we will only consider wages based on the color of the pockets. For example, a player may chose to bet on its favorite color, let’s say red. For a single spin, the probability of winning will then be 18/38 since 18 out of the 38 pockets are red. Similarly, the probability of losing will be given by 20/38.
Without going in too much detail, let’s take a look at the following RStudio code which simulates a single spin in the roulette wheel:
single_spin <- function(){
possible_outcomes <- c(rep("red",18), rep("black",18), rep("green",2))
sample(possible_outcomes, 1)
}The “possible_outcomes” is a vector that stores the possible outcomes of a single spin while the “single_spin” function will randomly select an outcome from the “possible_outcomes” vector. That is, for single spin of the roulette game, winning or losing boils down to probability, or what many of us prefer to refer as simply luck. Taken this into account, could there really be a strategy that somehow maximizes the winnings and/or minimizes the losses? Well, the martingale Betting Strategy promises just that.
The Martingale Betting Strategy:
The game begins by the player betting one dollar on red.
The remaining bets are determined as follows:
- If the last outcome was red, then the player bets $1.
- If the last outcome was black, then the player bets twice the losses from the previous bet.
For example, if the starting bet is one dollar, and the outcome is black, we lose one dollar which leaves us with a net gain of negative one dollar. Now, our next bet is meant to recover the amount lost, and so we bet double the previous bet, which in this case is two dollars. If the outcome is red, then we win two dollars, for a net gain of one dollar. What makes The Martingale Betting Strategy so popular is the fact that this strategy is designed so that, no matter how unlucky a player is, the player will still be able to make a small profit as long at the last outcome was a winning outcome.
martingale_wager <- function(
previous_wager
, previous_outcome
, max_wager
, current_budget
){
if(previous_outcome == "red") return(1)
min(2*previous_wager, max_wager, current_budget)
}The function “martingale_wager” mimics the nature of the martingale betting strategy. Notice that this function takes as inputs the previous wager, the previous outcome, maximum wager allowed by the casino, and the current budget of the player. In our previous example, if we assume the player’s current budget and max wager is $100, then the command martingale_wager(1,“black”,100,100) would return 2, the amount the player should bet on the next round.
Key Parameters:
| Parameter | Explanation |
|---|---|
| starting_budget | Starting budget (the same goes for current_budget) |
| winning_threshold | Winning threshold for stopping given by starting budget plus profit |
| max_games | Maximum amount of games allowed by casino |
| max_wager | Maximum wager allowed by casino |
Now, we take a look at “one_play” and the “one_series” functions. While the “single_spin” and the “martingale_wager” serve as the building blocks of the martingale betting strategy, in order to asses whether or not this is a good strategy, we use the “one_play” and “one_series” functions to recreate a series of plays. To do this, we create a ledge where each row will symbolize a single play and each column will store information on the game index, starting budget, wager, outcome, and ending budget.
one_play <- function(previous_ledger_entry, max_wager){
# Create a copy of the input object that will become the output object
out <- previous_ledger_entry
out[1, "game_index"] <- previous_ledger_entry[1, "game_index"] + 1
out[1, "starting_budget"] <- previous_ledger_entry[1, "ending_budget"]
out[1, "wager"] <- martingale_wager(
previous_wager = previous_ledger_entry[1, "wager"]
, previous_outcome = previous_ledger_entry[1, "outcome"]
, max_wager = max_wager
, current_budget = out[1, "starting_budget"]
)
out[1, "outcome"] <- single_spin()
out[1, "ending_budget"] <- out[1, "starting_budget"] +
ifelse(out[1, "outcome"] == "red", +1, -1)*out[1, "wager"]
return(out)
}one_series <- function(
max_games, starting_budget, winning_threshold, max_wager
){
# Initialize ledger
ledger <- data.frame(
game_index = 0:max_games
, starting_budget = NA_integer_
, wager = NA_integer_
, outcome = NA_character_
, ending_budget = NA_integer_
)
ledger[1, "wager"] <- 1
ledger[1, "outcome"] <- "red"
ledger[1, "ending_budget"] <- starting_budget
for(i in 2:nrow(ledger)){
#browser()
ledger[i,] <- one_play(ledger[i-1,], max_wager)
if(stopping_rule(ledger[i,], winning_threshold)) break
}
# Return non-empty portion of ledger
ledger[2:i, ]
}Stopping Rule:
In theory, a player could go on doubling after each previous loss forever, allowing them to accumulate small profits indefinitely. However, there are some limiting factors that have to be taken into account. For instance, the player might run out of money while doubling the previous loss, forcing them to stop the game. For these reason, let’s assume that the player will continue to play the roulette until one of the following stopping rules is satisfied:
- The player reached winning_threshold.
- The player goes bankrupt.
- The player reached max_games.
stopping_rule <- function(
ledger_entry
, winning_threshold
){
ending_budget <- ledger_entry[1, "ending_budget"]
if(ending_budget <= 0) return(TRUE)
if(ending_budget >= winning_threshold) return(TRUE)
FALSE
}The “stopping_rule” function will allow us to answer a very important question: What is the average number of plays before stopping? This can be easily calculated by using the “one_series” function. In the following chunk of code we calculate the average number of plays before stopping by replicating 10000 series of game plays and then taking the mean:
average_number_of_plays <- replicate(1000,nrow(one_series(1000,200,300,100)))%>% mean
print(average_number_of_plays)## [1] 199.753
In average, a player allowed to play up to 1000 games, with starting budget of 200 dollars, a winning threshold of 300 dollars, and a max wager of 100 dollars is expected to play around 202 games before stopping.
profit <- function(ledger){
n <- nrow(ledger)
profit <- ledger[n, "ending_budget"] - ledger[1, "starting_budget"]
return(profit)
}The “Profit” function now uses the ledger to calculate the profit on each play. By using this function we are able to calculate the average earnings a player should expect. The following graph gives insight into how much a player is expected to lose if the average number of games is 1000 games:
out <- data.frame(max_number_of_games = c(1,100,200,300,400,500,600,700,800,900,1000), expected_earnings = NA)
for(i in 1:nrow(out)){
out[i,"expected_earnings"] <- replicate(100,one_series(out[i,"max_number_of_games"],200,300,100)%>%profit)%>% mean}
plot(out)Now, notice the difference in the graphs once we change to maximum number of games to 100:
out1 <- data.frame(max_number_of_games = c(1,10,20,30,40,50,60,70,80,90,100), expected_earnings = NA)
for(i in 1:nrow(out1)){
out1[i,"expected_earnings"] <- replicate(100,one_series(out1[i,"max_number_of_games"],200,300,100)%>%profit)%>% mean}
plot(out1)As the maximum amount of games increases, a player is expected to lose more money on average.
Limitations of our model:
The simulation of the martingale betting strategy has various assumptions that are aimed to simplify the real world scenarios. One of the limitations is the use of the replicate function. In this case, the function generates 100 possible outcomes of games using the one_series function which allow us to calculate the average earnings. As the first argument of this function increases, the accuracy of our approximation for the average earnings increases. However, the running time of this function increases as the number of replications increases.
Also, the martingale_wager function is not taking into account when a player first bet is greater than one dollar. For instance, if the starting bet is 5 dollars, and the player loses 10 times in a row, we will have the following sequence of bet:
out2<-data.frame(n=seq(1:10),To_bet_next=c(10,20,40,80,160,320,640,1280,2560,5120))
head(out2,n=10)## n To_bet_next
## 1 1 10
## 2 2 20
## 3 3 40
## 4 4 80
## 5 5 160
## 6 6 320
## 7 7 640
## 8 8 1280
## 9 9 2560
## 10 10 5120
SO… Is it a good idea to use the Marginal Betting Strategy?:
The martingale betting strategy is praised by many, since it’s a pretty intuitive and straightforward strategy to follows. However, if what you seek by playing the roulette is to win big, then stay as far as you possible can from this strategy. While it’s true that the martingale strategy can improve your chances of making small profits in the short term, your chances of making a significant amount of profit may, in fact, be worse.
Again, let’s dissect a little bit more the nature of this strategy. Based on the rules of this strategy, the only way a player can guarantee a profit is to stop the game after a profitable win. Many would argue that it is a great strategy to use because a player doesn’t have to be the luckiest in order to make profit as long as the player walks away after a win. Well, if the player is indeed not the luckiest, a streak of black outcomes can easily lead to the player’s downfall. For example, imagine that the starting bet of a player is $1 and the outcome is black 10 times in a row:
n=c(1,2,3,4,5,6,7,8,9,10)
To_bet=2^n
out3<-data.frame(n,To_bet)
head(out3,n=10)## n To_bet
## 1 1 2
## 2 2 4
## 3 3 8
## 4 4 16
## 5 5 32
## 6 6 64
## 7 7 128
## 8 8 256
## 9 9 512
## 10 10 1024
plot(n,To_bet)By the 10th round, the player has to bet 1024 dollars if he or she wants to make a one dollar profit. Not to mention that
this is not taking into account the maximum amount a player can bet at a time. If a player has a losing streak, the next bets might be more than the maximum amount allowed to bet, which would make the system fall
the player might not have the money to afford the bet. If the player’s current budget is less than twice the previous bet, the player will be unable to afford the next bet and leave with a negative profit.
Let’s say assume that somehow the player manages to continue playing. If the outcome of the 11th round is also black, the player would leave the casino with a total loss of (2+4+8+16+32+64+128+256+512+1024)= 2,046 dollars. In general, playing the roulette with the Martingale Betting Strategy is a good idea only for those who just want to have fun and don’t mind losing money in the process.