a continued fraction for pi

  Рет қаралды 22,601

Michael Penn

Michael Penn

Күн бұрын

Пікірлер: 85
@The1RandomFool
@The1RandomFool Жыл бұрын
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
@artsmith1347 Жыл бұрын
How close was the average of two consecutive steps?
@ingiford175
@ingiford175 Жыл бұрын
Because of the increasing numerator, that causes the convergence to be slow
@zh84
@zh84 Жыл бұрын
Yes, I was wondering how well this converged. It's very pretty, though!
@rickyreusser4895
@rickyreusser4895 Жыл бұрын
@@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!
@rickyreusser4895
@rickyreusser4895 Жыл бұрын
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.
@DrR0BERT
@DrR0BERT Жыл бұрын
Love this. I've always found continued fractions fascinating.
@kendebusk2540
@kendebusk2540 Жыл бұрын
kzbin.info/www/bejne/sHSpd2SibLOtjLM
@timothymattnew
@timothymattnew Жыл бұрын
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.
@Nikolas_Davis
@Nikolas_Davis Жыл бұрын
Happy Pi Approximation Day, everyone! 😀
@shantanunene4389
@shantanunene4389 Жыл бұрын
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?
@davidgould9431
@davidgould9431 Жыл бұрын
Mathologer derives it using basic algebra from the alternating series at kzbin.info/www/bejne/jX3Ciq2YpJabl5Y He derives a number of other formulae for pi, too. Worth a watch!
@jessemckeown5628
@jessemckeown5628 Жыл бұрын
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.
@manucitomx
@manucitomx Жыл бұрын
That was run and straightforward. I usually dislike continued fractions. Thank you, professor.
@paulkohl9267
@paulkohl9267 Жыл бұрын
Always remember to Like, Comment and Subscribe. Interesting to see how continued fractions like this are derived.
@mostly_mental
@mostly_mental Жыл бұрын
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?
@jkid1134
@jkid1134 Жыл бұрын
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.
@micrapop_6390
@micrapop_6390 Жыл бұрын
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.
@mostly_mental
@mostly_mental Жыл бұрын
@@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.
@jkid1134
@jkid1134 Жыл бұрын
@@mostly_mental you could contact the guy who wrote the proof, I bet he'd be more than happy to tell you
@mostly_mental
@mostly_mental Жыл бұрын
@@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.
@chrisbhag
@chrisbhag Жыл бұрын
Thanks for sharing, Professor! Your work is really appreciated 😊
@sjtclange
@sjtclange 29 күн бұрын
Also check out L.J. Lange's Elegant Continued Fraction for Pi
@stephenhamer8192
@stephenhamer8192 Жыл бұрын
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
@alvinuli5174
@alvinuli5174 Жыл бұрын
I am amazed by the velocity that Michael has to write, but he is even speeder when he erases!
@bennyloodts5497
@bennyloodts5497 Жыл бұрын
Nice and remarkable: pi keeps surprising, just as this channel does: thanks for sharing.
@krtschil
@krtschil Жыл бұрын
Speaking about good approximations of pi, you could shed some light on algorithms like Ramanujana or Bailey-Borwein-Plouffes to calculate pi.
@jellybabiesarecool4657
@jellybabiesarecool4657 Жыл бұрын
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
@sorrymyenglishbad2535
@sorrymyenglishbad2535 Жыл бұрын
I wonder what happens when you replace that 1 with a 2.
@bsmith6276
@bsmith6276 Жыл бұрын
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).
@aimanchrakoua8955
@aimanchrakoua8955 Жыл бұрын
4pi/(4+pi)
@jaafars.mahdawi6911
@jaafars.mahdawi6911 Жыл бұрын
@@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.
@dlevi67
@dlevi67 Жыл бұрын
@@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.
@jaafars.mahdawi6911
@jaafars.mahdawi6911 Жыл бұрын
@@dlevi67 maybe you need to think twice, my friend, or maybe i do.
@stephenhamer8192
@stephenhamer8192 Жыл бұрын
Thank you Prof, that scratched a long-standing itch
@romanbobyor
@romanbobyor Жыл бұрын
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)
@nicholaselias9312
@nicholaselias9312 Жыл бұрын
How about trying the Shanks transform? They're designed to handle non-linearly convergent series that alternate above/below the true value.
@ianmathwiz7
@ianmathwiz7 Жыл бұрын
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.
@leostein128
@leostein128 Жыл бұрын
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)
@周品宏-o7w
@周品宏-o7w Жыл бұрын
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.
@wyattstevens8574
@wyattstevens8574 Жыл бұрын
From Euler's c.f. formula, this is just arctan(1) evaluated one term at a time!
@minwithoutintroduction
@minwithoutintroduction Жыл бұрын
عظيم.العدد pi لاتنقضي معجزاته
@MortezaSabzian-db1sl
@MortezaSabzian-db1sl Жыл бұрын
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?
@roberttelarket4934
@roberttelarket4934 Жыл бұрын
"Carry On" mathematician Penn.
@JM-us3fr
@JM-us3fr Жыл бұрын
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.
@itzakehrenberg3449
@itzakehrenberg3449 Жыл бұрын
I've noticed that also! It's crazy! :)
@looney1023
@looney1023 Жыл бұрын
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
@ingiford175
@ingiford175 Жыл бұрын
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.
@ingiford175
@ingiford175 Жыл бұрын
Checked both of my continued fraction books in my library, and neither has that proof :
@timbotemon
@timbotemon Жыл бұрын
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!
@morgengabe1
@morgengabe1 Жыл бұрын
That zero was so filthy! Hahahahshsh brilliant!
@Anonymous-zp4hb
@Anonymous-zp4hb Жыл бұрын
might be a terrible approximation but damn that's beautiful.
@txikitofandango
@txikitofandango Жыл бұрын
How would you prove arctan(1) = pi/4 if all you knew about it was its Maclaurin expansion or its derivative?
@gregsarnecki7581
@gregsarnecki7581 Жыл бұрын
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?)
@MichaelRothwell1
@MichaelRothwell1 Жыл бұрын
Is there a theorem that allows us to deduce the convergence of this non-standard type of continued fraction?
@周品宏-o7w
@周品宏-o7w Жыл бұрын
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.
@tenjan75
@tenjan75 Жыл бұрын
Wonder why it zigzags as opposed to approaching pi from one side.
@CielMC
@CielMC Жыл бұрын
And that's a good place to st- I think the video didn't stop at that good of a place
@khoozu7802
@khoozu7802 Жыл бұрын
Small mistake at 11.07 It should be 2n+3 at the denominator not 2n+1
@artichaug1719
@artichaug1719 Жыл бұрын
Amazing, like mind acrobatics.
@vitorpera5853
@vitorpera5853 Жыл бұрын
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.
@robberbarron8161
@robberbarron8161 Жыл бұрын
Wanna know why? Help me build my universal device hijackers first!
@MyOneFiftiethOfADollar
@MyOneFiftiethOfADollar Жыл бұрын
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.
@quandarkumtanglehairs4743
@quandarkumtanglehairs4743 Жыл бұрын
@3:48: "OK, so now let's do sss...OK, so now let's do ONE small calculation..." Fin love this dude. :D
@joigus
@joigus Жыл бұрын
Lovely video. Unfortunately convergence seems to be sloooooow. Perhaps no surprisingly as, after all, arctans are kinda logs in disguise.
@gavasiarobinssson5108
@gavasiarobinssson5108 Жыл бұрын
How do you define this endless fraction? Some kind of limit? I am confused.
@user-nb6zu3rk4f
@user-nb6zu3rk4f Жыл бұрын
Yes, the limit of fractions with a finite number of steps
@Jack_Callcott_AU
@Jack_Callcott_AU Жыл бұрын
A nice result but too slowly converging to be of use in calculating pi, I suppose.
@douglasmagowan2709
@douglasmagowan2709 Жыл бұрын
Doesn’t the existence of the continued fraction where all the terms are summed imply that pi is irrational?
@robberbarron8161
@robberbarron8161 Жыл бұрын
Finally I see something that’s real math theory! And it’s wrong!
@itzakehrenberg3449
@itzakehrenberg3449 Жыл бұрын
Wrong?
@kendebusk2540
@kendebusk2540 Жыл бұрын
Continued fractions are an extraordinary example of complicated math becoming simple :) kzbin.info/www/bejne/sHSpd2SibLOtjLM That link goes to a one hour explanation of all things continued and it's fascinating.
@scialomy
@scialomy Жыл бұрын
And that's a good place to s...
@scialomy
@scialomy Жыл бұрын
To WHAT Michael? We need to know! :D
@titwtomos
@titwtomos Жыл бұрын
I was following this pretty well until you started talking about the arse of n. I lost it after that.
@jakobthomsen1595
@jakobthomsen1595 Жыл бұрын
Interesting!
@TheMemesofDestruction
@TheMemesofDestruction Жыл бұрын
Cool! 😎
@sametyetimoglu6026
@sametyetimoglu6026 Жыл бұрын
3:49 small editing mistake
@beaverbuoy3011
@beaverbuoy3011 Жыл бұрын
:D
One of my favorite identities.
20:47
Michael Penn
Рет қаралды 27 М.
Deriving Euler's formula four ways!
26:07
Michael Penn
Рет қаралды 38 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 7 МЛН
бабл ти гель для душа // Eva mash
01:00
EVA mash
Рет қаралды 10 МЛН
風船をキャッチしろ!🎈 Balloon catch Challenges
00:57
はじめしゃちょー(hajime)
Рет қаралды 88 МЛН
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,5 МЛН
Infinite fractions and the most irrational number
13:29
Mathologer
Рет қаралды 626 М.
a formula for the "circumference" of an ellipse.
20:45
Michael Penn
Рет қаралды 81 М.
A Wallis-type product for e.
27:42
Michael Penn
Рет қаралды 17 М.
Can You Guess What This Infinite Fraction Equals?
14:48
Euler's other constant
23:28
Michael Penn
Рет қаралды 36 М.
Ramanujan's easiest hard infinity monster (Mathologer Masterclass)
26:45
these numbers are "best friends"
25:23
Michael Penn
Рет қаралды 25 М.
How on Earth does ^.?$|^(..+?)\1+$ produce primes?
18:37
Stand-up Maths
Рет қаралды 410 М.
an absurd approach to a simple mathematics problem
14:57
Michael Penn
Рет қаралды 22 М.
Climbing past the complex numbers.
30:31
Michael Penn
Рет қаралды 131 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 7 МЛН