Happy Pi Day!
Some people on the Replit Discord pointed out to me that it was Pi Day, but I hadn't made anything special. So, I came up with this idea - a program which calculates pi using random numbers and includes a nice visual of what it does!
Here's how it works:
Consider the square to have a side length of 2, and an area of 4. The circle has a radius of 1, and an area of π. Each point is chosen at a random position within the square. The chances of a point falling inside the circle are π/4, so to find the value of π, simply multiply the fraction of points which are inside the circle by 4.
I hope you enjoy - let me know the values for pi that you calculate with this!
Thanks to @Spotandjake for helping me fix a bug regarding canvas sizing.
lol there is a much more beautiful and unexpected way which is:
if you take 2 random integers, the probability that they are co factor (share a gcd bigger than 1) is 6/PI²
isn't that absolutely gorgeous!
happy pie day everyone hey lets make this happen https://www.change.org/p/rename-science-and-stuff-rename-science-n-stuff-to-math-with-minx
@FlaminHotValdez i would argue that british terms with the internet have made there way around lol, just less common. i would argue that maths is more correct tbh but I would argue that it should be linguistics and sciences as well at the end of the day lol I say math because it is more familiar and I am talking about the subject as a whole not the plural of rules that it defines lol.