Hello internet this is Oscar Veliz for
this video I'll be going over an
interesting concept known as
sublinear convergence as part of the
mega favorite numbers project
where I'll be discussing my favorite
number over a million
this number is actually the largest
number i've talked about in my channel
so far
it comes from a video on computing pi
using Machin-like formulae
I'd recommend that you watch that video
but it's not imperative to understand
this one
in that video i discuss how pi is equal
to four times the arctangent of one
and then you can solve it using a series
that series was given by James Gregory
in a letter to John Collins
it was also independently proven by Leibniz
in a history of pie by Petr Beckman
he writes that it converges so solely
that De Lagny
showed that it needs 10 to the 50 terms
in order to get 100 decimal places of pi
in essence this series which we can
write as 4 times that summation
for 100 decimal digits of pi needs 10 to
the 50
terms hashtag mega favorite numbers
to find where this number comes from
we'll need to use our order formula
i recommend watching my video on what is
order of convergence but in essence
e is our current error and e sub n plus
1 is our next error
where m is a constant between 0 and 1 and
alpha is our order generally the higher
the alpha the faster the convergence
here are the first 20 iterations of the
Gregory-Leibniz series
and even after a hundred iterations
we're still not even around three or
four and four
in fact we don't get to 3.14 until after
600 iterations
another 2,000 iterations to get three
decimal digits
and even more to get four decimal digits
if we compute the errors after every
iteration we can compute
our alpha and m
sum around four digits of accuracy m
starts to hover around
0.999 and alpha hovers around 0.9999
because alpha never gets to 1 we call
this sublinear
and we can use these terms for alpha and
m to figure out how many iterations it
takes to get 100 decimal digits of accuracy
using what we know for alpha and m we
plug them into our error equation
then take the log of both sides to
extract that exponent
afterwards use properties of logs to
split up that term on the right side
which we can simplify then taking this
iteration function we can step it back
one iteration
then using substitution we can come up
with this form to find our final
error which is our tolerance epsilon it
would give us something that looks like this
we would then need to figure out how
many terms are in the sequence
given from our first error of let's just
say 10 to the minus 1
to our final error of 10 to the minus 100
giving a form that looks like this
let's clean up a little and then this is
the wrong way to do it but let's just
assume that 0.9999 is equal to 1.
this greatly simplifies our equations so
that it gives us a form that looks like this
move the one over and we get negative 99
is equal to this function essentially
saying that
n is about 200 000 iterations which we
know is not true
because 100 000 iterations barely give
us four decimals of accuracy
to do it the right way we assume that
0.9999 is not equal to one
therefore we get a function that looks
like this but don't panic
let's clean up a little and using this
product on the left
this eventually reaches zero in the
limit so we'll actually ignore it
this greatly simplifies how we'll solve
for n actually we don't need to
technically solve for it
because De Lagny gave us 10 to the 50.
let's try plugging that into this summation
and simplifying it a little when we plug
that summation
into a solver it gives us an output of
about negative 4 which is nowhere near -100
so what went wrong let's ignore the
numbers and just focus on
m and alpha in this instance what if our
alpha was
slightly larger and closer to 1 at 0.99999
and our m was a little bit smaller 0.99
this when plugged in gives us a decimal
output of negative 400 and something
which is four times as accurate as the 100
we thought
this means that 10 to 50 is somewhere
actually in the ballpark or range
depending on what you actually choose
for m and alpha
some notes about the sequence are that i
actually couldn't find a primary source
from De Lany showing how he came up with this
number
but it does seem numerically reasonable
depending what you choose for alpha and m
actually made this video more to talk
about sublinear convergence
as i think it's a pretty cool topic for
faster ways of finding pi including 100
decimal digits check out my video on
Machin-like formula
there actually are ways to speed up the
convergence of the sublinear sequence
but those are topics i'll leave for another
video
example color i used for this video will
be hosted on github
as always thank you for watching if
you're new to the channel
check out my other videos where i cover
many numerical methods
and provide lots of example code and
even cool fractals
the next videos i'll be posting are
going to be the long awaited Jarratt's method
and Brent's minimization method so
definitely subscribe to the channel and
turn on the bell so you don't miss them
