Skip to content

a simple program that estimates the value of Pi using the Monte Carlo Method that is written totally in Python

Notifications You must be signed in to change notification settings

truongluan303/pi-estimate-visualization-using-monte-carlo-method

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

Estimate Pi using Monte Carlos method

This is a simple program that estimate the value of Pi using the Monte Carlo Method that is written totally in Python

estimating-pi-monte-carlo-method

From the image above, we can easily calculate the Area of the circle and the square

equation

Therefore, we can simulate this situation by creating a big number of points that are randomly distributed on the image. ALL of the points generated (BOTH blue & red) will represent A_square. The total number of points that are inside the circle (ONLY red) will represent A_circle From there, we can do the calculation and estimate the number pi

I am using pygame for the graphical interface The longer we run the program, the more accurate the output will be

This is how the output looks like:

Estimate.Pi.2021-06-27.16-35-55.mp4

About

a simple program that estimates the value of Pi using the Monte Carlo Method that is written totally in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages