Skip to content

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

Notifications You must be signed in to change notification settings

kweterings/MonteCarlo_Estimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages