Estimating the value of Pi
The idea of this algorithm is take a great number of random points in a square of side
We know the area of the square is
So the ratio of these two areas is:
Now if we take a large number of random points to represent the area of this both figures:
Finally:
In this example exist three implementations of the algorithm, pure python, numba and numpy implementation.
In order to run the examples first you have to install requirements.
pip install -r requirements.txt
Then you can run the main file to get the execution time of the methods.
python main.py