danago
Gold Member
- 1,118
- 4
Hi. I only just recently found out about an algorithm for calculating the square roots of a number.
Lets say i want to evaluate [tex]\sqrt {n}[/tex]. I can make an approximation by inspection, and say [tex]\sqrt n \approx \frac{a}{b}[/tex]. Now, using this approximation, i can write:
[tex] \left[ {\begin{array}{*{20}c}<br /> 1 & n \\<br /> 1 & 1 \\<br /> \end{array}} \right]\left[ {\begin{array}{*{20}c}<br /> a \\<br /> b \\<br /> \end{array}} \right] = \left[ {\begin{array}{*{20}c}<br /> {a + bn} \\<br /> {a + b} \\<br /> \end{array}} \right][/tex]
Treating the resultant matrix as a fraction ([tex] \frac{{a + bn}}{{a + b}}[/tex]
), i have a better approximation of [tex]\sqrt {n}[/tex]. If i keep repeating this method with the new approximation, over and over again, i get a more accurate answer. So the next step would be:
[tex] \left[ {\begin{array}{*{20}c}<br /> 1 & n \\<br /> 1 & 1 \\<br /> \end{array}} \right]\left[ {\begin{array}{*{20}c}<br /> {a + bn} \\<br /> {a + b} \\<br /> \end{array}} \right] = \left[ {\begin{array}{*{20}c}<br /> {a + an + 2bn} \\<br /> {2a + b + bn} \\<br /> \end{array}} \right][/tex]
And [tex] \frac{{a + an + 2bn}}{{2a + b + bn}}[/tex] would be an even better approximation to [tex]\sqrt {n}[/tex].
Even if the starting approximation is way off, if a lot of iterations are complete, the answer will still be accurate.
Im just wondering, why does this method work? Is there a name for this method, or anywhere i can look to find more information?
Thanks,
Dan.
Lets say i want to evaluate [tex]\sqrt {n}[/tex]. I can make an approximation by inspection, and say [tex]\sqrt n \approx \frac{a}{b}[/tex]. Now, using this approximation, i can write:
[tex] \left[ {\begin{array}{*{20}c}<br /> 1 & n \\<br /> 1 & 1 \\<br /> \end{array}} \right]\left[ {\begin{array}{*{20}c}<br /> a \\<br /> b \\<br /> \end{array}} \right] = \left[ {\begin{array}{*{20}c}<br /> {a + bn} \\<br /> {a + b} \\<br /> \end{array}} \right][/tex]
Treating the resultant matrix as a fraction ([tex] \frac{{a + bn}}{{a + b}}[/tex]
), i have a better approximation of [tex]\sqrt {n}[/tex]. If i keep repeating this method with the new approximation, over and over again, i get a more accurate answer. So the next step would be:
[tex] \left[ {\begin{array}{*{20}c}<br /> 1 & n \\<br /> 1 & 1 \\<br /> \end{array}} \right]\left[ {\begin{array}{*{20}c}<br /> {a + bn} \\<br /> {a + b} \\<br /> \end{array}} \right] = \left[ {\begin{array}{*{20}c}<br /> {a + an + 2bn} \\<br /> {2a + b + bn} \\<br /> \end{array}} \right][/tex]
And [tex] \frac{{a + an + 2bn}}{{2a + b + bn}}[/tex] would be an even better approximation to [tex]\sqrt {n}[/tex].
Even if the starting approximation is way off, if a lot of iterations are complete, the answer will still be accurate.
Im just wondering, why does this method work? Is there a name for this method, or anywhere i can look to find more information?
Thanks,
Dan.