An open API service indexing awesome lists of open source software.

https://github.com/tofran/pi-from-random-numbers

Unusual way to achieve π: Generating Pi from random numbers
https://github.com/tofran/pi-from-random-numbers

coprime fun math pi pi-day piday useless

Last synced: 10 months ago
JSON representation

Unusual way to achieve π: Generating Pi from random numbers

Awesome Lists containing this project

README

          

# 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)][Pi] that [Matt Parker] presented in [this video][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][Coprime integers]** is given by:

![formula 1](https://i.imgur.com/TZt9nAX.gif "x = \frac{6}{\pi^{2}}") [Proof and demonstration]

We can generate lots of numbers and calculate π by:

![formula 2](http://i.imgur.com/5Ksi47K.gif "\pi = \sqrt{\frac{6}{x}}")

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

## 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!**

[Pi]: https://en.wikipedia.org/wiki/Pi
[Pi Day]: https://en.wikipedia.org/wiki/Pi_Day
[Coprime integers]: https://en.wikipedia.org/wiki/Coprime_integers
[Proof and demonstration]: http://www.cut-the-knot.org/m/Probability/TwoCoprime.shtml
[Video]: https://youtu.be/RZBhSi_PwHU
[Video full]: https://www.youtube.com/watch?v=ESU4KdRLzu0
[Matt Parker]: http://standupmaths.com/