Code tool

Monty Hall Simulator

Choose a door, see the host reveal a goat, then decide whether to stay or switch. Run a bounded Monte Carlo simulation to compare both strategies.

In-browser processingNo account requiredPrivacy details ↗

Standard rules: one prize is placed randomly; the host knows its location, always reveals a goat, and always offers the switch.

Choose a door to begin.

Monte Carlo simulation

A QUICK WALKTHROUGH

How to use this tool

  1. Choose one of three doors and let the host reveal a goat door.
  2. Stay with your first choice or switch to the remaining closed door.
  3. Set a simulation count up to 100,000 to compare stay and switch wins.

Game assumptions

There are three doors and one randomly placed prize. You choose one door first. The host knows where the prize is, always opens a different door with a goat, and always offers the remaining closed door. When the host has two goat choices, one is selected at random.

Local, bounded simulation

Manual play and Monte Carlo rounds run in this browser. The simulation accepts 1–100,000 rounds and does not upload or save results.

GOOD TO KNOW

Common questions

Why does switching win more often?

Your first door has a 1/3 chance of hiding the prize. The host’s reveal concentrates the other 2/3 chance on the only remaining closed door.

Can the host reveal the prize?

No. The simulator follows the standard Monty Hall rules and always reveals a goat.