
Patrick B. answered 06/03/19
Math and computer tutor/teacher
option 1: 22/7
option 2: sqrt(2) + sqrt(3)
option 3:
generate a random ordered pair (x,y) where -1 <= x <= 1 and -1 <= y <= 1;
if the point is on or inside the unit circle, centered at the origin, then count it as a hit.
the ratio of hits to shots will approximate the value of pi.
Specifically, the area of the circle with radius 1 has a value of pi. so you can approximate the value
of pi this way.
the function you need is x^2 + y^2 = 1