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 \sqrt {n}. I can make an approximation by inspection, and say \sqrt n \approx \frac{a}{b}. Now, using this approximation, i can write:
<br /> \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]<br />
Treating the resultant matrix as a fraction (<br /> \frac{{a + bn}}{{a + b}}<br />
), i have a better approximation of \sqrt {n}. 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:
<br /> \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]<br />
And <br /> \frac{{a + an + 2bn}}{{2a + b + bn}} would be an even better approximation to \sqrt {n}.
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 \sqrt {n}. I can make an approximation by inspection, and say \sqrt n \approx \frac{a}{b}. Now, using this approximation, i can write:
<br /> \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]<br />
Treating the resultant matrix as a fraction (<br /> \frac{{a + bn}}{{a + b}}<br />
), i have a better approximation of \sqrt {n}. 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:
<br /> \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]<br />
And <br /> \frac{{a + an + 2bn}}{{2a + b + bn}} would be an even better approximation to \sqrt {n}.
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.