# Monty Hall problem > Should you stay or switch doors? Play the Monty Hall game, then let the simulation play thousands of games and watch the odds appear. Play the Monty Hall game with 3 to 100 doors, then simulate thousands of games and see live why switching wins two times out of three. - Page: https://how.box/monty-hall/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/monty-hall/?d={d}&n={n} - `d` (whole number 3 to 100): Number of doors. Example: `3`. - `n` (whole number 10 to 100000): Games to simulate (the simulation starts only on the button). Example: `10000`. Example answer: https://how.box/monty-hall/?d=3&n=10000 A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `monty_hall_odds`: Exact odds of the Monty Hall game with `doors` doors (3 to 100, default 3): a car behind one door, goats behind the rest; you pick one, the host (who knows) opens all but one other door, each hiding a goat, and you may stay or switch. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"monty_hall_odds","arguments":{"doors":3,"games":10000}}}` - GET: https://how.box/mcp/run/monty_hall_odds?doors=3&games=10000 ## How it works The Monty Hall problem looks like a coin flip: two closed doors are left, so surely each has a 50 % chance of hiding the car? It does not, because the host does not open a door at random. He always opens a door with a goat, and he can only do that without touching your door. Your first pick has a 1 in 3 chance of being right, and nothing the host does changes that. So staying wins with probability 1/n, and switching wins in all the other cases, with probability (n − 1)/n. With three doors, that is 2 out of 3 for switching. With 100 doors and 98 opened, switching wins 99 times out of 100. For example, with 3 doors, staying wins 33.3% of the games and switching 66.7%. The simulation plays that many games with random cars and random first picks, so its rates wander around the exact ones and close in as the games pile up. The rules assumed here are the standard ones: the host always knows where the car is and always opens goat doors. Source: Wikipedia, Monty Hall problem. ## FAQ **Why is it not 50-50 between the two closed doors?** Because the host's choice carries information. He had to avoid the car, so the other closed door is the car's whenever your first pick was wrong, and that happens two times out of three. **Does it matter that the host knows where the car is?** Yes. If he opened a door at random and happened to show a goat, staying and switching would be equally good. The 2 in 3 for switching needs a host who never opens the car's door. **Will switching win every time?** No. It wins about two games in three. Play a few rounds yourself and you will see switching lose now and then; the simulation shows the pattern over thousands of games. **Is the simulation really random?** Yes. Each game picks the car's door and your first door with secure random numbers from your browser, and nothing is sent anywhere. **What changes with more doors?** Your first pick is right less often, 1 in n, so switching wins (n − 1)/n of the games. Here the host opens all doors but yours and one other. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)