.. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of...

82
.

Transcript of .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of...

Page 1: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

.

Page 2: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

BRIAN SHELBURNESINCLAIR COMMUNITY

COLLEGENOVEMBER 14, 2014

The ENIAC’s 1949 Determination of π

Page 3: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Mathematics exists in context

Page 4: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The ENIAC’s 1949 Determination of π

Abstract: In January 1950, George W. Reitwiesner published “An ENIAC Determination of π and e to more than 2000 Decimal Places” in Mathematical Tables and Other Aides to Computation describing the first use of a computer, the ENIAC, to calculate the decimal expansion of π. Because the history of π stretches back over thousands of years, the use of the ENIAC to determine π is an important historical and technological milestone. The ENIAC was not designed to perform this type of calculation; it could only store 200 decimal digits while the determination of e and π required manipulating numbers 2000+ digits long. Starting with Reitwiesner’s description of the calculation, the known architecture of the ENIAC, how it was programmed, and the mathematics used, we examine why the calculation was undertaken, how it had to be done, and what was subsequently learned.

Page 5: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Mathematical Tables and Other Aids to Computation, Vol. 4, No. 29 (Jan., 1950, 11 -15)

Page 6: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Mathematical Tables and Other Aids to Computation, Vol. 4, No. 29 (Jan., 1950, 11 -15)

Page 7: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Overview

How I Got Interested in the questionA brief history of πThe ENIAC

How it was programmed in 1949Why was the calculation done and why did

Reitwiesner became interested in it? Three (or 4) reasons why! Why von Neumann and others got interested in it

Reverse engineering the calculation - how the determination of π was (most likely) done

What was learned

Page 8: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Why I Got Interested in it

The converse of “research informs teaching”

Math 460: Senior Seminar: Journey Through Genius, Chapter 4: Archimedes’ Determination of Circular Area

A sentence in the book reads: “Finally in 1949 the computer fundamentally revolutionized the calculation [of the determination of π].In that year the Army’s ENIAC computer found π to 2037 places.” (Journey Through Genius p 111.)

Huh?

Page 9: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

A brief history of π – Finding the area of a circle

1. Famous Ancient Estimates2. The Archimedean method using inscribed /

circumscribed polygons3. Infinite Series Expansions –Arctan Series

Formula • Gregory -Leibniz Series for π/4• Machin’s formula for π/4• Determinations of π

4. The Computer!

Page 10: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

1 - Ancient Estimates

Rhind Papyrus (1650 BCE)conjectured by H. Engels

“Example of a round field of diameter 9 khet. What is its area? Take away 1/9 of it, namely 1: the remainder is 8. Multiply 8 times 8; it makes 64; the amount of it, this is in area 64 setat”

2 228 16

9 9Area Diameter Radius

216

3.160499

Page 11: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Rhind Papyrus (1650 BCE)conjectured by H. Engels

Page 12: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

2 - Archimedean Methods

Detail of an engraving by M. Weber of a painting by the Italian artist Niccolò Barabino (1832-1891).

3.140845≈31071

<𝐴𝑟𝑒𝑎<317≈3.142857

using 96–sidedinscribed andcircumscribedpolygons

Page 13: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Archimedes’ Area of Circle = 21 12

2 2r C r r r

← circumference →

↑Radius

Page 14: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Using the Archimedean method Ludolph Van Ceulen (1540 – 1610) computed π to 35 digits.

A replica of the Van Ceulen tombstone, installed at the Leiden pi day (7/5/2000).

Page 15: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

3. Newton’s Pi (Methodus Fluxionum et Seriersum Infinitarum – written 1671)

11

222 1y x x x x

14

2

0

324 32

x x dx

1,0 12 ,0 1

4 ,0

12radius

1/6 of a circleof radius 1/2

area of the 30-60-90 triangle

1 2 3 52 1 1 1 51 ..

2 8 16 128x x x x x

expand by binomial theorem

Dunham p. 174

Page 16: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Newton’s pi

Newton computed pi to 15 digits writing later

"I am ashamed to tell you to how many figures I carried these computations, having no other business at the time."[

Page 17: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

3 - Infinite Series (mid 17th Century)

Arctan Formula

Gregory-Leibniz Series=

Machin’s Formula converges very slowly

Page 18: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Arctan Series Formula (Details)

20

1

1

x

dtt 2 2

1 1

1 sect u

tant u 2secdt u du

2 4 62

11 ...

1t t t

t

2 4 6 82

0 0

11 ...

1

x x

dx t t t t dtt

3 5 7 9 2 1

0

... 13 5 7 9 2 1

kk

k

x x x x xx

k

1.

2.

3.

2

2 20 0 0 0

1 secarctan

1 sec

t xx t x t x

t t t

udt du du u x

t u

Page 19: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Gregory (1638-1675) - Leibniz (1646 – 1716) Formula

John Machin’s (1680 – 1751) Formula

1 11 14 tan tan

4 5 239

2 1 2 10 0

1 14 1 1

2 1 5 2 1 239

k k

k kk kk k

Converges much faster

0

1 1 1 1 1 11 1 ...

4 2 1 3 5 7 9 11

k

k k

Converges too slowly

Page 20: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

1853: William Shanks determines π to 707 digits!

Augustus DeMorgan (1806-1871) notices a smaller number of appearances of the digit 7 in Shanks’ determination.

Later on it was discovered that there was an error beginning at the 528 digit of Shanks’ calculation

Question! Do all ten digits in the decimal expansion of π occur approximately 1/10th of the time? Hmm…

Page 21: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Is π “normal”?

“A number is said to be simply normal to base b if its base-b expansion has each digit appearing with average frequency tending to b-1.” - Wolfram MathWorld

Is π “simply normal base 10”?

“A number that is b-normal for every b=2, 3, ... is said to be absolutely normal (Bailey and Crandall 2003)”.

Page 22: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

More things that make you go “Hmm…”

The Dutch mathematician L.E.J. Brouwer (1882 – 1966) also posed the question of whether 1000 consecutive zeroes appear in the decimal expansion of π (see Eves, In Mathematical Circles: A Selection of Mathematical Stories and Anecdotes p. 31). If it could be established that numbers like e and π are normal in the sense that the statistical distribution of their digits is uniform, then one could make that case that given a long enough sequence of digits for e or π, odds are the answer is yes

Page 23: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Moreover ….

In Carl Sagan’s novel Contact, the protagonist Ellie discovers a sequence of 0’s and 1’s in the base 11 expansion of π (1020 digits out) which when arranged in a square form a rasterized circle. The sequence’s length is a product of 11 primes.

Is information hidden in the expansion of π?

00000000000000011100000010000010001000000010001000001000000111000000000000000

Page 24: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The ENIAC

Started during WWII in 1943

Completed 1946

Page 25: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

4. The ENIAC

Started duringWWII in 1943

Completed 1946

Move to BRL, Aberdeen MD 1947

Page 26: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Project PX: The ENIAC Project: 1943-1946Constructed to do ballistic computations for the Army!

30 units (40 panels - room sized) including20 Accumulators each capable of storing a signed 10

digit decimal number (200 digits of storage)Capable of 5000 additions/second (200 μsec)~18,000 vacuum tubes30 tons - 1800 ft2 - 150 KW powerCost ~$500,000.00Programming: Hardwired! Decentralized Control!Used punch cards for I/O

Page 27: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The People

John W. Mauchly 1907 – 1980

J. Presper Eckert Jr.1919 - 1995

Page 28: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

John von Neumann1903 - 1957

H.H. Goldstine1913 - 2004

Page 29: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

http://coolphotobench.com/images/Cars/adele-goldstine.jpg

Project PX – the “ENIAC” - proposed 1942, contract signed 1943, delivered 1946

Page 30: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

"ENIAC OFFICIALS" From left to right: J. Presper Eckert, Jr., Chief Engineer; Professor J. G. Brainerd, Supervisor; Sam Feltman, Chief Engineer for Ballistics, Ordnance Department; Captain H. H. Goldstine, Liaison Officer; Dr. J. W. Mauchly, Consulting Engineer; Dean Harold Pender, Moore School of Electrical Engineering, University of Pennsylvania; General G. M. Barnes, Chief of the Ordnance Research and Development Service; Colonel Paul N. Gillon, Chief, Research Branch of the Army Ordnance Research and Development Service.

http://explorepahistory.com/kora/files/1/2/1-2-1573-25-ExplorePAHistory-a0l4o2-a_349.jpg

Page 31: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

View of ENIAC accumulators. Standing: Ester Gerston;crouching: Gloria Ruth Gorden. (US Army Photo; http://ftp.arl.army.

mil/ftp/historic-computers/png/eniac4.png.)

• http://www.library.upenn.edu/exhibits/rbm/mauchly/img/eniac4.jpg

The ENIAC: Built By Men – Programmed by Women

Page 32: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Functional Diagram of the ENIAC

cc

cM

M

• 20 Accumulators× Multiplier÷ Divider/Square Rooterc Constant TransmitterM Master ProgrammerFT Function Tables Card Punch Card Reader

FT

card punchcard reader

Page 33: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The Accumulators

Page 34: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The Computational UnitHow an ENIAC Accumulator “worked”

Stores a signed 10 decimal digit numberCould transmit (multiple times) that number or its negativeCould receive a number and add it to its contents

Example:

2 2

3 3 2

1 2 1

1 3 3 1

n n n

n n n n

Add 3 times

Page 35: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

A Sample Calculation: squares and cubes

Example taken from The Electronic Numerical Integrator and Computer (ENIAC) by H.H. Goldstine and Adele Goldstine; MTAC 1946; Reprinted in IEEE Annals of the History of Computing, Vol 18, No. 1 1996, pp. 10 - 16

AC18: n AC19: n2 AC20: n3

Page 36: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Example: How the ENIAC calculated squares and cubes

A1: AC19 (n2) transmits 3 times; AC20 (n3) receives 7 times

A2: AC18 (n) transmits 3 times; AC19 (n2) receives 2 times

A3: Constant Transmitter transmits 1; AC18 (n) and AC19 (n2) receives 1 time

2 2

3 3 2

1 2 1

1 3 3 1

n n n

n n n n

AC20: n3+3n2

AC19: n2+2n; AC20: n3+3n2 +3n

AC18: n+1; AC19: n2+2n+1; AC20: n3+3n2 +3n+1

Page 37: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

ENIAC at BRL: (left to right) Homé McAllister, Winifred (Wink) Smith, George Reitwiesner, and Ruth Lichterman

Page 38: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Why George Reitweisner got interested in it

“Early in June, 1949, Professor John von Neumann expressed an interest in the possibility that the ENIAC might sometime be employed to determine the value of π and e to many decimal places with a view toward obtaining a statistical measure of the randomness of the distribution of the digits … Further interest in the project on π was expressed in July by Dr. Nicholas Metropolis who offered suggestions about programming the calculations”-“An ENIAC Determination of π and e to more than 2000 Decimal Places” in Mathematical Tables and Other Aides to Computation Vol 4 No. 29 (Jan 1950 )

Page 39: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

GeorgeReitweisner& HoméMcAllisterReitweisner

Page 40: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Why was the calculation done?

Possibility of applying new computer technology to solving problems in theoretical and not just applied mathematics

Page 41: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

In a letter to von Neumann dated 2/8/1946, M.H.A. Newman a mathematician at Manchester University wrote

“with the development of fast machine techniques mathematical analysis itself may take a new slant, apart from the developments that may be stimulated in symbolic logic and other topics not usually in the repertoire of engineers or computing experts; and that mathematical problems of an entirely different kind from those so far tackled by machines might be tried, e.g. testing out, the 4-colour problem or various theorems on lattices, groups, etc., for the first few values of n.”

Historical Footnote: 30 years later in 1976 the Four Color Theorem was provedby K. Appel and W. Haken at the University of Illinois-Urbana using a computer.

Page 42: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Why was the calculation done?

Possibility of applying new computer technology to solving problems in theoretical and not just applied mathematics

Interest in Monte Carlo methods & random number generation (1949)

Page 43: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

In the late 1940’s J. von Neumann, N. Metropolis and Stanislaw Ulam developed Monte Carlo methods

(neutron diffusion problem in nuclear fission research)

Metropolis’ and Ulam’s seminal paper on the Monte Carlo method came out in September 1949

“Monte Carlo methods … are a class of computational algorithms that rely on repeated random sampling to compute their results. Monte Carlo methods are often used in computer simulations of physical and mathematical systems. These methods are most suited to calculation by a computer and tend to be used when it is infeasible to compute an exact result with a deterministic algorithm.” Wikipedia: Monte Carlo method

Page 44: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Monte Carlo π

-1

+1

+1

-1

[w]hen random numbers are to be used in fast machines, numbers will usually be needed faster. More significant is the fact that because longer sequences will be used, one is likely to have more elaborate requirements about what constitutes a satisfactory sequence of random numbers – J. von Neumann

Randomly generate N orderedpairs of points (x,y) where

-1 ≤ x ≤ 1 and -1 ≤ y ≤ 1Let C = count of ordered pairsthat are w/in the unit circle

Then π ≈ 4C/N

Page 45: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

“Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin” – von Neumann

Page 46: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Why was the calculation done?

Possibility of applying new computer technology to solving problems in theoretical and not just applied mathematics

Interest in Monte Carlo methods & random number generation (1949)

Augustus DeMorgan’s discovery of an error in Shanks 1853 determination of π - is π base 10 normal?

A mathematician’s fascination with numbers

Page 47: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

“A Logical Coding System Applied to the ENIAC”

Because re-wiring the ENIAC to perform a new calculation took so long the ENIAC was modified so that it could be programmed using two-digit codes stored in its Function Tables giving it a read only memory for instructions.

Page 48: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The ENIAC was re-configured to be a computer with a ROM for code and a small RAM for data

Page 49: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

A Logical Coding System Applied to the ENIAC

R.F. Clippinger 29 September 1948

A set of 60 Order Codes for programming the ENIAC

Page 50: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

BLR Technical Note No. 141November 1949

Description and use of The Eniac Converter Code

This was an expanded set of 100 Converter Codes

Page 51: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

An Overview of the ENIAC Order/Converter Codes

2 digit codes packed 6 to a line stored in the Function Tables (12 digits/line); codes very unlike those of today’s computers!

19 codes cleared AC α then transmits AC 15 to AC α - Listen19 codes transmit AC α to AC 15 (Add) - Talk

AC 6 contains the current code line (~ program counter) which could be altered (unconditional branch).

Page 52: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Codes to clear AC 15 (15)multiply AC 15 by AC 11 (57)negate AC 15 (41)drop sign AC 15 (46)shift AC 15 left or right (10 codes)double shift AC 15 AC12 pair left or right (10 codes) , square root of AC 15 (64)branch on positive or zero: conditional branching (69)divide AC 15 by AC 7 (63)

Page 53: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

10 digit numbers plus sign; all numbers had assumed decimal points (scaling was necessary!)

Of 20 accumulators, 8 were allocated for tasksExample division 63 used AC 5 (remainder), AC 7 (denominator), AC 15 (numerator/quotient), AC 13

Only 12 accumulators remained for “working” storage

Page 54: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Read : Code 44 : Read eight 10 digit numbers from 80-column punch card to locations A – H of the Constant Transmitter 80 column punch card+-------+-------+-------+-------+-------+-------+-------+-------+ 1 10|11 20|21 30|31 40|41 50|51 60|61 70|71 80| A B C D E F G H

Codes 50 – 53 transferred CT locations AB, CD, EF and GH to AC11 and AC15.

Print: Code 45: Punched AC1, AC2 and AC15 – AC20 onto columns 1 – 80 of a punch card. AC1 AC2 AC15 AC16 AC17 AC18 AC19 AC20 +-------+-------+-------+-------+-------+-------+-------+-------+ 1 10|11 20|21 30|31 40|41 50|51 60|61 70|71 80|

Page 56: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

How the calculation was (most likely) done

1. What formulas were used for e and π?2. Determine e and π on a modern computer3. Given Reitwisener’s description, the

mathematics for determining e and π, the modern program for determining e and π (see step 2) and the Order/Converter Code used on the ENIAC, reverse engineer the process.

4. Did e first; π second. 5. Build an ENIAC simulator and program the

calculations!

Page 57: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The mathematical formulas (2000+ digit accuracy!)

Calculation for e Calculation for π

3 5 7

3 5 7

1 14arctan arctan

4 5 239

1 1 1 14 ...

5 3 5 5 5 7 5

1 1 1 1...

239 3 239 5 239 7 239

1 1 1 11 1 ... ..

2! 3! 4! 800!e

1400+ terms needed

Page 58: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Why these calculations could be done on the ENIAC

If one term of the series was known the next term could be obtained from it

If you could calculate then was divided by 5

Same was true for

1 1 1 11 1 ... ..

2! 3! 4! 800!e

1

4!

1

4!

1

5!

3 5 7

1 1 1 14 ...

5 3 5 5 5 7 5

Page 59: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Technical Issues

Representing/Storing 2000+ Digit NumbersImplementing High Precision DivisionHow does ENIAC Division work?High Precision Addition/SubtractionProgram Control

Page 60: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

1. Storing 2000 Digit Numbers

80 Column Punch Card

Capacity: Eight signed 10 digit numbers

Page 61: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Internal Storage:

Only 12 Accumulators available for “working storage”

Two sets of five accumulators (decades 6…2): AC 16 – AC 20AC 3, AC 4, AC 9, AC 10, AC 14

Alignment with AC 16 – AC 20 and Punch Card columns 31 – 80

| AC01 | AC02 | AC15 | AC16 | AC17 | AC18 | AC19 | AC20 |+0000000000 +0000000000 +0000000000 +0002718280 +0000182840 +0000590450 +0000235360 +0000028620

Page 62: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

ENIAC Punch Card

AC1 AC2 AC15 AC16 AC17 AC18 AC19 AC20

| AC01 | AC02 | AC15 | AC16 | AC17 | AC18 | AC19 | AC20 |+0000000000 +0000000000 +0000000000 +0002718280 +0000182840 +0000590450 +0000235360 +0000028620

Page 63: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

2. High Precision Division: Suppose you could only divide 5 digit numbers. How would you divide a 10 digit number?

The program processed 25 digits at a time using 5 accumulators

3. ENIAC Division – gives you the quotient and the remainder

?7 5882352941

84037 58823

2r 361347 529412

3r

Page 64: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

ENIAC Division Example: 7.94 divided by 3.0 with assumed decimal points between 8th and 9th decades

Denominator Numerator Quotient

03000 00000 07940 00000 ↓+ 04940 00000 01000 00000 01940 00000 02000 00000 sign change! -01060 00000 03000 00000

Denominator Numerator Quotient 03000 00000 -10600 00000 ↓- shift -07600 00000 02900 00000 decrement -04600 00000 02800 00000 -01600 00000 02700 00000 sign change! 01400 00000 02600 00000

Page 65: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

ENIAC Division Example (cont): 7.94 divided by 3.0 with assumed decimal points between 8th and 9th decades

Denominator Numerator Quotient 03000 00000 14000 00000 ↓+ shift 11000 00000 02610 00000 increment 08000 00000 02620 00000 05000 00000 02630 00000 02000 00000 02640 00000 sign change! -01000 00000 02650 00000

Denominator Numerator Quotient 03000 00000 -10000 00000 ↓- shift -07000 00000 02649 00000 decrement -04000 00000 02648 00000 -01000 00000 02647 00000 sign change! 02000 00000 02646 00000 remainder!

Page 66: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

4. High Precision Addition and Subtraction: How would you add (or subtract) 10 digit numbers if you could only add (or subtract) 5 digits at a time?

5. Program ControlENIAC had a branch on positive or zero instruction (code 69)“End of Input” termination: Input Process Output

2718282828+3141592653 ----------

1 27182+31515 ----- 58698

82828+92653 -----175481

Page 67: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Putting It all Together

“The computation of e was completed over the July 4th week end as a practice job to gain experience and technique for the more difficult and longer project on π”

It took 11 hours.

Page 68: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Initial Input DeckAC1 field – numeratorAC2 field – denominator

As each line is read, high precision division is used to generate 25 digits of the quotient in AC 16 – 20. Remainder written back to AC1.

Assumed decimal points between the 6th and 7th decades

| AC1 | AC2 | AC15 – 20 |+0001000000 +0001000000 0 0 0 0 0 0+0000000000 +0001000000 0 0 0 0 0 0+0000000000 +0002000000 0 0 0 0 0 0+0000000000 +0003000000 0 0 0 0 0 0+0000000000 +0004000000 0 0 0 0 0 0+0000000000 +0005000000 0 0 0 0 0 0+0000000000 +0006000000 0 0 0 0 0 0+0000000000 +0007000000 0 0 0 0 0 0+0000000000 +0008000000 0 0 0 0 0 0+0000000000 +0009000000 0 0 0 0 0 0+0000000000 +0010000000 0 0 0 0 0 0 +0000000000 +0011000000 0 0 0 0 0 0+0000000000 +0012000000 0 0 0 0 0 0+0000000000 +0013000000 0 0 0 0 0 0+0000000000 +0014000000 0 0 0 0 0 0 +0000000000 +0015000000 0 0 0 0 0 0 +0000000000 +0016000000 0 0 0 0 0 0+0000000000 +0017000000 0 0 0 0 0 0+0000000000 +0018000000 0 0 0 0 0 0+0000000000 +0019000000 0 0 0 0 0 0+0000000000 +0020000000 0 0 0 0 0 0 +0000000000 +0021000000 0 0 0 0 0 0+0000000000 +0022000000 0 0 0 0 0 0+0000000000 +0023000000 0 0 0 0 0 0+0000000000 +0024000000 0 0 0 0 0 0 +0000000000 +0025000000 0 0 0 0 0 0 +0000000000 +0026000000 0 0 0 0 0 0+0000000000 +0027000000 0 0 0 0 0 0+0000000000 +0028000000 0 0 0 0 0 0+0000000000 +0029000000 0 0 0 0 0 0+0000000000 +0030000000 0 0 0 0 0 0-0000000001 +0000000000 0 0 0 0 0 0negative for “end of input”

1 - 25

Page 70: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Then each quotient is added to the accumulating sum in AC3, AC4, AC9, AC10 & AC14

Contents of AC1, AC2, and AC15 – AC20 punched and next card read.

At “end of input” contents of AC3, AC4, AC9, AC10 & AC14 also punched out

| AC1 | AC2 | AC15 . . .+0000000000 +0001000000 +0000000000 +0000000000 +0001000000 +0000000000 +0000000000 +0002000000 +0000000000 +0002000000 +0003000000 +0000000000 +0002000000 +0004000000 +0000000000 +0001000000 +0005000000 +0000000000 +0005000000 +0006000000 +0000000000 +0000000000 +0007000000 +0000000000 +0000000000 +0008000000 +0000000000 +0005000000 +0009000000 +0000000000 +0002000000 +0010000000 +0000000000 +0008000000 +0011000000 +0000000000 +0011000000 +0012000000 +0000000000 +0005000000 +0013000000 +0000000000 +0003000000 +0014000000 +0000000000 +0012000000 +0015000000 +0000000000 +0011000000 +0016000000 +0000000000 +0007000000 +0017000000 +0000000000 +0015000000 +0018000000 +0000000000 +0008000000 +0019000000 +0000000000 +0012000000 +0020000000 +0000000000 +0008000000 +0021000000 +0000000000 +0017000000 +0022000000 +0000000000 +0018000000 +0023000000 +0000000000 +0002000000 +0024000000 +0000000000 +0016000000 +0025000000 +0000000000 +0000000000 +0026000000 +0000000000 +0000000000 +0027000000 +0000000000 +0000000000 +0028000000 +0000000000 +0000000000 +0029000000 +0000000000 +0000000000 +0030000000 +0000000000 . . .

Page 71: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Sum Card

AC1 AC2 AC15 AC16 AC17 AC18 AC19 AC20

| AC01 | AC02 | AC15 | AC16 | AC17 | AC18 | AC19 | AC20 |+0000000000 +0000000000 +0000000000 +0002718280 +0000182840 +0000590450 +0000235360 +0000028620

Page 72: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

| AC01 | AC02 | AC15 | AC16 | AC17 | AC18 | AC19 | AC20 |+0000000000 +0001000000 +0000000000 +0001000000 +0000000000 +0000000000 +0000000000 +0000000000+0000000000 +0001000000 +0000000000 +0001000000 +0000000000 +0000000000 +0000000000 +0000000000+0000000000 +0002000000 +0000000000 +0000500000 +0000000000 +0000000000 +0000000000 +0000000000+0002000000 +0003000000 +0000000000 +0000166660 +0000666660 +0000666660 +0000666660 +0000666660+0002000000 +0004000000 +0000000000 +0000041660 +0000666660 +0000666660 +0000666660 +0000666660+0001000000 +0005000000 +0000000000 +0000008330 +0000333330 +0000333330 +0000333330 +0000333330+0005000000 +0006000000 +0000000000 +0000001380 +0000888880 +0000888880 +0000888880 +0000888880+0000000000 +0007000000 +0000000000 +0000000190 +0000841260 +0000984120 +0000698410 +0000269840+0000000000 +0008000000 +0000000000 +0000000020 +0000480150 +0000873010 +0000587300 +0000158730+0005000000 +0009000000 +0000000000 +0000000000 +0000275570 +0000319220 +0000398580 +0000906520+0002000000 +0010000000 +0000000000 +0000000000 +0000027550 +0000731920 +0000239850 +0000890650+0008000000 +0011000000 +0000000000 +0000000000 +0000002500 +0000521080 +0000385440 +0000171870+0011000000 +0012000000 +0000000000 +0000000000 +0000000200 +0000876750 +0000698780 +0000680980+0005000000 +0013000000 +0000000000 +0000000000 +0000000010 +0000605900 +0000438360 +0000821610+0003000000 +0014000000 +0000000000 +0000000000 +0000000000 +0000114700 +0000745590 +0000772970+0012000000 +0015000000 +0000000000 +0000000000 +0000000000 +0000007640 +0000716370 +0000318190+0011000000 +0016000000 +0000000000 +0000000000 +0000000000 +0000000470 +0000794770 +0000332380+0007000000 +0017000000 +0000000000 +0000000000 +0000000000 +0000000020 +0000811450 +0000725430+0015000000 +0018000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000156190 +0000206960+0008000000 +0019000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000008220 +0000063520+0012000000 +0020000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000410 +0000103170+0008000000 +0021000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000010 +0000957290+0017000000 +0022000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000088960+0018000000 +0023000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000003860+0002000000 +0024000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000160+0016000000 +0025000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000000+0000000000 +0026000000+0000000000 +0000000000 +0000000000 +0000000000 +0000000000 +0000000000+0000000000 +0000000000 +0000000000 +0002718280 +0000182840 +0000590450 +0000235360 +0000028620

Page 73: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

First not quite 25 digits of e

0002718280 +0000182840 +0000590450 +0000235360 +0000028620

will be carry overfrom term to right

+0002718280 +0000182840 +0000590450 +0000235360 +0000028620

Page 74: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The sum card is removed from the output deck. The output deck “turned around” and extended with the next set of denominators and numerators (plus an “end of input” card) and the program executed again. This will generate the next 25 digits of e.

Repeat by “turning around” and extending the output decks until 2000+ digits of e have been generated (25 digits at time).Finally total the summation cards (carry overs) to obtain e to 2000+ digits.

Page 75: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The Calculation for π

More difficult than e since the terms were more complicated. Required two programs, one to generate the terms for arctan(1/5) and arctan(1/239) and a second program to sum the terms.

The calculation for π, performed over Labor Day week-end in 1949, took 70 hours.

Page 76: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The mathematical formulas (2000+ digit accuracy!)

Calculation for e Calculation for π

3 5 7

3 5 7

1 14arctan arctan

4 5 239

1 1 1 14 ...

5 3 5 5 5 7 5

1 1 1 1...

239 3 239 5 239 7 239

1 1 1 11 1 ... ..

2! 3! 4! 800!e

1400+ terms neededterms are notquite as “recursive” asthe terms for e

terms for eare “recursive”

Page 77: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

What Was Learned

Recalling the reason for the calculation

“Only the following minor observation is offered at this time concerning the randomness of the distribution of digits. … A preliminary investigation has indicated that the digits of e deviate significantly from randomness (in the sense of staying closer to their expected values than a random sequence of this length normally would) while for π no significant deviations have so far been detected”

χ2 testused !

Page 78: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The Search Goes On

The ENIAC’s more than 2,000 digit record for π stood for five years until it was surpassed in 1954 by a 3,000-plus digit determination of π performed on the IBM built Naval Ordnance Research Computer (NORC).

It took 13 minutes!

In 1961 Shanks & Wrench computed 100,000 digits of π on an IBM 7090. It took 8 hours.

Page 79: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

1949: ENIAC - 2035 digits (70 Hours) 1953: NORC – 3089 digits (13 minutes)1958: IBM 704 – 10,000 digits (1 hr. 40 min.)1959: IBM 704 – 16,167 digits (4.3 hours)1961: IBM 7090 – 100,000 digits (8 hr. 43 min.)

October 16, 2011 – 10,000,000,000 digits (371 days)

http://www.numberworld.org/misc_runs/pi-10t/details.html

1 1 124arctan 8arctan 4arctan

8 57 239

π: Some (Early) Computer Generated Milestones

Note: 1010 < 1020 the value mentioned in Contact

Page 80: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

One Final Legacy

“Values of the auxiliary numbers arccot 5 and arccot 239 [i.e. arctan(1/5) and arctan(1/239)] to 2035D are in the possession of the author and also have been deposited in the library of Brown University and the UMT file of MTAC.”

The documents were found in the Mathematics of Computations Math Tables Collection 1944-1994 at the Briscoe Center for American History, University of Texas, Austin

Page 81: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

Summary

1. The determination of π is a very old problem.

2. The use of the ENIAC in 1949 was the first use of computer technology to determine π. It held the record for 5 years!

3. The ENIAC was not constructed to perform this type of high precision calculation yet it did – a tribute to the skill, ingenuity and abilities of its users.

4. We still don’t know if π is base 10 normal – we suspect it is but can we ever prove it?

Page 82: .. BRIAN SHELBURNE SINCLAIR COMMUNITY COLLEGE NOVEMBER 14, 2014 The ENIAC’s 1949 Determination of π.

The ENIAC’s 1949 Determination of π

Thank You

Brian J. ShelburneDepartment of Mathematics and Computer

ScienceWittenberg University