Today I'd like to teach you all about one of my all time favorite constants: π!
Most likely, all of you know that π is the ratio of a circle's circumference to its diameter, and probably only know only 3 to 5 decimal digits of it. However, π is an irrational number, meaning it has no end! Let us go through all of the different formulae of π I have programmed, and explain what they mean! Let's dive in. (These are numbered in the order that they print when the attached code is run)
- The Monte Carlo Method
One way you can do this is by drawing a square, with a circle whose edges touch the 4 edges of that square within. Now imagine you were to draw many many dots randomly within the square-circle hybrid. If you take the number of points that fell within the circle, divide it by the total number of points, and multiply it by 4, you get (you guessed it) π!! More info can be found here:
- The Chudnovsky Algorithm
This is one of the fastest methods out there, being used in the world record, to calculate 50 trillion digits of π! I already explained it in a previous post, but the formula (and more cool information!) is here:
- The Basel Problem
This problem, posed by a man named Pietro Mengoli, asked for the exact sum of an infinite series, with proof. Mathematician Leonhard Euler answered this, with proof, finding it to equal exactly π^2/6. Further info and interesting facts here:
- The Wallis Product
Unlike the other formulae here, this one uses the Product Operator in its equation. If repeated over an infinite number of times, it will equal π/2. More information here:
- The Leibniz Formula
Last but certainly not least, I have here probably one of the slowest π-convergent methods out there. In fact, to get π accurately to 10 decimal places takes about 5 billion iterations, according to the Wikipedia page! This formula alternates between adding and subtracting fractions with odd denominators (meaning this is an example of an alternating series), and converges on π/4. For extra information, go here:
I plan to make more π approximation programs in the future, so stay tuned if these kinds of things interest you as much as they interest me!
Thank you. ^ ^
@LizFoster i have a starwars oc:
My name is Ariana Bridger.And I am the Most PowerFul Jedi in the universe.That might seem awesome. But it's really not. Because,when you're as Powerful as i am, The Sith find you easily as pie. I’m shocked my crew stayed with me.But they do.That i am glad. Because without my crew I would be dead by now.
When my master made me a full Jedi at 8 years old, everyone was shocked.That was 4 years ago. When I still used my real name. But now, everyone knows me as Adrianna luv.
I was born in an imperial prison to Ephraim and Mira Bridger. When They had to give me to the Sith, they whispered in my ear. They told me to be strong and stand up for what is right. I always remembered that. Their death is the reason for me leaving the empire, and becoming a Jedi instead of a Sith. I never thought i’d see any of my family again, But that was before I joined the Rebellion, and met Ezra Bridger. Now, to tell my story. It started when I got caught stealing a kyber crystal from the empire.