WOLFRAM|DEMONSTRATIONS PROJECT

Babylonian Algorithm for Computing Square Roots

​
number
2
3
5
7
11
iterations
15
approximate value: 1.4142135623730950488016887242096980785696718753769
actual value: 1.4142135623730950488016887242096980785696718753769
The Babylonian algorithm is an ancient method for approximating the square root of a given number through a sequence of rationals. In spite of its longevity, this method is still the most popular, effective and simplest technique for this purpose.
Let
r
be the number whose square root is to be approximated. Start by taking a rectangle of base
b
0
and height
h
0
, and an initial guess of
b
0
such that
b
0
h
0
=r
. (Clearly, this can be obtained by setting
b
0
=r
and
h
0
=1
.) Then, calculate the midpoint of
b
0
and
h
0
=
r
b
0
to get the first estimate of
r
≈
1
2
(
b
0
+
h
0
)
. This method attempts to "square" the rectangle by equalizing its side lengths.
Repeating this process for some
n≥1
, we obtain the recursive formula:
b
n
=
1
2
b
n-1
+
r
b
n-1
.
The sequence
{
b
n
}
n∈
is bounded and monotone, and therefore convergent. The Babylonian method is actually a particular case of the Newton–Raphson iteration, and consequently, it converges quadratically; that is, the number of accurate digits in the approximation nearly doubles after each iteration. More specifically, we have:
lim
n∞
b
n
=
r
.
This Demonstration gives numerical estimations to the square roots of 2, 3, 5, 7, 11 up to 50 decimals using the Babylonian algorithm and illustrates the convergence process by plotting connected red dots for the sequential approximations. The actual value of the square root is represented in the plot by a solid black line.