Skip to content

TomDotScott/Python-PI-Day-2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pi day 2021 - Generating PI from random numbers

For PI-Day this year, I wanted to take a crack at estimating PI with PI-thon (sorry). Rather effective, this method uses randomly generated number pairs and checks their gcd. this method is ~99.88% accurate!

To do this, I am using the fact that the probability of two numbers being co-prime is 6 over Pi squared:

Equation

My thought process was as follows:

My scribbles

The Euclidean Algorithm was researched here

The result is ~99.88677510815323 % accurate!

About

Estimating PI from random numbers for PI Day 2021

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages