kweterings / MonteCarlo_Estimation

An introduction to Monte Carlo methods by estimating π. This code comes in the form of a Python program.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Estimating π using Monte Carlo Methods

Created by Kai Weterings, 12/08/2023

The following repository contain a code which produces an estimate of π using Monte Carlo methods.
Monte Carlo methods is a type of 'computational algorithm that uses repeated random sampling to obtain the likelihood a range of results of occurring'1. Monte Carlo although basic in this project, can become very important to assessing risk in many real-life scenarios. Very useful to getting a most accurate estimate possible when faced with many random variables and unknown outcomes.

As an introduction, please view the Monte Carlo code which estimates pi and produces a graph of the progression of the estimate after each iteration. Although this is the most basic form, it gives an understanding of the random sampling method which can be used for many various applications. The code begins with 10000002 as a base number of iterations for the estimation of π, which can easily be changed.
You may also find a .png file of a preview of what the code will output.

Thank you for viewing my code, and if you have any questions please contact me by any means possible.

Footnotes

  1. Definition sourced from:
    What is Monte Carlo Simulation?. IBM. (n.d.). https://www.ibm.com/topics/monte-carlo-simulation, Accessed 12/08/2023

About

An introduction to Monte Carlo methods by estimating π. This code comes in the form of a Python program.


Languages

Language:Python 100.0%