DEV Community

Abhishek Chaudhary
Abhishek Chaudhary

Posted on • Originally published at theabbie.github.io on

estimate pi using random numbers

pi is an and it has infinite decimal places we will use the concept of probability and definition of pi to calculate the value of pi since we are randomly plotting points inside the square, the probability of it lying inside the circle is since we are plotting many points, empirical probability says that since we know the empirical probability we will use it to find value of pi ie. n/N = Pi/4 this is also know as Monte Carlo method, this works perfectly when number of pounts is fairly high

Top comments (0)