I don't know from where should I start solving this problem.
It seems that the Math department at UGA once again dropped the ball , and forgot the value of pi. You are to write a function called mypi which consumes a number that specifies the required accuracy and approximates the value of pi to that accuracy. You are going to the following algorithm based on geometric probability.
Think about a quarter circle inside of a unite square (the quarter circle has area pi/4). You pick a random point inside the square. if it is in the quarter circle, you get a "hit" and if not, you get a "miss". The approximate area of the quarter circle will be giving by the number of hits divided by the number of points you chose.
Your function should repeat the process of counting hits and misses until at least 10,000 tries have been made, and successive estimates of pi are within the prescribed accuracy. it should return the estimated value of pi.
HINT: 1- Use the function rand(...) in this problem.
2- Think about the probability that a random point ends up in the quarter circle. You can simulate this probability by counting how many random points end up in the quarter circle. This means you must geometrically define where the quarter circle is and have a script that can determine if the random point in the square is inside the boundaries of the quarter circle.