WOLFRAM|DEMONSTRATIONS PROJECT

Approximating Pi by the Monte Carlo Method

​
number of sample points
40
graph background color
3
point size
2.4
π ≈
29
10
= 2.90000
This Demonstration approximates using the Monte Carlo method: (1) randomly select points in a square with an inscribed circle; (2) multiply the number of points inside the circle by four; (3) divide by the total number of points in the square.