Draw a unit radius quarter circle arc in a square with unit side length.
Draw points Pi(xi, yi), where xi and yi are independently generated random numbers in the range 0 - 1.0
Then the probability of the points falling inside the quadrant is the ratio of the area of the sqaure and the quadrant,i.e.
(area of the quadrant )/ (area of the square ) = (p/4) R2 /(1 * 1) = p/4
******************* pi_mc_001.dwg ********************
*********************************** pi_mc_002.dwg ************************************
You can see the process in animation.animation
To create this drawing and animation:
Load random_1.lsp (load "random_1")
Load random_2.lsp (load "random_2")
Load Monte_Carlo_pi.lsp (load "Monte_Carlo_pi")
Then from command line, type pi_mc
.