Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (8 sloc) 801 Bytes

Monte Carlo for Pi


A Jupyter Notebook that uses a Monte Carlo Algorithm to determine the value of Pi.


The code uses a Monte Carlo algorithm to estimate the value pf pi by generating random points with x in [-1, 1] & y in [-1, 1] and determining whether they lie within the unit circle or not. The obtained pi is compared to numpi.pi and the random points are plotted to visualize the distribution.

As a bonus, the code can also be run until a specific level of accuracy (again compared to numpy.pi) has been achieved.

How to get in Touch

For enquiries please get in touch via the contact form on my website or send me an email here.

You can’t perform that action at this time.