This project aims to generate pi by generating random numbers. Matt Parker of standupmaths has some great explanations of how pi can be generated using random numbers. I'd definitely recommend you check out his video (link in the notes and credits). You can change how PI is generated by moving the "Rand Max" slider. That will change the max random number that can be generated. Higher numbers will take slightly longer to calculate. You can also change how many numbers are generated by changing the "Repeat Times" slider. If you set it to 0, it'll continue (almost) indefinitely. The speed slider changes how long the program waits (in seconds) before generating another random number. This is helpful if you want to try and understand how this works. -=== Variables ===- Rand1: This is the first random number generated between 1 and the "Rand Max" variable. Rand2: This is the second random number generated between 1 and the "Rand Max" variable. gcf: This is the greatest common factor of the "Rand1" and the "Rand2" variables. Co Factors: This is how many times the "Rand1" and "Rand2" variables have had a common factor other than 1. Co Primes: This is how many times the "Rand1" and "Rand2" variables have only had a common factor of 1. Co Prime Probability: (Co Factors + Co Primes) / Co Primes PI: The estimate of PI which is "sqrt(6/x)" where x equals the Co Prime Probability. Bottom left: The equation of pi that we're using, with the variables shown. Bottom left above: How many times the program has looped
This was inspired by Matt Parker's video on generating pi: https://scratch.mit.edu/discuss/youtube/RZBhSi_PwHU/ Credit to Xenophile5 for his GCF finder: https://scratch.mit.edu/projects/106312312/