a continued fraction for pi

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 85

  • @The1RandomFool
    @The1RandomFool Год назад +91

    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 Год назад +3

      How close was the average of two consecutive steps?

    • @ingiford175
      @ingiford175 Год назад +6

      Because of the increasing numerator, that causes the convergence to be slow

    • @zh84
      @zh84 Год назад +2

      Yes, I was wondering how well this converged. It's very pretty, though!

    • @rickyreusser4895
      @rickyreusser4895 Год назад +2

      @@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 Год назад +2

      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 Год назад +31

    Love this. I've always found continued fractions fascinating.

    • @kendebusk2540
      @kendebusk2540 Год назад

      ruclips.net/video/zCFF1l7NzVQ/видео.html

  • @Nikolas_Davis
    @Nikolas_Davis Год назад +7

    Happy Pi Approximation Day, everyone! 😀

  • @timothymattnew
    @timothymattnew Год назад +18

    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.

  • @manucitomx
    @manucitomx Год назад +6

    That was run and straightforward.
    I usually dislike continued fractions.
    Thank you, professor.

  • @jessemckeown5628
    @jessemckeown5628 Год назад +7

    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.

  • @shantanunene4389
    @shantanunene4389 Год назад +17

    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 Год назад +5

      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!

  • @chrisbhag
    @chrisbhag Год назад +10

    Thanks for sharing, Professor! Your work is really appreciated 😊

  • @alvinuli5174
    @alvinuli5174 Год назад

    I am amazed by the velocity that Michael has to write, but he is even speeder when he erases!

  • @paulkohl9267
    @paulkohl9267 Год назад +3

    Always remember to Like, Comment and Subscribe. Interesting to see how continued fractions like this are derived.

  • @stephenhamer8192
    @stephenhamer8192 Год назад

    Thank you Prof, that scratched a long-standing itch

  • @sorrymyenglishbad2535
    @sorrymyenglishbad2535 Год назад +38

    I wonder what happens when you replace that 1 with a 2.

    • @bsmith6276
      @bsmith6276 Год назад +26

      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 Год назад +6

      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 Год назад +1

      @@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.

  • @bennyloodts5497
    @bennyloodts5497 Год назад +3

    Nice and remarkable: pi keeps surprising, just as this channel does: thanks for sharing.

  • @mostly_mental
    @mostly_mental Год назад +24

    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 Год назад +3

      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 Год назад +1

      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 Год назад +1

      @@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.

  • @stephenhamer8192
    @stephenhamer8192 Год назад +6

    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

  • @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

  • @sjtclange
    @sjtclange 26 дней назад

    Also check out L.J. Lange's Elegant Continued Fraction for Pi

  • @morgengabe1
    @morgengabe1 Год назад +1

    That zero was so filthy! Hahahahshsh brilliant!

  • @krtschil
    @krtschil Год назад +1

    Speaking about good approximations of pi, you could shed some light on algorithms like Ramanujana or Bailey-Borwein-Plouffes to calculate pi.

  • @JM-us3fr
    @JM-us3fr Год назад +2

    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.

  • @roberttelarket4934
    @roberttelarket4934 Год назад +1

    "Carry On" mathematician Penn.

  • @minwithoutintroduction
    @minwithoutintroduction Год назад +3

    عظيم.العدد pi لاتنقضي معجزاته

  • @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)

  • @ianmathwiz7
    @ianmathwiz7 Год назад +3

    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 Год назад +3

      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.

  • @Anonymous-zp4hb
    @Anonymous-zp4hb Год назад +1

    might be a terrible approximation but damn that's beautiful.

  • @wyattstevens8574
    @wyattstevens8574 Год назад

    From Euler's c.f. formula, this is just arctan(1) evaluated one term at a time!

  • @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

  • @MortezaSabzian-db1sl
    @MortezaSabzian-db1sl Год назад +2

    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?

  • @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!

  • @nicholaselias9312
    @nicholaselias9312 Год назад

    How about trying the Shanks transform? They're designed to handle non-linearly convergent series that alternate above/below the true value.

  • @looney1023
    @looney1023 Год назад +3

    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 Год назад +1

      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 :

  • @txikitofandango
    @txikitofandango Год назад +1

    How would you prove arctan(1) = pi/4 if all you knew about it was its Maclaurin expansion or its derivative?

  • @周品宏-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.

  • @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?)

  • @khoozu7802
    @khoozu7802 Год назад

    Small mistake at 11.07
    It should be 2n+3 at the denominator not 2n+1

  • @CielMC
    @CielMC Год назад +2

    And that's a good place to st-
    I think the video didn't stop at that good of a place

  • @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.

  • @douglasmagowan2709
    @douglasmagowan2709 Год назад

    Doesn’t the existence of the continued fraction where all the terms are summed imply that pi is irrational?

  • @Jack_Callcott_AU
    @Jack_Callcott_AU Год назад +2

    A nice result but too slowly converging to be of use in calculating pi, I suppose.

  • @tenjan75
    @tenjan75 Год назад

    Wonder why it zigzags as opposed to approaching pi from one side.

  • @robberbarron8161
    @robberbarron8161 Год назад

    Wanna know why? Help me build my universal device hijackers first!

  • @MichaelRothwell1
    @MichaelRothwell1 Год назад

    Is there a theorem that allows us to deduce the convergence of this non-standard type of continued fraction?

  • @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.

  • @joigus
    @joigus Год назад

    Lovely video. Unfortunately convergence seems to be sloooooow. Perhaps no surprisingly as, after all, arctans are kinda logs in disguise.

  • @robberbarron8161
    @robberbarron8161 Год назад

    Finally I see something that’s real math theory! And it’s wrong!

  • @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

  • @scialomy
    @scialomy Год назад

    And that's a good place to s...

    • @scialomy
      @scialomy Год назад

      To WHAT Michael? We need to know! :D

  • @kendebusk2540
    @kendebusk2540 Год назад

    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.

  • @titwtomos
    @titwtomos Год назад

    I was following this pretty well until you started talking about the arse of n. I lost it after that.

  • @sametyetimoglu6026
    @sametyetimoglu6026 Год назад

    3:49 small editing mistake

  • @jakobthomsen1595
    @jakobthomsen1595 Год назад

    Interesting!

  • @TheMemesofDestruction
    @TheMemesofDestruction Год назад

    Cool! 😎

  • @beaverbuoy3011
    @beaverbuoy3011 Год назад

    :D