Skip to content

neoplites/RhubarbPie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

RhubarbPie

Rhubarb pie is great, but you know what's better? That's right, calculating Pi probabilistically! Enter Probab Pi...

Imagine a square board (square) on the wall. Hang a circular dart board (circle) on top of it, such that the centers of the square and of the circle coinside. The diameter of the circle is the same as the side of the square.

Start throwing darts at the board so that you cover the square in a uniform fashion. Count the number of darts that are inside of the circle and divide that number by the total number of darts. That ratio approaches the ratio of the corresponding areas. Since the radius of the circle is half the side of the square, the areas of the circle and the square are A_c = pi * side * side / 4 and A_s = side * side respectively and pi = 4 * A_c / A_s.

About

Calculate Pi probabilistically

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages