Coder Social home page Coder Social logo

kweterings / montecarlo_estimation Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 25 KB

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

Python 100.00%
computation graph interation interations math mathematics matplotlib matplotlib-pyplot monte-carlo monte-carlo-simulation

montecarlo_estimation's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.