Monte Carlo Pi Simulator

Throw random dots at a square with a circle inside it. The share of dots that land in the circle gives an estimate of pi.

1 Pick your options

2 Your answer

Press Run simulation and your answer shows here.

How to use the Monte Carlo Pi Simulator

  1. Type how many random dots to throw.
  2. Press Run simulation to throw them again.
  3. More dots usually give a closer estimate.

Frequently asked questions

How does this estimate pi?

The dots fall at random on a square. The circle inside the square covers pi divided by 4 of its area, so four times the share of dots inside the circle gives pi.

Why is the answer never exactly pi?

The dots are random, so each run gives a slightly different estimate. More dots usually bring the estimate closer to pi.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.