- #1
danago
Gold Member
- 1,123
- 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}
1 & n \\
1 & 1 \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
a \\
b \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
{a + bn} \\
{a + b} \\
\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}
1 & n \\
1 & 1 \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
{a + bn} \\
{a + b} \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
{a + an + 2bn} \\
{2a + b + bn} \\
\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}
1 & n \\
1 & 1 \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
a \\
b \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
{a + bn} \\
{a + b} \\
\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}
1 & n \\
1 & 1 \\
\end{array}} \right]\left[ {\begin{array}{*{20}c}
{a + bn} \\
{a + b} \\
\end{array}} \right] = \left[ {\begin{array}{*{20}c}
{a + an + 2bn} \\
{2a + b + bn} \\
\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.