Skip to content

anton2yakovlev/PI-Estimate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PI-Estimate

Estimate PI, using random[0,1]

This program estimates pi using only random number generation from 0 to 1. Random points are generated, then it is checked whether they are included in the unit circle. The ratio of the number of points in a circle to the total number of points allows you to estimate the area of the circle. The area of the unit circle is pi.

area = PI*r^2

(pir^2)/(2r^2) = in_circle_points/all_points pi = (4*in_circle_points)/all_points

16.06.2021

Python 3.9.4

Package: random, math, matplotlib

About

Estimate PI, using random[0,1]

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages