Ancient Babylonian Algorithms
Ancient Babylonian Algorithms
Ancient Babylonian Algorithms
Babylonian
Algorithms
Donald E. Knuth
Stanford University
The early origins of mathematics are discussed, One of the ways to help make computer science re-
emphasizing those aspects which seem to be of greatest spectable is to show that it is deeply rooted in history,
interest from the standpoint of computer science. A not just a short-lived phenomenon. Therefore it is natu-
number of old Babylonian tablets, many of which have ral to turn to the earliest surviving documents which
never before been translated into English, are quoted. deal with computation, and to study how people ap-
Key Words and Phrases: history of computation, proached the subject nearly 4000 years ago. Archeo-
Babylonian tablets, sexagesimal number system, sorting logical expeditions in the Middle East have unearthed a
CR Categories: 1.2 large number of clay tablets which contain mathematical
calculations, and we shall see that these tablets give
many interesting clues about the life of early "computer
scientists."
the answer lies somewhere between three and four years. ~-~2 k = 2 n q - ( 2 " - - 1)
k=l
The growth is linear in any one year, so the answer is
and for the sum of a quadratic series
1.24 -- 2 33 20
1.24 _ 1.23 X 12 = 2 q- ~ q- 36---~
kffil ~n k.
months less than four years. This is exactly what was
computed [5, p. 63]. These formulas have not been found in Old-Babylonian
Note that here we have a problem with a nontrivial texts.
iteration, like a "WHILE" clause: The procedure is to Moreover, this same Seleucid tablet shows an in-
form powers of I q- r, where r is the interest rate, until creased virtuosity in calculation; for example, the roots
finding the first value of n such that (1 + r)" >_ 2; then to complicated equations like
calculate
xy= 1, xq-y= 2,0,0,33,20
12((1 -F r)" -- 2)/((1 q- r)" -- (1 -Jr- r)"-1),
(solution: x = 1,0,45 and y = 59,15,33,20) are com-
and the answer is that the original investment will puted. Perhaps this problem was designed to demon-
double in n years minus this many months. strate the use of the new zero symbol.
This procedure suggests that the Babylonians were An extremely impressive example of the Seleucid era
familiar with the idea of linear interpolation. Therefore calculating ability appears in another Louvre Museum
the trigonometric tables in the famous "Plimpton tab- tablet [3, pp. 14-22]. It is a 6-place table of reciprocals,
let" [6, p. 38-41] were possibly used to obtain sines and which begins thus:
cosines in a similar way.
By the power of Anu and Antum, whatever I have made with my
hands, let it remain intact.
Appendix
The 20 additional entries included in Inakibit's table are some-
what mysterious. In 19 of the cases, the number has a reciprocal
with six digits or less; the exception is 3z3 = 2,1,4,8,3,0, 7, whose
reciprocal has 17 sexagesimal digits.
Let's say that a sexagesimal number is a Q-number if it has
six or less digits, while its reciprocal is finite and has more than
six digits and begins with 1 or 2. There are 132 Q-numbers in
all, only 19 of which appear in Inakibit's table. Five of these are
217, 223, 311, 3TM, and 32z; they constitute all Q-numbers of the forms
2~, 3., or 5~, and it is likely that such numbers appeared in special
tables. However, the Q-number 611 is not included, so it is not
simply a matter of perfect powers being included. The three-
digit Q-numbers 2131° and 2239 are excluded, so it not a matter of
including the smallest cases. The Q-numbers which do appear,
besides the five listed above, are 3951, 3105a, 31155; 213951, 2131'52,
213135a (but not 2131554); 31851, 2339, 2731°, 212311, 2183TM, 2203~, 29259,
2'2452. It is perhaps noteworthy that 31153 does not appear, but its
multiple 3u5 ~ does.
Since so many Q-numbers are missing, we may conclude that
Inakibit continued his table by giving the reciprocals of all six-
digit numbers up to 59,43,10, 50, 52,48, not taking advantage of
symmetry. Hence the complete table contained the reciprocals of
at least 721 six-digit numbers, and it probably filled three clay
tablets in all.
References
1°
Aaboe, Asger A. Episodesfrom the Early History of Mathematics.
Random House, New York, 1964, 133 pp.
2.
Knuth, Donald E. Seminumerical Algorithms. Addison-Wesley,
Reading, Mass., 1971 (second printing), 624 pp.
3.
Neugebauer, O. Mathematische keilschrift-texte. In Quellen und
Studien zur Geschichte der Mathematik, Astronomie, und
Physik, Vol. A3, Pt. 1, 1935, 516 pp.
4.
Neugebauer, O. Mathematische keilschrift-texte. In Quellen und
Studien zur Geschichte der Mathematik, Astronomie, und
Physik, Vol. A3, Pt. 2, 1935, 64 pp. plus 69 reproductions of
tablets.
5.
Neugebauer, O. Mathematische keilschrift-texte. In Quellen und
Studien zur Geschiehte der Mathematik, Astronomie, und
Physik, Vol. A3, Pt. 3, 1937, 83 pp. plus 6 reproductions of
tablets.
6.
Neugebauer, O., and Sachs, A. Mathematical Cuneiform Texts.
American Oriental Society, New Haven, Conn., 1945, 177 pp.
plus 49 reproductions of tablets.
7.
Neugebauer, O. The Exact Sciences in Antiquity. Brown U. Press,
Providence, R.I., 1957 (second ed.), 240 pp. plus 14
photographic plates.
8.
Thureau-Dangin, F. Textes Math~matiques Babyloniens. E.J.
Brill, Leiden, The Netherlands, 1938, 243 pp.
9.
van der Waerden, B.L. Science Awakening. Tr. by Arnold Dresden.
P. Noordhoff, Groningen, The Netherlands, 1954, 306 pp.