Jump to content

Square root of 5/Heron's method/Motivating example/R/Example

From Wikiversity

We would like to "compute“ the square root of a natural number, say of 5. Such a number x with the property x2=5 does not exist within the rational numbers (this follows from unique prime factorization). If xR is such an element, then also x 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 x2=5, 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 a:=x0:=2 as a first approximation. Because of

x02=22=4<5

we see that x0 is to small, x0<x. From a2<5 (a being positive) we get 5/a2>1 and therefore (5/a)2>5, so 5/a>5. Hence we have the estimates

a<5<5/a,

where we get a rational number on the right hand side if a is rational. Such an estimate provides a certain idea where 5 lies. The difference 5/aa is a measure for how good the approximation is.

In particular, when we start with 2, we get that the square root 5 is between 2 and 5/2. Then we take the arithmetic mean of the interval bounds, so

x1:=2+522=94.

Due to (94)2=8116>5, this value is too large and therefore 5 is in the interval [549,94]. Then, we take again the arithmetic mean of these interval bounds and we set

x2:=549+942=16172

to be the next approximation. Continuing like that, we get better and better approximations for 5.