Monte Carlo Pi Estimation
22
Estimate the value of Pi using a Monte Carlo area-ratio method (Buffon's needle/Circle quadrant).
NOTEAbout This Model
## Estimate the value of Pi using a Monte Carlo area-ratio method (Buffon's needle/Circle quadrant). This model explores how **Pi Estimate Sample** could play out, depending on X Coordinate, Y Coordinate. Hit **Run** to see the range of possibilities.
VARIABLEX Coordinate
uniform(0, 1)
Random X position in a 1x1 unit square.
x_coordinate
VARIABLEY Coordinate
uniform(0, 1)
Random Y position in a 1x1 unit square.
y_coordinate
FORMULAIs Inside Circle
if(pow(x_coordinate, 2) + pow(y_coordinate, 2) <= 1, 1, 0)
Calculate if a random point (x,y) falls inside the unit circle (x^2 + y^2 <= 1).
is_inside_circle
FORMULAPi Estimate Sample
is_inside_circle * 4
The ratio of points inside the circle to total points in the square (1x1) is pi/4. Multiplying by 4 estimates pi.
pi_estimate_sample
OUTPUTPi Estimate Sample
pi_estimate_sample
Track the pi estimate sample output
What is Carlo?
Carlo is a visual tool for Monte Carlo simulation. Model uncertainty by dragging probability distributions, connecting them visually, and running thousands of scenarios instantly.