← Game Math

🚪 2D Monty Hall

Speed: 100/s

📊 Statistics

Total rounds0
Switch wins0
Switch win %—
Stay wins0
Stay win %—

switch   stay

🧪 N-Door Lab

Doors (N)10
(N-1)/N = —
Trials0
Empirical switch %—
Empirical stay %—

🚪 2D Monty Hall — Real Trials & N-Door Generalization

A flat, honest re-creation of the Monty Hall problem: every car placement, every player pick, and every door the host opens is a genuine random draw computed live — nothing is scripted. Play it by hand, let it run millions of trials automatically, or generalize the puzzle to N doors and watch the empirical switch-win rate track the exact (N-1)/N formula.

🔬 What It Demonstrates

Picking 1 of 3 doors gives a 1/3 chance of the car; the other two doors together hold 2/3. Because the host always knows where the car is and always opens a real goat door that isn't your pick, none of that 2/3 probability is lost when a door opens — it all collapses onto the single remaining door. Switching therefore wins 2/3 of the time, staying only 1/3. The N-Door Lab extends the same real random-trial logic to any number of doors, confirming the general result that switching wins with probability (N-1)/N.

🎮 How to Use

In Manual mode, click a door, then choose Switch or Stay after the host reveals a goat. In Auto mode, thousands of independent trials run per second on both strategies simultaneously — watch the live win percentages and the convergence chart approach 66.7% and 33.3%. Switch to the N-Door Lab, drag the door-count slider from 3 to 50, and watch the empirical switch-win rate converge to the exact (N-1)/N value shown above the chart.

💡 Did You Know?

As N grows, (N-1)/N approaches 1 — with 100 doors, switching wins about 99% of the time, because the host's single remaining closed door absorbs almost all of the original probability. This generalization is one of the clearest ways to build intuition for why switching works: with more doors, the host reveals more and more information every time he opens a door he knows is empty.

About this simulation

Written by MySimulator Team · Reviewed by MySimulator Editorial Review

Last updated: 13 September 2026

This simulation is a flat 2D companion to the 3D Monty Hall Paradox: a real car hides uniformly at random behind one of the doors, your pick is genuinely random or chosen by hand, and the host — who always knows where the car is — always opens a real goat door that is neither your pick nor the car. Nothing about the outcome is pre-scripted; every trial, in both Manual/Auto mode and the N-Door Lab, draws fresh random numbers and scores the outcome honestly, so the win rates you see are a genuine Monte Carlo estimate.

🔬 What it shows

With 3 doors, switching after a goat reveal wins with probability 2/3 because the host's informed choice concentrates the initial 2/3 probability of "car is not behind my door" onto the single unopened alternative. The N-Door Lab generalizes this: with N doors, the host opens N-2 goat doors, and switching to the one remaining door wins with the exact probability (N-1)/N — a value the simulator's empirical rate converges to as trials accumulate.

🎮 How to use

Manual mode: click a door, then press Switch or Stay once the host reveals a goat. Auto mode: runs both strategies on fresh random trials at the chosen speed (1 to 10,000 rounds/second), plotting live convergence toward 66.7%/33.3%. N-Door Lab: drag the door-count slider (3-50) to change N; the simulator keeps running real trials for that N and displays the empirical switch/stay win percentages next to the exact (N-1)/N formula.

💡 Did you know?

As N grows large, (N-1)/N approaches 1, meaning switching becomes almost a sure win — with 50 doors it is already 98%. This is the cleanest way to see why the host's guaranteed goat reveals are so informative: each one he opens (while carefully avoiding the car) transfers more of the missing probability onto the single door he leaves closed.

Frequently asked questions

How is this different from the original 3D Monty Hall simulation?

The core probability logic is identical and equally genuine, but this version renders everything in flat 2D canvas instead of a WebGL/Three.js scene, and it adds a live N-door generalization lab that the 3D version does not have, letting you test the (N-1)/N formula for any number of doors from 3 to 50.

Are the trials really random?

Yes. Every round draws the car's position and (in Auto/Lab modes) the player's pick uniformly at random with JavaScript's random number generator, and the host's revealed door is chosen only from the doors that are neither the player's pick nor the car. Nothing about a round's outcome is predetermined.

What does the N-Door Lab prove?

It empirically verifies the general Monty Hall formula: with N doors, one car, a random player pick, and a host who opens N-2 genuine goat doors, switching to the single remaining door wins with probability exactly (N-1)/N. As you increase N and let trials accumulate, the measured switch-win percentage converges to that exact value.

Why does switching still work with more doors?

Your first pick only ever has a 1/N chance of being the car, so the other N-1 doors together hold (N-1)/N of the probability. The host's forced goat reveals never touch the car and never touch your pick, so all of that (N-1)/N probability survives and lands entirely on the one door he leaves closed — which is exactly why switching wins that often.

Does the player's strategy in Auto/Lab mode matter?

No — Auto and Lab modes score both switching and staying on the very same random layout each trial, which is what makes the comparison a fair, unbiased Monte Carlo experiment rather than two separate biased samples.