Today I'd like to teach you all about one of my all time favorite things: π!
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. ^ ^
@JosiahKnisely Oh, that's alright. I can explain. ^ ^
No, there are not multiple values for π. There is only one, that being '3.14159...' and so on. These are merely methods of calculating π, albeit with varying amounts of accuracy at certain numbers of iterations.
π is quite interesting and cool, in that it can show up within the solutions to various mathematical problems that appear to have absolutely nothing to do with circles (at least at first glance)!
The things that the program displays are not π, in that, based on the accuracy I've asked for, the digits it shows aren't EXACTLY π.
For example, a common value that we use when approximating π is 22/7. This is only accurate to 3 digits (3.14), and even closer is 355/113, which is accurate to 7 digits (3.141592).
While they aren't equal to π, we often use them, since they are close enough to be somewhat useful for our purposes!
We don't know what π equals exactly, since it is infinitely long, but these equations can hep us learn more and more.
Here's a helpful link that non-math people can understand ^ ^
Great work Liz! Very, very interesting post about a very, very interesting number! I just gave you the conzent creator role, which marks creators who upload high quality content! Congratz
Do you know anything about something called a spigot method/algorithm or something? I heard of them at some point, but I’m not entirely sure where or exactly how either...
@Highwayman Oh! I completely forgot about those, but yes, I do know about Spigot Algorithms! They can be used to find mathematical constants, like π! This is an article I had bookmarked about that:
@LizFoster ... I saw you were talking about learning "one of the C languages" earlier? That’s what they are all in. I know it’s not my place or anything at all, but I really strongly suggest you do, it’s so awesome.
I’d suggest maybe checking out cryptography or maybe AI Books, those are pretty math heavy I think :P
@LizFoster ehhh No. :( again all my books are c++, but I bet if you just look it up you will find something pretty easily. At least from what I can remember it’s pretty easy to find(it was just too mathy for me, so I never saved it). There are also some things on ai in this learn section too actually, though of course that’ll be more starter stuff than any of the more exciting stuff.
Actually if you learn C++, I found this one a while back on Neural Networks:
I don’t know if it’s actually good I forget I haven’t picked it up in a while(again- too mathy for me I’m bad at math lol)
And then this one is on analyzing stream ciphers(which are really cool by the way)
Again these are kinda introductions and also just things I pulled from my library, so I don’t how good they are but I hope they are helpful. :P
@Highwayman Oh, cryptography looks fun. I'd suggest looking on YouTube; half of the stuff I've learned came from Numberphile, 3Blue1Brown, and Mathologer, so I'm sure that there are loads of tutorials and such for cryptography! Here are a few I found if you have the time for it:
and then for fun (probably not as related Lol):
If P and Q are two points on an elliptic curve such that kP = Q, where k is a scalar and sufficiently large, it is computationally infeasible to obtain k if k is the discrete logarithm of Q to the base P . Note that this is computationally infeasible even if P and Q are known.
XS ohh boy. Here we go again lol.
@enigma_dev Oh, yay! Hi! Um, so
I was reading some stuff on the diffie-hellman key exchange, and they started discussing ECC, which I though was basically just another asymmetric encryption algorithm like RSA, but now I’m kinda confused because it started to look like it was just another form of the aforementioned diffie-hellman exchange, so I guess what my question is is what is elliptic curve cryptography?