4 ms·
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 th
by Turing_Machine 8y ago
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.
- commandlinefan 8y agoHow 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.
- tntn 8y agoCheck the distance from the center to the dart?
- commandlinefan 8y agoOk, that makes sense.