Skip to content

Unusual way to achieve π: Generating Pi from random numbers

Notifications You must be signed in to change notification settings

tofran/pi-from-random-numbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unusual way to achieve π: Generating Pi from random numbers

The purpose of this repo is to gather (programming) solutions for the peculiar procedure for generating / achieving π (Pi) that Matt Parker presented in this video.

Why

  1. In commemoration for Pi Day 2017.
  2. Having fun.
  3. No apparent logic reason.

How does it work

Since the Probability of Two (random) Integers Being Coprime is given by:

formula 1 Proof and demonstration

We can generate lots of numbers and calculate π by:

formula 2

Watch Matt Parker generating π from 1,000 random numbers by rolling a dice on here.

Acknowledgments

All solutions are from these users (in no particular order), some are quite efficient others not so much. Regardless thanks very much.

  • Matt Parker
  • Torfi Þorgrímsson
  • TheWioreks
  • Alyan Zahid
  • Andriamanitra
  • Bendik Mihle Hansen
  • Buttercak3
  • Ecrou Ecrouisseur
  • Georgi Iliev
  • Gerard Kool
  • Pedro Sousa
  • Bengineer8
  • 梁瑋瀚
  • TheWioreks
  • LaugeRønberg
  • Justin Murtagh
  • Ando Bando
  • Chris Pedro
  • Alex Walters
  • Mark Johnson
  • Clark Cox
  • navkums
  • Bebopity
  • GLaDHuRriCAn
  • Tom Spink
  • seevernet1
  • Cody Woodard
  • JustForFunc
  • John Lindstedt
  • Erik Lindemann
  • Altoids The Destroyer
  • limzykenneth
  • MDuh Gaming
  • QuomoZ
  • elijah finn
  • Josh Grigonis
  • wHiTEY 542
  • Bryan Ng

Happy Pi Day!

About

Unusual way to achieve π: Generating Pi from random numbers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published