Skip to content

AghastComet/Pi-Approximation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Pi-Approximation

A python script to approximate pi using coprimes.

The code generates two random numbers and cheaks if they are coprime as a way to get the probability that any two numbers are coprime. Then a simple equasion is used that takes the probability and turns it into pi. The number of iterations and the upper bound of the random numbers are set when the program is run and determin the accuracy. A simple function is used to show percent completion.

Pi.py is the original version of the program. ReadablePi.py is the new version that is more readable, but doesn't report completion percent.

About

A python script to approximate pi using coprimes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages