The Monty Hall Problem (as seen on Survivor)

T
Deshawn from Survivor 41, the first player (hopefully the last) to ever participate in the “Do or Die” twist

In season 41 of Survivor, there were a lot (and I mean A LOT) of new twists introduced into the game. One twist that sparked a lot of conversation, analysis, and mathematical breakdown was something called the “Do or Die” twist.

The twist worked as follows.

At the start of an immunity challenge, the host, Jeff Probst, told all players that they could participate in the challenge or sit out. However, the first player to lose the challenge would have to participate in a game of chance at tribal council. If the player loses the game of chance, they are immediately eliminated from the game. If they win, then they sit out of the vote and can’t be eliminated this round.

Deshawn Radden chose to play in the immunity challenge and was the first player out. Deshawn knew he’d have to play a game of chance, but what he didn’t know was that the game of chance would be a classic puzzle known as the Monty Hall Problem.

What is the Monty Hall Problem?

The Monty Hall Problem was originally posed and solved by an American statistician named Steve Selvin, but is famous because of the game show Let’s Make a Deal, originally hosted by Monty Hall. In Let’s Make a Deal, the final stage of the show used a version of this problem.

In the version presented on Survivor, Deshawn was shown three boxes and was told he’d need to select one. Within two boxes there was a skull symbol, meaning he’s eliminated from the game. Within the other box, there was a fire symbol, meaning he’s safe.

After Deshawn’s box selection, without revealing what’s contained in the selected box, Jeff showed what’s contained within one of the other two boxes. Then, Jeff asked Deshawn if he wants to swap his original box with the final box that wasn’t selected and wasn’t revealed.

Most people’s gut reaction to this scenario is to think that Deshawn has a 1/3rd or 33.3% chance of staying in the game. However, the non-obvious reality is, if Deshawn swaps, then he has 66.7% chance of being safe and if he sticks with his original selection, he only has a 33.3% chance of being safe.

So why is that?

Understanding the swap probability

Let’s start with Deshawn’s options at the beginning of the game.

For his first selection, he has a 2/3rd or 66.7% chance of picking a losing box and 1/3rd chance of picking the safety box. If the game ends here, then he truly does only have a 33.3% chance of being safe.

However, in the next phase of the game, Jeff reveals the contents of one box. Jeff’s always going to reveal a losing box. Since Deshawn has a 2/3rd chance of picking a losing box during the first phase of the game, he most likely has a losing box already in his possession. Assuming that’s the case, then the final unrevealed box must have a 2/3rd chance of being the safety box. As long as he swaps, he improves his odds from 1/3rd during the first selection to 2/3rds post swap.

If that explanation is difficult to follow, take a look at the tables below where I’ve enumerated all possible permutations of box contents and possible box selections.

In the first table, I’m assuming Deshawn picks Box #`1, which was the case on the show. In this scenario, there’s only one out of three situations where he’s safe if he doesn’t swap. This happened to be what played out on the show, but statistically speaking, he should always swap.

Box #1Box #2Box #3Result of stayingResult of swap
FireSkullSkullSafeEliminated
SkullFireSkullEliminatedSafe
SkullSkullFireEliminatedSafe
All permutations of results assuming Deshawn picks Box #1
Box #1Box #2Box #3Result of stayingResult of swap
FireSkullSkullEliminatedSafe
SkullFireSkullSafeEliminated
SkullSkullFireEliminatedSafe
All permutations of results assuming Deshawn picks Box #2
Box #1Box #2Box #3Result of stayingResult of swap
FireSkullSkullEliminatedSafe
SkullFireSkullEliminatedSafe
SkullSkullFireSafeEliminated
All permutations of results assuming Deshawn picks Box #3

Monty Hall Simulator

Now that we’ve covered the mathematical explanation, let’s take a look at demonstrating the swap probability through a simulation.

I wrote a Python script to simulate different versions of the game. Based on the outcome of a digital coin flip, the player swaps their original selection with the final box. The win statistics for both swapping and not swapping are tracked and printed after running through N rounds. In my script, I use goats to represent the losing state and a car to representing the desired winning state.

In my experiments with the script, executing 10,000 rounds per test, as expected, I generally see a win percentage of 65 to 67% if the player swaps. Grab the full source here.

import random
import sys

# simulator constants
HEADS = 0
WIN_STATE = 'car'
LOSE_STATE = 'goat'

def main():
  # default setting for number of rounds
  num_of_rounds = 10000

  if len(sys.argv) > 1:
    num_of_rounds = int(sys.argv[1])

  # dictionary to keep track of overall stats through simulation
  swap_stats = { 'total': 0, 'wins': 0}
  no_swap_stats = { 'total': 0, 'wins': 0}

  for i in range(num_of_rounds):
    # initialize lists representings doors and state of doors
    doors = [WIN_STATE, LOSE_STATE, LOSE_STATE]
    door_open_state = [False, False, False]

    # randomly configure the doors
    random.shuffle(doors)

    # player picks a random door
    selected_door = random.randint(0, 2)
    door_open_state[selected_door] = True

    # a door containing a goat is revealed
    revealed_door = get_revealed_door(door_open_state, doors)
    door_open_state[revealed_door] = True

    coin_flip = random.randint(0, 1)

    # swap doors if coin flip is heads
    if coin_flip == HEADS:
      selected_door = get_swapped_door(door_open_state, doors)
      print('Player swapped doors')
      update_stats(swap_stats, doors[selected_door])
    else:
      print('Player didn\'t swap')
      update_stats(no_swap_stats, doors[selected_door])

  print('\nALWAYS SWAP RESULT:')
  print_results(swap_stats)
  print('\nNEVER SWAP RESULT:')
  print_results(no_swap_stats)

def update_stats(stats, selected_state):
  stats['total'] += 1

  if selected_state == WIN_STATE:
    print('Player won a car')
    stats['wins'] += 1
  else:
    print('Player lost')

def print_results(stats):
  if stats['total'] > 0:
    probability_of_wins = stats['wins'] / stats['total']

    print(f'Probability of winning a car: {probability_of_wins:.4f}')
  else:
    print('No stats found, so probability could not be calculated.')
    print('Trying increasing the number of simulated rounds.')

def get_revealed_door(door_open_state, doors):
  for i in range(len(doors)):
    if door_open_state[i] == False and doors[i] == LOSE_STATE:
      return i

  return False

def get_swapped_door(door_open_state, doors):
  for i in range(len(doors)):
    if door_open_state[i] == False:
      return i

  return False

if __name__ == '__main__':
  main()

Final thoughts

I hope you enjoyed this deep dive into The Monty Hall/Do or Die problem. Also, if you’re an aspiring Survivor player, hopefully understanding why the strategy for always swapping works will improve your odds of making it through a future tribal council.

About the author

Sean Falconer
By Sean Falconer

Sean Falconer

Get in touch

I write about programming, developer relations, technology, startup life, occasionally Survivor, and really anything that interests me.