0
$\begingroup$

I made a very simple program that approximates $\pi$ in r, by finding the probability that 2 random generated numbers are coprime for n trials. The result of this probability approaches $\frac{6}{\pi^2}$ wiht more trials, so from there you can isolate $\pi$ and return an approximation of $\pi$. For more info, refer to this page: https://en.wikipedia.org/wiki/Coprime_integers. From this it is obvious that as your trials n approaches infinity, the algorithm would return the exact value of $\pi$. Hence I made the program return the percent error between the approximation and the true value of $\pi$. I began to wonder what would happen if you found the average of m percent errors for a set n. Would this average error converge to a specific percent error as your m approaches infinity, and would it be related to n? I am both a beginner mathematician and a programmer, so I would not know how to approach this problem theoretically or practically.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.