Monty Hall Dilemma Game Simulator

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

Bayes' Theorem

$$ P(H \mid E) = \frac{P(E \mid H) \cdot P(H)}{P(E)} $$

In Practice

Using Bayes’ Theorem, we update the probability of winning based on Monty’s actions. For a game with \(n\) doors:

Prior probabilities:

Since \(P(E \mid H_1)=P(E \mid H_2)=1\) and \(P(E)=1\),

\[ P(H_1 \mid E) = \frac{1\cdot\frac{1}{n}}{1} = \frac{1}{n} \] \[ P(H_2 \mid E) = \frac{1\cdot\frac{n-1}{n}}{1} = \frac{n-1}{n} \]


Win by staying: \(P(\text{win by staying}) = \frac{1}{n}\)
Win by switching: \(P(\text{win by switching}) = \frac{n-1}{n}\)

Simulator

Results



Simulation # 1st Choice Winning Door Outcome