Funny math challenge | Sololearn: Learn to code for FREE!


Funny math challenge

You know that the surface of a disk of radius 1 is S=PI. This means that if if pick random dot in a 2x2 square the probability of being in the disk of radius 1 equals P=Pi/4. Use this to make a programm approximating PI by taking many random dots (lets say 10.000) and displaying your approximation of Pi

9/3/2017 4:00:32 PM


9 Answers

New Answer


For a Monte Carlo problem also nice to calculate the uncertainty. Code gives one sigma uncertainty, so double if you want to get the 95% uncertainty.


Aaahh... the MonteCarlo method :) Amazingly enough, this is really *weak* (slow convergence) algorithm when compared to other numerical ones. But it might be the easiest to comprehend and teach :)


Interesting, this reminds me the Buffon's needle.


This is my code in Python! 🐍 Try it!



One of my school's python missions was to show that visually (searches for the code) But nevermind it used the turtle graphics module


Nice ones. A bonus if you can display the range for the value of pi with 95% of chances based on how many random launches you are doing (you will need some google)



You are the best on this one my friend !