Programmed this in Rust, and ending at 999^2 only gives 2 accurate digits after the decimal point. Averaging the two results at 999^2 and 1001^2 gives 5 accurate digits after the decimal point. Also tried averaging four sequential results, and made almost no difference versus two.
@@artsmith1347 Even better than averaging, you can *extrapolate* the values to get quadratic instead of linear convergence. This is called Richardson extrapolation. Observing that it appears to converge linearly in the number of terms, you can model the convergence as `f(n) = π + c/n = f(∞) + c/n` where c is some constant and n is the number of terms (being a bit cavalier about alternating signs, though it's not hard to be more careful). All you have to do is plug in a couple values of n and solve for f(∞), as if you used an infinite number of terms! In reality, this generally just increases the order of convergence by one or two degrees, but using f(20) ~ 3.0939 and f(22) ~ 3.09809, I get f(∞) = (22 * f(22) - 20 * f(20) / (22 - 20) = 3.1396. Which isn't great either, but it's equivalent to somewhere in the ballpark of 400 terms for no extra effort!
Oops, maybe it won't let me post an external link, but tl;dr by recursively Richardson-extrapolating terms 15-20 of the partial evaluations, I get π ~ 3.14159265358974! Almost seems too good to be true.
That's a very nice identity, but I'm a little upset you didn't discuss the underlying logic and ideas that motivated this formula. For example, you could have put a bigger emphasis on the recurrent property of arctan that you used in this derivation before using it to arrive at the identity. I think Spivak's Calculus has a lot of these examples of how it is possible to create all the underlying intuition before introducing the formulas and, most importantly, the derivation. This derivation is somewhat impressive, but it would be just delightful to see you justifying and providing arguments for most, if not every, step of the process.
The rn terms are just the remainders in truncating the classic arctan series; and the truncated continued fractions are exactly those truncated series ( you should truncate at odd-square-over-2) and that’s why the convergence looks so slow.
The form for I_n makes me think of the alternating sum for pi/4=1-1/3+1/5-1/7+... And this sum is also very slowly converging. That's why I think you can directly derive the continued fraction for pi somehow from this summation. Maybe using Euler's formula?
Mathologer derives it using basic algebra from the alternating series at ruclips.net/video/WL_Yzbo1ha4/видео.html He derives a number of other formulae for pi, too. Worth a watch!
Write the given identity as pi = 4/(1+x), where x represents the rest of the continued fraction. Then x = 4/pi - 1. Then replacing that 1 with a 2 gives us the expression 4/(2+x), now just substitute to get = 4/(2+(4/pi - 1)) = 4*pi/(4+pi).
@@bsmith6276 but you can't just simply substitute as you did, since the x in the first expression is different (less by just 1, actually) to that in the second. Plus again you can't simply replace 1 by 2 because we got the whole thing via the integral I and the sequence r.
Very nice derivation. The obvious question is where does I_n come from? Is there some natural way I could have come up with it? Or if it was handed to me, is there some way to guess it would lead to an approximation for pi or a continued fraction of any sort?
Asking about integrals of this type is a very natural thing do to after seeing I_0 and I_1 as they naturally arise in your calculus progression and noticing they sum to 1. I imagine the first time this derivation was performed, it was more a case of playing with a cool function and stumbling onto a result than it was an attempt at a proof.
I think your question is linked to the usefulness of the integrals themselves. Because, in fact, we don't need them at all : we only need the existence of a sequence (r_n) such that r0 = π/4 - 1 and following the recursion relation shown in the video. I guess someone had worked on those integrals before and found out they followed this relation, leading to the identity. But this only is a way to construct the sequence rn, maybe there are others.
@@jkid1134 I guess that's pretty much what I expected, but it's a little disappointing. I was hoping there was some kind of general theory behind it, rather than just a cute trick for this special case.
@@micrapop_6390 I'd be fine if I could come up with the recurrence another way. But I don't have any intuition here. I have no idea where the integrals would come from, and I have no idea where the recurrence would come from except from the integrals. Without either of those, this proof feels like it just appeared by magic. And that means I can't use the ideas to solve any other problem.
I was interested in the motivation for the steps in this result. Brounker was a C17 English Mathematician. See here: en.wikipedia.org/wiki/William_Brouncker,_2nd_Viscount_Brouncker#Brouncker's_formula The ideas for his expansion seem to have the same source as Leibniz' series for Pi, as presented here: en.wikipedia.org/wiki/Leibniz_formula_for_π By the way, (4/Pi)+1 looks nice as a ctd fraction
One thing I've always wondered: Is there an analogous concept of a "continued polynomial root" which allows you to approximate a transcendental number using an infinite recursion of algebraic numbers? Presumably, this should reduce to the continued fraction in the case where the polynomial is restricted to be linear.
Partial answer: roots of quadratics (with integer coeffs) always have periodic continued fractions. More generally, you could apply Newton's method to a polynomial equation to get rational approximants of increasing accuracy; this coincides with continued fraction approximants in the quadratic case (not sure if it's also true for higher degree)
I'm not sure I understand your question correctly. Did you mean something like this? a_0=p_0(a_1), a_1=p_1(a_2), a_2=p_2(a_3) .... I don't know if this has a name or not or if anyone has studied this.
How does he know that he should use this integral....... to get a regression relation and then use this relation for pi?I mean, is it possible to consider another integral whose answer is a ratio of pi? Is this the simplest integral that produces pi, and that's the reason for choosing it? If we choose another integral, will the formula obtained for pi be different?Or in other words, is this formula unique? What is the property of this interval between zero and one that he uses in most of his integrals?Is the reason for choosing it integral convergence?Is?
Can you derive the standard continued fraction representation to e? [2; 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1,...]. i find it fascinating and mysterious. Why the even numbers and why in a repeating pattern three units long? So cool
If you allow 'incorrect' notation, it can also be written as [1; 0, 1, 1, 2, 1, 1, 4, 1, 1, 6, 1, ...] where the pattern is (1,n,1) where n keeps going up by 2 each repetition.
Perfect timing: I had just continued reading Borwein and Bailey's 2003 book, 'Mathematics by Experiment' when I watched your video. Page 140 mentions 'spigot algorithms': the ones used in the book are based on formulas that are sort of the continued product analogues to continued fractions. There's one for pi, but with different parameters also one for e: so, is there a continued fraction for e? (BTW, the spigot algorithm for pi converges more quickly than the continued fraction one in the video does. 10 terms gives 3.141 already. May be worth another video?)
Applying the ε-Algorithm to the initial five terms of the sequence ("13^2" is the fifth term) for instance, the absolute error becomes less than 1,0E-04.
What took you longer? Mastering mathematics OR figuring out how to create high end production quality Thumbnails? That is killa pic of the continued fraction for PI!!!!! Still slightly depressing that the integral you wrote on board is completely unmotivated and after the fact.
Continued fractions are an extraordinary example of complicated math becoming simple :) ruclips.net/video/zCFF1l7NzVQ/видео.html That link goes to a one hour explanation of all things continued and it's fascinating.
Programmed this in Rust, and ending at 999^2 only gives 2 accurate digits after the decimal point. Averaging the two results at 999^2 and 1001^2 gives 5 accurate digits after the decimal point. Also tried averaging four sequential results, and made almost no difference versus two.
How close was the average of two consecutive steps?
Because of the increasing numerator, that causes the convergence to be slow
Yes, I was wondering how well this converged. It's very pretty, though!
@@artsmith1347 Even better than averaging, you can *extrapolate* the values to get quadratic instead of linear convergence. This is called Richardson extrapolation. Observing that it appears to converge linearly in the number of terms, you can model the convergence as `f(n) = π + c/n = f(∞) + c/n` where c is some constant and n is the number of terms (being a bit cavalier about alternating signs, though it's not hard to be more careful). All you have to do is plug in a couple values of n and solve for f(∞), as if you used an infinite number of terms! In reality, this generally just increases the order of convergence by one or two degrees, but using f(20) ~ 3.0939 and f(22) ~ 3.09809, I get f(∞) = (22 * f(22) - 20 * f(20) / (22 - 20) = 3.1396. Which isn't great either, but it's equivalent to somewhere in the ballpark of 400 terms for no extra effort!
Oops, maybe it won't let me post an external link, but tl;dr by recursively Richardson-extrapolating terms 15-20 of the partial evaluations, I get π ~ 3.14159265358974! Almost seems too good to be true.
Love this. I've always found continued fractions fascinating.
ruclips.net/video/zCFF1l7NzVQ/видео.html
Happy Pi Approximation Day, everyone! 😀
That's a very nice identity, but I'm a little upset you didn't discuss the underlying logic and ideas that motivated this formula. For example, you could have put a bigger emphasis on the recurrent property of arctan that you used in this derivation before using it to arrive at the identity. I think Spivak's Calculus has a lot of these examples of how it is possible to create all the underlying intuition before introducing the formulas and, most importantly, the derivation. This derivation is somewhat impressive, but it would be just delightful to see you justifying and providing arguments for most, if not every, step of the process.
That was run and straightforward.
I usually dislike continued fractions.
Thank you, professor.
The rn terms are just the remainders in truncating the classic arctan series; and the truncated continued fractions are exactly those truncated series ( you should truncate at odd-square-over-2) and that’s why the convergence looks so slow.
The form for I_n makes me think of the alternating sum for pi/4=1-1/3+1/5-1/7+... And this sum is also very slowly converging. That's why I think you can directly derive the continued fraction for pi somehow from this summation. Maybe using Euler's formula?
Mathologer derives it using basic algebra from the alternating series at ruclips.net/video/WL_Yzbo1ha4/видео.html He derives a number of other formulae for pi, too. Worth a watch!
Thanks for sharing, Professor! Your work is really appreciated 😊
I am amazed by the velocity that Michael has to write, but he is even speeder when he erases!
Always remember to Like, Comment and Subscribe. Interesting to see how continued fractions like this are derived.
Thank you Prof, that scratched a long-standing itch
I wonder what happens when you replace that 1 with a 2.
Write the given identity as pi = 4/(1+x), where x represents the rest of the continued fraction. Then x = 4/pi - 1. Then replacing that 1 with a 2 gives us the expression 4/(2+x), now just substitute to get = 4/(2+(4/pi - 1)) = 4*pi/(4+pi).
4pi/(4+pi)
@@bsmith6276 but you can't just simply substitute as you did, since the x in the first expression is different (less by just 1, actually) to that in the second. Plus again you can't simply replace 1 by 2 because we got the whole thing via the integral I and the sequence r.
@@jaafars.mahdawi6911 The 'x' is the rest of the continued fraction. It's the same, since nothing changes in the _rest_ of the continued fraction.
@@dlevi67 maybe you need to think twice, my friend, or maybe i do.
Nice and remarkable: pi keeps surprising, just as this channel does: thanks for sharing.
Very nice derivation. The obvious question is where does I_n come from? Is there some natural way I could have come up with it? Or if it was handed to me, is there some way to guess it would lead to an approximation for pi or a continued fraction of any sort?
Asking about integrals of this type is a very natural thing do to after seeing I_0 and I_1 as they naturally arise in your calculus progression and noticing they sum to 1. I imagine the first time this derivation was performed, it was more a case of playing with a cool function and stumbling onto a result than it was an attempt at a proof.
I think your question is linked to the usefulness of the integrals themselves. Because, in fact, we don't need them at all : we only need the existence of a sequence (r_n) such that r0 = π/4 - 1 and following the recursion relation shown in the video.
I guess someone had worked on those integrals before and found out they followed this relation, leading to the identity. But this only is a way to construct the sequence rn, maybe there are others.
@@jkid1134 I guess that's pretty much what I expected, but it's a little disappointing. I was hoping there was some kind of general theory behind it, rather than just a cute trick for this special case.
@@mostly_mental you could contact the guy who wrote the proof, I bet he'd be more than happy to tell you
@@micrapop_6390 I'd be fine if I could come up with the recurrence another way. But I don't have any intuition here. I have no idea where the integrals would come from, and I have no idea where the recurrence would come from except from the integrals. Without either of those, this proof feels like it just appeared by magic. And that means I can't use the ideas to solve any other problem.
I was interested in the motivation for the steps in this result. Brounker was a C17 English Mathematician. See here:
en.wikipedia.org/wiki/William_Brouncker,_2nd_Viscount_Brouncker#Brouncker's_formula
The ideas for his expansion seem to have the same source as Leibniz' series for Pi, as presented here:
en.wikipedia.org/wiki/Leibniz_formula_for_π
By the way, (4/Pi)+1 looks nice as a ctd fraction
11:15 it looks like you're trying to your absolute hardest to magically push the equation out of the board to get numbers floating in the air
Also check out L.J. Lange's Elegant Continued Fraction for Pi
That zero was so filthy! Hahahahshsh brilliant!
Speaking about good approximations of pi, you could shed some light on algorithms like Ramanujana or Bailey-Borwein-Plouffes to calculate pi.
All the pretty formulas for pi converge so slowly, and all the fast converging formulas are often ugly. We just can't have nice things.
I've noticed that also! It's crazy! :)
"Carry On" mathematician Penn.
عظيم.العدد pi لاتنقضي معجزاته
import math
def f(n,m):
if m==0 :
return 1
return 2+ n*n/f(n+2, m-1)
for i in range(1,900) :
print(4/(1+1/f(3,i)) - math.pi)
One thing I've always wondered: Is there an analogous concept of a "continued polynomial root" which allows you to approximate a transcendental number using an infinite recursion of algebraic numbers? Presumably, this should reduce to the continued fraction in the case where the polynomial is restricted to be linear.
Partial answer: roots of quadratics (with integer coeffs) always have periodic continued fractions. More generally, you could apply Newton's method to a polynomial equation to get rational approximants of increasing accuracy; this coincides with continued fraction approximants in the quadratic case (not sure if it's also true for higher degree)
I'm not sure I understand your question correctly. Did you mean something like this?
a_0=p_0(a_1), a_1=p_1(a_2), a_2=p_2(a_3) ....
I don't know if this has a name or not or if anyone has studied this.
might be a terrible approximation but damn that's beautiful.
From Euler's c.f. formula, this is just arctan(1) evaluated one term at a time!
@3:48: "OK, so now let's do sss...OK, so now let's do ONE small calculation..."
Fin love this dude. :D
How does he know that he should use this integral....... to get a regression relation and then use this relation for pi?I mean, is it possible to consider another integral whose answer is a ratio of pi? Is this the simplest integral that produces pi, and that's the reason for choosing it? If we choose another integral, will the formula obtained for pi be different?Or in other words, is this formula unique?
What is the property of this interval between zero and one that he uses in most of his integrals?Is the reason for choosing it integral convergence?Is?
When you changed the 1 to 1 squared I was sure you would change the first 1+ to 2^0 for aesthetics
Wonderful video as ever, thanks!
How about trying the Shanks transform? They're designed to handle non-linearly convergent series that alternate above/below the true value.
Can you derive the standard continued fraction representation to e? [2; 1, 2, 1, 1, 4, 1, 1, 6, 1, 1, 8, 1,...]. i find it fascinating and mysterious. Why the even numbers and why in a repeating pattern three units long? So cool
If you allow 'incorrect' notation, it can also be written as [1; 0, 1, 1, 2, 1, 1, 4, 1, 1, 6, 1, ...] where the pattern is (1,n,1) where n keeps going up by 2 each repetition.
Checked both of my continued fraction books in my library, and neither has that proof :
How would you prove arctan(1) = pi/4 if all you knew about it was its Maclaurin expansion or its derivative?
It seems like the sequence roughly equals to π+(-1)^n/n, but I don't know if the sequence still behaves like this when n approaches infinity.
Perfect timing: I had just continued reading Borwein and Bailey's 2003 book, 'Mathematics by Experiment' when I watched your video. Page 140 mentions 'spigot algorithms': the ones used in the book are based on formulas that are sort of the continued product analogues to continued fractions. There's one for pi, but with different parameters also one for e: so, is there a continued fraction for e? (BTW, the spigot algorithm for pi converges more quickly than the continued fraction one in the video does. 10 terms gives 3.141 already. May be worth another video?)
Small mistake at 11.07
It should be 2n+3 at the denominator not 2n+1
And that's a good place to st-
I think the video didn't stop at that good of a place
Amazing, like mind acrobatics.
Applying the ε-Algorithm to the initial five terms of the sequence ("13^2" is the fifth term) for instance, the absolute error becomes less than 1,0E-04.
Doesn’t the existence of the continued fraction where all the terms are summed imply that pi is irrational?
A nice result but too slowly converging to be of use in calculating pi, I suppose.
Wonder why it zigzags as opposed to approaching pi from one side.
Wanna know why? Help me build my universal device hijackers first!
Is there a theorem that allows us to deduce the convergence of this non-standard type of continued fraction?
What took you longer?
Mastering mathematics OR figuring out how to create high end production quality Thumbnails?
That is killa pic of the continued fraction for PI!!!!!
Still slightly depressing that the integral you wrote on board is completely unmotivated and after the fact.
Lovely video. Unfortunately convergence seems to be sloooooow. Perhaps no surprisingly as, after all, arctans are kinda logs in disguise.
Finally I see something that’s real math theory! And it’s wrong!
Wrong?
How do you define this endless fraction? Some kind of limit? I am confused.
Yes, the limit of fractions with a finite number of steps
And that's a good place to s...
To WHAT Michael? We need to know! :D
Continued fractions are an extraordinary example of complicated math becoming simple :)
ruclips.net/video/zCFF1l7NzVQ/видео.html
That link goes to a one hour explanation of all things continued and it's fascinating.
I was following this pretty well until you started talking about the arse of n. I lost it after that.
3:49 small editing mistake
Interesting!
Cool! 😎
:D