general procedure, as stated in the third section, very
faithfully when it comes to dividing 1 by 12, instead of
using the reciprocal of 12.)
Instances of algorithms without accompanying num-
bers are very rare; here is another one, this time an
Old-Babylonian text from the Louvre [4, p. 39; 8, p. 71]:
Length and width is to be equal to the area.
You should proceed as follows•
Make two copies of one parameter•
Subtract 1.
Form the reciprocal.
Multiply by the parameter you copied.
This gives the width,
In other words, if x + y =
xy,
it is possible to compute
y by the procedure y = (x - 1) -1 x. The fact that no
numbers are given made this passage particularly hard
to decipher, and it was not properly understood for
many years (see [9, pp. 73-74]); hence we can see the
advantages of numerical examples.
The above procedure reads surprisingly like a pro-
gram for a "stack machine" like the Burroughs B5500l
Note that both in this example and in the very first one
we discussed we are told to make two copies of some
number; this indicates that actual numerical calcula-
tions generally destroyed the operands in the process of
finding a result. Similarly we find in other texts the in-
struction to "Keep this number in your head" [6, pp.
50-51], a remarkable parallelism with today's notion
that a computer stores numbers in its "memory." In
another place we read, in essence, "Replace the sum of
length and width by 30 times itself" [3, p. 114], an
ancient version of the assignment statement "x :=
x/2".
Conditionals and Iterations
So far we have seen only "straight-line" calculations,
without any branching or decision-making involved. In
order to construct algorithms that are really nontrivial
from a computer scientist's point of view, we need to
have some operations that affect the flow of control.
But alas, there is very little evidence of this in the
Babylonian texts. The only thing resembling a condi-
tional branch is implicit in the operation of division,
where the calculation proceeds a little differently if the
reciprocal of the divisor does not appear in the table.
We don't find tests like "Go to step 4 if x < 0",
because the Babylonians didn't have negative numbers;
we don't even find conditional tests like "Go to step 5
if x = 0", because they didn't treat zero as a number
either! Instead of ha,~ing such tests, there would effec-
tively be separate algorithms for the different cases. (For
example, see [3, pp. 312-314] for a case in which one
algorithm is step-by-step the same as another, but sim-
plified since one of the parameters is zero.)
Nor are there many instances of iteration. The basic
operations underlying the multiplication of high-preci-
sion sexagesimal numbers obviously involve iteration,
and these operations were clearly understood by the
Babylonian mathematicians; but the rules were ap-
parently never written down. No examples showing in-
termediate steps in multiplication have been found.
The following interesting example dealing with com-
pound interest, taken from the Berlin Museum collec-
tion, is one of the few examples of a "DO I = 1 TO N" in
the Babylonian tablets that have been excavated so far
[3, pp. 353-365; 4, Tables 32, 56, 57; 5, p. 59; 8, pp.
118-120]:
I invested 1 maneh of silver, at a rate of 12 shekels per maneh (per
year, with interest apparently compounded every five years).
I received, as capital plus interest, 1 talent and 4 manehs.
(Here 1 maneh = 60 shekels, and 1 talent = 60 manehs.)
How many years did this take?
Let 1 be the initial capital.
Let 1 maneh earn 12 (shekels) interest in a 6 (= 360) day year.
And let 1,4 be the capital plus interest.
Compute 12, the interest, per 1 unit of initial capital, giving 12
as the interest rate.
Multiply 12 by 5 years, giving 1.
Thus in five years the interest will equal the initial capital.
Add 1, the five-year interest, to 1, the initial capital, obtaining 2.
Form the reciprocal of 2, obtaining 30.
Multiply 30 by 1,4, the sum of capital plus interest, obtaining 32.
Find the inverse of 2, obtaining 1. (The" inverse" here means the
logarithm to base 2; in other problems it stands for the value
of n such that a given valuef(n) appears in some table.)
Form the reciprocal of 2, obtaining 30.
Multiply 30 by 30 (the latter 30 apparently stands for 32 -- 2, for
otherwise the 32 would never be used and the rest of the
calculation would make no sense), obtaining 15 ( = total
interest without initial capital if the investment had been
cashed in five years earlier).
Add 1 to 15, obtaining 16.
Find the inverse of 16, obtaining 4.
Add the two inverses 4 and 1, obtaining 5.
Multiply 5 by 5 years, obtaining 25.
Add another 5 years, making 30.
Thus, after the 30th year the initial capital and its interest will
be 1,4.
... (Here about 4 lines of the text have broken off. Apparently
there is now a question of checking the previous answer.)
•..
giving 12 as the interest rate.
Multiply 12 by 5 years, giving 1.
Thus in five years the interest will equal the initial capital•
Add 1, the five-year interest, to 1, the initial capital, obtaining 2,
the capital and its interest after the fifth year.
Add 5 years to the 5 years, obtaining 10 years.
Double 2, the capital and its interest, obtaining 4, the capital
and its interest after the tenth year.
Add 5 years to the 10 years, obtaining 15 years.
Double 4, the capital and its interest, obtaining 8, the capital
and its interest after the fifteenth year.
Add 5 years to the 15 years, obtaining 20 years.
Double 8, obtaining 16, the capital and its interest after the
twentieth year.
Add 5 years to the 20 years, obtaining 25 years.
Double 16, the capital and its interest, obtaining 32, the capital
and its interest after the twenty-fifth year.
Add 5 years to the 25 years, obtaining 30 years.
Double 32, the capital and its interest, obtaining I, 4, the capital
and its interest after the thirtieth year.
This long-winded and rather clumsy procedure reads
almost like a macro expansion !
674
Communications July 1972
of Volume 15
the ACM Number 7