Square root of 5/Heron's method/Motivating example/R/Example
We would like to "compute“ the square root of a natural number, say of . Such a number with the property does not exist within the rational numbers (this follows from unique prime factorization). If is such an element, then also has this property. Due to fact, there can not be more than two solutions.
Though there is no solution within the rational numbers for the equation , there exist arbitrarily good approximations for it with rational numbers. Arbitrarily good means that the error (the deviation) can be made so small that it is below any given positive bound. The classical method to approximate a square root is Heron's method. This is an iterative method, i.e., the next approximation is computed from the preceding approximation. Let us start with as a first approximation. Because of
we see that is to small, . From ( being positive) we get and therefore , so . Hence we have the estimates
where we get a rational number on the right hand side if is rational. Such an estimate provides a certain idea where lies. The difference is a measure for how good the approximation is.
In particular, when we start with , we get that the square root is between and . Then we take the arithmetic mean of the interval bounds, so
Due to , this value is too large and therefore is in the interval . Then, we take again the arithmetic mean of these interval bounds and we set
to be the next approximation. Continuing like that, we get better and better approximations for .