Monte Carlo Simulator
Solve problems with randomness. Throw darts to estimate π, drop balls through a Galton board, play the Monty Hall game a million times, roll dice until a bell curve appears, drop Buffon's needles, follow random walkers and test the birthday paradox. Watch every estimate home in on the exact answer.
Estimate vs number of trials
estimate exactError shrinks like 1/√n
error 1/√n trendChoose an experiment. Results reset.
This experiment has no settings other than the seed.
The CSV lists the estimate after each number of trials (log-spaced) and its error from the exact value.
How Monte Carlo methods work
- Many questions are hard to calculate but easy to simulate: repeat a random experiment many times and count what happens.
- By the law of large numbers, the share of successes gets closer and closer to the true probability.
- The typical error shrinks like 1/√n: 100 times more trials give a 10 times more accurate answer.
- Each experiment here has an exact answer, so you can see how fast the estimate converges and how big the random error is.
Named after the Monte Carlo casino; used everywhere from physics and finance to AI. Everything runs in your browser.
Using Monte Carlo Simulator
A probability lab that solves problems with randomness. Estimate π with darts and Buffon's needle, play the Monty Hall game, drop balls through a Galton board, roll dice until a bell curve appears, follow random walkers and test the birthday paradox — and watch each estimate converge to the exact answer.
- Pick an experiment in the Experiments tab, for example Estimate π, Monty Hall or Galton board.
- Press Play, or add trials with +1, +100 and +10,000. Raise Trials per frame to go faster.
- Watch the visual and the big numbers: your estimate next to the exact answer.
- Read the convergence chart (estimate vs trials) and the error chart, which shrinks like 1/√n.
- Change the experiment's settings (rows, doors, dice, people…) and download the convergence data as CSV.
Example
Estimate π: after 100,000 darts the estimate is usually within about ±0.01 of 3.14159. Monty Hall: switching wins about 66.7% of games and staying about 33.3%, no matter how surprising that feels.
Questions & answers
What is a Monte Carlo simulation?
A way to answer a question by repeating a random experiment many times and counting the results. With enough trials the average gets close to the true value.
How accurate is it?
The typical error shrinks like 1/√n: 100 times more trials make the answer about 10 times more accurate. The charts show this and a 95% margin where it applies.
Why does switching win in Monty Hall?
Your first pick is right only 1 time in 3. The host always opens a goat door, so the other closed door holds the car in the remaining 2 out of 3 games.
What does the Galton board show?
Each ball bounces left or right at every pin. The number of right bounces follows a binomial distribution, which looks like a normal (bell) curve when there are many rows.
Why does a group of 23 people often share a birthday?
There are 253 possible pairs in 23 people, so the chance that at least one pair matches is about 50.7%.
How do darts estimate π?
A circle fills π/4 of the square around it. The share of random darts that land inside the circle times 4 approaches π.
Can I repeat a run?
Yes. Each experiment uses a seed; the same seed and settings give the same results.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
