Estimating Pi with Monte Carlo

Pi can be estimated via a Monte Carlo procedure: Sample random numbers on the unit square and count how many of these samples fall into the quarter circle. The ratio of the points inside this quarter circle by the number of total samples is roughly Pi/4.

For the UQ 2019 lecture at KIT, we designed a Python Notebook on Google Colab where you can play around and estimate Pi yourself:

Here’s a small teaser:

Pi is estimated to be roughly 3.1484

Leave a Reply