Hacker News new | ask | show | jobs
by rudolfwinestock 2939 days ago
Monte Carlo has been called "integration by darts." This is a play on words of the better-known "integration by parts" method of undergraduate calculus.
1 comments

Indeed. A classic (and simple) Monte Carlo procedure lets you estimate pi by essentially throwing darts.

1) Draw a unit square.

2) Inscribe a circle inside the square.

3) Throw a whole bunch of darts at the square, distributing them as randomly as possible.

4) Count the number of dart holes inside the circle. Divide by the total number of dart holes. Now you have an estimate of the ratio of the areas of the circle and the square. Call this number C. Since you know the area of the square is 1, the area of the circle must be C. C is also equal to pi * r^2, where r is the radius of the inscribed circle (which is 0.5). Thus, C = pi * (0.5)^2 = pi/4. Pi is therefore approximately 4C.

How do you figure out how many holes are inside the circle if you don't already know pi, though? I mean, a human could do it, but I don't follow how this extrapolates to a mathematical process.
Check the distance from the center to the dart?
Ok, that makes sense.