You are on page 1of 6

"

STANFORD TIME -SHARING PROJECT January 27, 1965


Computer Science Division
Memo No. 25

REPORT ON THE 1964 FALL JOINT PROGRAMMING RACE

John McCarthy

" Abstract: We present the results of the impromptu


programming race held at the 1964 Fall
Joint Computer Conference.

The research reported here was supported in part by the National


Science Foundation (GP-3207)

"
" REPORT ON THE 1964 FALL JOINT PROGRAMMING RACE
John McCarthy

One way in which one computer and operating system can be better
than another is in permitting a user to solve a problem in a shorter
time. There are differences of opinion about what features of a
system make for fastest solution of problems and differences of
opinion are what make horse races. Therefore, on Tuesday, October
27, 1964, I announced a programming race for computer systems accessible
from the exhibit area of the Fall Joint Computer Conference. Seven
groups agreed to participate and the contest was held the following
afternoon.

In my opinion the contest was worthwhile and more such contests


should be held in the future for the following reasons:

1. The ability to solve problems quickly under pressure is


valuable to a programmer and his employer. It should be recognized
and rewarded.

2. Designers of computer, programming languages, and operating


systems tend to minimize the importance of inconveniences that may

" show up in the operation of their systems. A contest will show


which of these are trivial and which are important.

3. At present the average productivity of programmers is very


low for a combination of reasons

poor training, poorly described
languages and procedures, inconvenient operating systems, bad co-
ordination of work, ill-defined problems, etc. Contests will stimulate
better programming by showing what is possible.

The people at the following booths agreed to compete.

1. Dartmouth College - General Electric using the teletype


connection to the GE 225 time-sharing system at Dartmouth College and
their "BASIC" algebraic language system.

2. Digital Equipment Corporation using the teletype connection


to their PDP-6 computer at their factory in Maynard, Massachusetts.
They used their on-line debugging system DDT and programmed in machine
language .
3. Computer Control Corporation using their DDP-224 computer
on the floor of the convention. They used their Fortran compiler.

"
?

"
4. Information International Inc. using the Digital Equipment
PDP-1 computer built into their programmable film reader. They
programmed in DDT, I.e. on-line machine language also.

5. IBM. They used the QUIKTRAN on-line Fortran system that used
a remotely connected 7090 In New York.

6. M.I.T. project MAC using the time-shared 7090 at M.I.T. The


teletype used was loaned by Dartmouth. They used the MAD language.

7. System Development Corporation using the time-shared Q-32


computer in Santa Monica, California. They used the JOVIAL language.

The groups exhibiting the CDC 3100, the SDS 930, and the LGP 21
declined to compete on the grounds that they had not brought means for
preparing programs to the convention. It is possible that I missed
inviting other groups that could have competed.

I announced that I would appear on the next afternoon, Wednesday,


with copies of the problem and the winner would be the group that
solved it in the least elapsed time. I said that the problem would
be such that the winning time would be between 15 and 20 minutes.
(An underestimate)

At about 1:30, on Wednesday, I distributed sheets with the rules


and starting at 2:30, I distributed the problem. It was not possible

" to start all groups at the same time because the different time-sharing
systems came on the air at different times. Stanford students served
as observers at each booth.

The problem is given on page 4 but if the reader wishes to try


his own hand at it he should go to his machine and not look at the
problem until he is ready to start counting time.

The results were as follows in ascending order of time taken

1. Information International. (Mr. Edward Fredkin,


president of the company, did the programming. ) 57
2. Digital Equipment Corporation 1:43
3. Dartmouth - G.E. 1:45
4. Computer Control Corporation 2:07
5. IBM. Their time-sharing system went off the air
30 minutes after they accepted the problem. My miscalculation
on how long the problem would take provides them with an
excuse.

" 2

" 6. SDC. Their time-sharing systems also went off the air 30
minutes after they accepted the problem.

7. M.I.T. Project MAC. Their programmer quit after about an


hour because he had a dinner engagement.

In scoring the results, Mr. Fredkin should be docked a few points


for printing the answer in octal, and Mr. Scott of G. E. who used the
Dartmouth system should be awarded some extra points since this was
the first program he had ever written using the Dartmouth system.

The problem required some thought before one even started


programming and this contributed a substantial but unknown amount to
the times taken by some contestants. This vitiates this contest as a
test of systems.

DO NOT TURN THE PAGE UNTIL YOU ARE READY TO START ON THE PROBLEM.

"

" 5
" THE PROBLEM:

In the introduction to the collected works of the Indian


mathematician Ramanujan, G. H. Hardy wrote as follows:

"He could remember the idiosyncrasies of numbers in an almost


uncanny way. It was Littlewood who said that every positive integer
was one of Ramanujan's personal friends. I remember going to see
him once when he was lying 111 in Putney. I had ridden in taxi-cab
No. xxxx, and remarked that the number seemed to me a rather dull,
one, and that I hoped that it was not an unfavorable omen. "No",
he replied, "It is a very interesting number; it is the smallest
number expressible as a sum of two cube in two different ways." I
asked him, naturally, whether he could tell me the solution of the
corresponding problem for fourth powers, and he replied, after a
moment's thought, that he knew no obvious example, and supposed that
the first such number must be very large."

Problem: Write a program to determine the number of Hardy's taxi.


It has four digits.

" Turn the page for solutions.

" 4
*

"
SOLUTIONS
The briefest solution was suggested by Mr. Paul Abrahams of
Information International, but was not the solution Mr. Fedkin used
In ALGOL it is
begin
integer i, j; integer array a[ 1:10000];
for i := 1 step 1 until 10000 do a[i] := 0;
for i := 1 step 1 until 21 do
for j := 1, j + 1 while j < iAif 3 + jt 3 < 10000 do
a[it 3 + jf3] := a[iT3 + jt'sl + 1}
for i := 1 step 1 until 10000 do if a[i] > 1 then go to done;
done : outinteger ( i ) end
A solution that uses less memory is:
begin comment McCarthy's FJCC contest problem Find the smallest
integer that is the sum of two cubes for two different pairs
of cubes. W. M. McKeeman;

integer i, j, t, k, nc;
integer array a, isave, j save [ l:soo] ;

"
nc := 0;
for i := 1 step 1 until 30 do
for j := 1 step 1 until i do
begin
t :-= iT3 + jt3;
for k := 1 step 1 until nc do
if t = a[k] then
begin
outinteger(t ) ;
outinteger(i) ;
outinteger (j ) ;
outinteger ( isave [k] );
outinteger( jsave[k] )
end;
nc := nc + 1;
a[nc] := t;
isave[nc] := i;

" end
end
jsave [nc] := j

You might also like