Sunday, July 23, 2023

bonded to bounds

And compelled to compulsions... 

Lets begin at the ending by asking... 

"The question is, would the $a_n$ ever converge to some value between $1.414$ and $1.5$.. and if it did, what is that value?

Do you know?"

If not, lets rewind, and begin somewhere in the middle grounds by trying to contemplate the bounds of an element in a recursive sequence as below:

$a_0 = 2$, $a_{n+1} = \frac{a_n}{2} + \frac{1}{a_n}$

Of course, we can calculate $a_1 = \frac{3}{2}$ 

So, we know that our starting point is of the form something like $1 + \frac{1}{x}$ where $x \geq 1$ and $x \in \mathbb{R}$

Lets rewrite $a_{n+1}$ as $a_{n+1} = \frac{{a_n}^2 + 2}{2.a_n}$ and plug the $a_n = 1 + \frac{1}{x}$ thingy... 

Then we have $a_{n+1} = \frac{{a_n}^2 + 2}{2.a_n} = \frac{1+\frac{1}{x^2}+\frac{2}{x}+2}{2 + \frac{2}{x}}$

A bit of rearrangement and ahem ahem

$a_{n+1} = 1 + \frac{1}{2}.\frac{1 + \frac{1}{x^2}}{1 + \frac{1}{x}}$

So, what are the bounds for this value?

Well, it depends on the term: $\frac{1 + \frac{1}{x^2}}{1 + \frac{1}{x}}$ isn't it?

But its trickier to think of how this term would scale with $x$, so lets rewrite this as $ T = \frac{x^2 + 1}{x^2 + x}$ 

This gives us a good handle on $T$ that as $x\to\infty$:  $T\to1$, but this is also true when $x=1$

However $x^2 + 1$ will be less that $x^2 + x$ for some finite $x\gt1$

Anyhow, in a hand wavy fashion, initially $x^2 + x$ will be slightly more larger than $x^2 + 1$ and then as $x$ grows, $x^2$ dominates, and thus, the whole factor $T$ will turn around, isn't it? (Something very roughly similar to how $x^2$ lags $x$ till $x\lt1$ and then, it takes over) 

Lets be lazy and check this for $x=2$, $x=2.5$, and $x=3$

for $x = 2, T = 0.833$, for $x = 2.5, T = 0.828$, and for $x=3, T = 0.833$ again 

Fortune favors the brave :-) our chosen 3 points gave us the approximate "critical" point.

By the way, lets also validate our intuition about this turning around curvy thing about the term $T$:

That's nice, it seems to do that turning around, and dipping down to $0.8$ ish before clipping to $1$ for all $x\gt1$

Just to remind ourselves, our $a_{n+1}$ is something of the form $1 + \frac{T}{2}$

Thus we have, for $a_1$ and above, the upper bound as about $1.5$ and the lower bound as about $1.414$

Now, the question is, would the $a_n$ ever converge to some value between $1.414$ and $1.5$.. and if it did, what is that value?

Do you know? No? For that, we need to begin at the beginning ;), and go to Babylon, or ?

We can just equate $a_{n+1}$ to $a_n$ because that's what convergence means, right?

And when we do that, and a little algebra, we end up with $a_n=\sqrt{2}$ :-) 

And thus we can write a sequence to approximate the square root of any number $X$ in the form:

$a_{n+1} = \frac{X-1}{X}.a_n + \frac{1}{a_n}$, or can we?? What should be the property of the expression on the r.h.s. to be able to use it in a recursive/iterative approximation ?