Estimating π from Random Numbers with Euclid's Algorithm
Coding Challenge #161
🥧 Happy Pi Day 2021! This year I estimate the digits of π with random numbers and the probability of two integers being co-prime., I estimate the digits of Pi with random numbers and the probability of two integers being co-prime.
Topics
- 0:00 - Happy Pi Day!
- 1:26 - Explain! What does co-prime mean?
- 4:21 - Explain! Euclid's Algorithm
- 8:40 - Example! Finding the greatest common divisor.
- 9:55 - Code! gcd() function with Euclid's Algorithm.
- 12:23 - Code! Let's load the random digits.
- 14:39 - Code! Let's use draw() for our loop.
- 16:13 - Code! Co-prime or Co-factor?
- 17:44 - Explain! How we are going to estimate π.
- 18:50 - Code! Estimating π.
- 21:59 - Code! Trying with digits of π.
- 22:54 - Ideas! Thanks for watching!
Community Contributions
You can also add your own version! (See how)
Links discussed in this coding challenge
Videos discussed in this coding challenge
- Generating π from 1,000 random numbers by Stand-up Maths