# Fermat’s Library | Historic Babylonian Algorithms annotated/defined model.

*by*Phil Tadros

normal process, as acknowledged in the third part, very

faithfully when it comes to dividing 1 by 12, as an alternative of

utilizing the reciprocal of 12.)

Situations of algorithms with out accompanying num-

bers are very uncommon; right here is one other one, this time an

Previous-Babylonian textual content from the Louvre [4, p. 39; 8, p. 71]:

Size and width is to be equal to the space.

You ought to proceed as follows•

Make two copies of one parameter•

Subtract 1.

Type the reciprocal.

Multiply by the parameter you copied.

This offers the width,

In different phrases, if x + y =

xy,

it is potential to compute

y by the process y = (x – 1) -1 x. The truth that no

numbers are given made this passage notably laborious

to decipher, and it was not correctly understood for

many years (see [9, pp. 73-74]); therefore we can see the

benefits of numerical examples.

The above process reads surprisingly like a pro-

gram for a “stack machine” like the Burroughs B5500l

Notice that each in this instance and in the very first one

we mentioned we are informed to make two copies of some

quantity; this signifies that precise numerical calcula-

tions usually destroyed the operands in the course of of

discovering a end result. Equally we discover in different texts the in-

struction to “Hold this quantity in your head” [6, pp.

50-51], a outstanding parallelism with as we speak’s notion

that a laptop shops numbers in its “reminiscence.” In

one other place we learn, in essence, “Change the sum of

size and width by 30 occasions itself” [3, p. 114], an

historic model of the project assertion “x :=

x/2″.

Conditionals and Iterations

So far we have seen solely “straight-line” calculations,

with out any branching or decision-making concerned. In

order to assemble algorithms that are actually nontrivial

from a laptop scientist’s level of view, we want to

have some operations that have an effect on the move of management.

However alas, there is very little proof of this in the

Babylonian texts. The solely factor resembling a condi-

tional department is implicit in the operation of division,

the place the calculation proceeds a little in a different way if the

reciprocal of the divisor does not seem in the desk.

We do not discover assessments like “Go to step 4 if x < 0″,

as a result of the Babylonians did not have unfavorable numbers;

we do not even discover conditional assessments like “Go to step 5

if x = 0″, as a result of they did not deal with zero as a quantity

both! As a substitute of ha,~ing such assessments, there would effec-

tively be separate algorithms for the totally different instances. (For

instance, see [3, pp. 312-314] for a case in which one

algorithm is step-by-step the identical as one other, however sim-

plified since one of the parameters is zero.)

Nor are there many cases of iteration. The primary

operations underlying the multiplication of high-preci-

sion sexagesimal numbers clearly contain iteration,

and these operations have been clearly understood by the

Babylonian mathematicians; however the guidelines have been ap-

parently by no means written down. No examples displaying in-

termediate steps in multiplication have been discovered.

The following fascinating instance dealing with com-

pound curiosity, 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 price of 12 shekels per maneh (per

yr, with curiosity apparently compounded each 5 years).

I obtained, as capital plus curiosity, 1 expertise and 4 manehs.

(Right here 1 maneh = 60 shekels, and 1 expertise = 60 manehs.)

How many years did this take?

Let 1 be the preliminary capital.

Let 1 maneh earn 12 (shekels) curiosity in a 6 (= 360) day yr.

And let 1,4 be the capital plus curiosity.

Compute 12, the curiosity, per 1 unit of preliminary capital, giving 12

as the curiosity price.

Multiply 12 by 5 years, giving 1.

Thus in 5 years the curiosity will equal the preliminary capital.

Add 1, the five-year curiosity, to 1, the preliminary capital, acquiring 2.

Type the reciprocal of 2, acquiring 30.

Multiply 30 by 1,4, the sum of capital plus curiosity, acquiring 32.

Discover the inverse of 2, acquiring 1. (The” inverse” right here means the

logarithm to base 2; in different issues it stands for the worth

of n such that a given valuef(n) seems in some desk.)

Type the reciprocal of 2, acquiring 30.

Multiply 30 by 30 (the latter 30 apparently stands for 32 — 2, for

in any other case the 32 would by no means be used and the relaxation of the

calculation would make no sense), acquiring 15 ( = complete

curiosity with out preliminary capital if the funding had been

cashed in 5 years earlier).

Add 1 to 15, acquiring 16.

Discover the inverse of 16, acquiring 4.

Add the two inverses 4 and 1, acquiring 5.

Multiply 5 by 5 years, acquiring 25.

Add one other 5 years, making 30.

Thus, after the thirtieth yr the preliminary capital and its curiosity will

be 1,4.

… (Right here about 4 strains of the textual content have damaged off. Apparently

there is now a query of checking the earlier reply.)

•..

giving 12 because the curiosity price.

Multiply 12 by 5 years, giving 1.

Thus in 5 years the curiosity will equal the preliminary capital•

Add 1, the five-year curiosity, to 1, the preliminary capital, acquiring 2,

the capital and its curiosity after the fifth yr.

Add 5 years to the 5 years, acquiring 10 years.

Double 2, the capital and its curiosity, acquiring 4, the capital

and its curiosity after the tenth yr.

Add 5 years to the 10 years, acquiring 15 years.

Double 4, the capital and its curiosity, acquiring 8, the capital

and its curiosity after the fifteenth yr.

Add 5 years to the 15 years, acquiring 20 years.

Double 8, acquiring 16, the capital and its curiosity after the

twentieth yr.

Add 5 years to the 20 years, acquiring 25 years.

Double 16, the capital and its curiosity, acquiring 32, the capital

and its curiosity after the twenty-fifth yr.

Add 5 years to the 25 years, acquiring 30 years.

Double 32, the capital and its curiosity, acquiring I, 4, the capital

and its curiosity after the thirtieth yr.

This long-winded and somewhat clumsy process reads

virtually like a macro enlargement !

674

Communications July 1972

of Quantity 15

the ACM Quantity 7