<<

THE BEGINNING of the by N. Metropolis

he year was 1945. Two earth- Some Background first electronic computer—the ENIAC— shaking events took place: the at the University of Pennsylvania in Phil- successful test at Alamogordo Most of us have grown so blase about adelphia. Their mentors were Physicist and the building of the first elec- computer developments and capabilities First Class John Mauchly and Brilliant tronicT computer. Their combined impact -even some that are spectacular—that Engineer Presper Eckert. Mauchly, fa- was to modify qualitatively the nature of it is difficult to believe or imagine there miliar with Geiger counters in global interactions between Russia and was a time when we suffered the noisy, laboratories, had realized that if electronic the West. No less perturbative were the painstakingly slow, electromechanical de- circuits could count, then they could do changes wrought in all of academic re- vices that chomped away on punched arithmetic and hence solve, inter alia, dif- search and in applied science. On a less cards. Their saving grace was that they ference equations—at almost incredible grand scale these events brought about a continued working around the clock, ex- speeds! When he’d seen a seemingly renascence of a mathematical technique cept for maintenance and occasional re- limitless array of women cranking out known to the old guard as statistical sam- pair (such as removing a dust particle firing tables with desk calculators, he’d pling; in its new surroundings and owing from a relay gap). But these machines been inspired to propose to the Ballistics to its nature, there was no denying its new helped enormously with the routine, rela- Research Laboratory at Aberdeen that an name of the Monte Carlo method. tively simple calculations that led to Hi- electronic computer be built to deal with This essay attempts to describe the de- roshima. these calculations. tails that led to this renascence and the , Professor of Math- roles played by the various actors. It is The ENIAC. During this wartime pe- ematics at the Institute for Advanced appropriate that it appears in an issue ded- riod, a team of scientists, engineers, and Study, was a consultant to Aberdeen and icated to Stan Ulam. technicians was working furiously on the to Los Alamos. For a whole host of

Los Alamos Science Special Issue 1987 125 Monte Carlo

reasons, he had become seriously inter- that was realistically calculable. (There ested in the thermonuclear problem being was a small interlude at Alamogordo!) spawned at that time in Los Alamos by The war ended before we completed our a friendly fellow-Hungarian scientist, Ed- set of problems, but it was agreed that we ward Teller, and his group. Johnny (as he continue working. Anthony Turkevich was affectionately called) let it be known joined the team and contributed substan- that construction of the ENIAC was near- tially to all aspects of the work. More- ing completion, and he wondered whether over, the uncertainty of the first phase of and I would be interested the postwar Los Alamos period prompted in preparing a preliminary computational to urge us not only to com- model of a thermonuclear reaction for the plete the thermonuclear computations but ENIAC. He felt he could convince the to document and provide a critical review authorities at Aberdeen that our problem of the results. could provide a more exhaustive test of the computer than mere firing-table com- The Spark. The review of the ENIAC putations. (The designers of the ENIAC results was held in the spring of 1946 had wisely provided for the capability of at Los Alamos. In addition to Edward much more ambitious versions of firing Teller, the principals included Enrico Fer- tables than were being arduously com- mi, John von Neumann, and the Direc- puted by hand, not to mention other quite tor, . Stanley Frankel, different applications.) Our response to Anthony Turkevich, and I described the von Neumann’s suggestion was enthusi- ENIAC, the calculations, and the con- astic, and his heuristic arguments were clusions. Although the model was rel- dition, however, Stan’s extensive mathe- accepted by the authorities at Aberdeen. atively simple, the simplifications were matical background made him aware that In March, 1945, Johnny, Frankel, and I taken into account and the extrapolated statistical sampling techniques had fallen visited the Moore School of Electrical En- results were cause for guarded optimism into desuetude because of the length and gineering at the University of Pennsylva- about the feasibility of a thermonuclear tediousness of the calculations. But with nia for an advance glimpse of the ENIAC. weapon. this miraculous development of the We were impressed. Its physical size Among the attendees was Stan Ulam, ENIAC—along with the applications Stan was overwhelming—some 18,000 double who had rejoined the Laboratory after must have been pondering—it occurred to triode vacuum tubes in a system with a brief time on the faculty him that statistical techniques should be 500,000 solder joints. No one ever had at the University of Southern California. resuscitated, and he discussed this idea such a wonderful toy! Ulam’s personality would stand out in with von Neumann. Thus was triggered The staff was dedicated and enthusi- any community, even where “characters” the spark that led to the Monte Carlo astic; the friendly cooperation is still re- abounded. His was an informal nature; he method. membered. The prevailing spirit was akin would drop in casually, without the usual to that in Los Alamos. What a pity that a amenities. He preferred to chat, more or The Method war seems necessary to launch such revo- less at leisure, rather than to dissertate. lutionary scientific endeavors. The com- Topics would range over mathematics, The spirit of this method was consis- ponents used in the ENIAC were joint- physics, world events, local news, games tent with Stan’s interest in random pro- army-navy (JAN) rejects. This fact not of chance, quotes from the classics—all cesses—from the simple to the sublime. only emphasizes the genius of Eckert and treated somewhat episodically but always He relaxed playing solitaire; he was stim- Mauchly and their staff, but also suggests with a meaningful point. His was a mind ulated by playing poker; he would cite that the ENIAC was technically realizable ready to provide a critical link. the times he drove into a filled parking even before we entered the war in Decem- During his wartime stint at the Labora- lot at the same moment someone was ac- ber, 1941. tory, Stan had become aware of the elec- commodatingly leaving. More seriously, After becoming saturated with indoc- tromechanical computers used for implo- he created the concept of “lucky num- trination about the general and detailed sion studies, so he was duly impressed, bers,” whose distribution was much like structure of the ENIAC, Frankel and I re- along with many other scientists, by the that of prime numbers; he was intrigued turned to Los Alamos to work on a model speed and versatility of the ENIAC. In ad- by the theory of branching processes and

126 Monte Carlo

contributed much to its development, in- tain spatial position. The next decisions cluding its application during the war to are the position of the first collision and multiplication in fission devices. the nature of that collision. If it is deter- For a long time his collection of research mined that a fission occurs, the number of interests included pattern development in emerging must be decided upon, two-dimensional games played according and each of these neutrons is eventually to very simple rules. Such work has lately followed in the same fashion as the first. emerged as a cottage industry known as If the collision is decreed to be a scatter- cellular automata. ing, appropriate statistics are invoked to John von Neumann saw the relevance determine the new momentum of the neu- of Ulam’s suggestion and, on March 11, 1947, sent a handwritten letter to Robert Richtmyer, the Theoretical Division lead- er (see “Stan Ulam, John von Neumann, and the Monte Carlo Method”). His let- ter included a detailed outline of a pos- sible statistical approach to solving the problem of neutron diffusion in fission- able material. Johnny’s interest in the method was contagious and inspiring. His seemingly relaxed attitude belied an intense interest and a well-disguised impatient drive. His talents were so obvious and his coopera- tive spirit so stimulating that he garnered the interest of many of us. It was at that time that I suggested an obvious name for the statistical method—a suggestion not unrelated to the fact that Stan had an John von Neumann uncle who would borrow money from rel- atives because he “just had to go to Monte tron. When the neutron crosses a material Carlo.” The name seems to have endured. boundary, the parameters and characteris- The spirit of Monte Carlo is best con- tics of the new medium are taken into ac- veyed by the example discussed in von count. Thus, a genealogical history of an Neumann’s letter to Richtmyer. Consider individual neutron is developed. The pro- a spherical core of fissionable material cess is repeated for other neutrons until a surrounded by a shell of tamper material. statistically valid picture is generated. Assume some initial distribution of neu- trons in space and in velocity but ignore Random Numbers. How are the vari- radiative and hydrodynamic effects. The ous decisions made? To start with, the idea is to now follow the development computer must have a source of uni- of a large number of individual neutron formly distributed psuedo-random num- chains as a consequence of scattering, ab- bers. A much used algorithm for gener- sorption, fission, and escape. ating such numbers is the so-called von At each stage a sequence of decisions Neumann “middle-square digits.” Here, has to be made based on statistical prob- an arbitrary n-digit integer is squared, abilities appropriate to the physical and creating a 2n-digit product. A new in- geometric factors. The first two decisions teger is formed by extracting the middle occur at time t = O, when a neutron is se- n-digits from the product. This process lected to have a certain velocity and a cer- is iterated over and over, forming a chain

127 Monte Carlo

example, see the section entitled “The learned that Fermi took great delight in versed. When a material boundary was Monte Carlo Method” in “A Primer on astonishing his Roman colleagues with crossed, another choice was made appro- Probability, Measure, and the Laws of his remarkably accurate, “too-good-to-be- priate to the new material. The device Large Numbers.”) Since its inception, lieve” predictions of experimental results. could accommodate two neutron energies, many international conferences have been After indulging himself, he revealed that referred to as “slow” and “fast.” Once held on the various applications of the his “guesses” were really derived from again, the Master had just the right feel method. Recently, these range from the statistical sampling techniques that he for what was meaningful and relevant to the conference, “Monte Carlo Methods used to calculate with whenever insomnia do in the pursuit of science. and Applications in Neutronics, Photon- struck in the wee morning hours! And ics, and Statistical Physics,” at Cadarache so it was that nearly fifteen years earlier, The First Ambitious Test. Much to Castle, France, in the spring of 1985 to Fermi had independently developed the the amazement of many “experts,” the the latest at Los Alamos, “Frontiers of Monte Carlo method. ENIAC survived the vicissitudes of its Quantum Monte Carlo,” in September, 200-mile journey. In the meantime Rich- I 1985. ard Clippinger, a staff member at Ab- erdeen, had suggested that the ENIAC had sufficient flexibility to permit its con- I Putting the Method into Practice trols to be reorganized into a more conve- Let me return to the historical account. nient (albeit static) stored-program mode In late 1947 the ENIAC was to be moved of operation. This mode would have a to its permanent home at the Ballistics capacity of 1800 instructions from a vo- Research Laboratory in Maryland. What cabulary of about 60 arithmetical and log- a gargantuan task! Few observers were ical operations. The previous method of of the opinion that it would ever do an- programming might be likened to a gi- 1 other multiplication or even an addition. ant plugboard, that is to say, to a can It is a tribute to the patience and skill of worms. Although implementing the of Josh Gray and Richard Merwin, two new approach is an interesting story, suf- fearless uninitiated, that the move was a fice it to say that Johnny’s wife, Klari, success. One salutary effect of the inter- and I designed the new controls in about ruption for Monte Carlo was that another two months and completed the implemen- distinguished physicist took this occasion tation in a fortnight. We then had the to resume his interest in statistical studies. opportunity of using the ENIAC for the helped create modern Enrico Fermi first ambitious test of the Monte Carlo physics. Here, we focus on his inter- method—a variety of problems in neu- est in neutron diffusion during those ex- It was then natural for Fermi, during tron transport done in collaboration with citing times in Rome in the early thir- the hiatus in the ENIAC operation, to Johnny. ties. According to Emilio Segre, Fermi’s dream up a simple but ingenious ana- Nine problems were computed corre- student and collaborator, “Fermi had in- log device to implement studies in neu- sponding to various configurations of ma- vented, but of course not named, the tron transport. He persuaded his friend terials, initial distributions of neutrons, present Monte Carlo method when he was and collaborator Percy King, while on a and running times. These problems, as studying the moderation of neutrons in hike one Sunday morning in the moun- yet, did not include hydrodynamic or ra- Rome. He did not publish anything on tains surrounding Los Alamos, to build diative effects, but complex geometries the subject, but he used the method to such an instrument—later affectionately and realistic neutron-velocity spectra solve many problems with whatever cal- called the FERMIAC (see the accompa- were handled easily. The neutron histo- culating facilities he had, chiefly a small nying photo). ries were subjected to a variety of statisti- mechanical adding machine.”* The FERMIAC developed neutron ge- cal analyses and comparisons with other In a recent conversation with Segre, I nealogies in two dimensions, that is, in a approaches. Conclusions about the effi- plane, by generating the site of the “next cacy of the method were quite favorable. collision. ” Each generation was based It seemed as though Monte Carlo was Company from From X-Rays to Quarks by Emilio on a choice of parameters that charac- here to stay. Segre. terized the particular material being tra- Not long afterward, other Laboratory

128 Monte Carlo

THE FERMIAC

The Monte Carlo trolley, or FERMIAC, was invented by Enrico Fermi and constructed by Percy King. The drums on the trolley were set according to the material being tra- versed and a random choice between fast and slow neutrons. Another random digit was used to determine the direction of mo- tion, and a third was selected to give the dis- tance to the next collision. The trolley was then operated by moving it across a two- dimensional scale drawing of the nuclear device or reactor assembly being studied. The trolley drew a path as it rolled, stopping for changes in drum settings whenever a material boundary was crossed. This infant computer was used for about two years to determine, among other things, the change in neutron population with time in numerous types of nuclear systems.

staff members made their pilgrimages to symposium on the Monte Carlo method, of state based on the two-dimensional ENIAC to run Monte Carlo problems. sponsored by the Rand Corporation, the motion of hard spheres. The work was These included J. Calkin, C. Evans, and National Bureau of Standards, and the a collaborative effort with the Tellers, F. Evans, who studied a thermonuclear Oak Ridge Laboratory, was held in Los Edward and Mici, and the Rosenbluths, problem using a cylindrical model as well Angeles. Later, a second symposium was Marshall and Arianna (see “Monte Carlo as the simpler spherical one. B. Suydam organized by members of the Statistical at Work”). During this study a strategy and R. Stark tested the concept of artifi- Laboratory at the in was developed that led to greater com- cial viscosity on time-dependent shocks; Gainesville. puting efficiency for equilibrium systems they also, for the first time, tested and In early 1952a new computer, the MA- obeying the Boltzmann distribution func- found satisfactory an approach to hydro- NIAC, became operational at Los Ala- tion. According to this strategy, if a sta- dynamics using a realistic equation of mos. Soon after Anthony Turkevich led tistical “move” of a particle in the sys- state in spherical geometry. Also, the dis- a study of the nuclear cascades that result tem resulted in a decrease in the energy tinguished (and mysterious) mathemati- when an accelerated particle collides with of the system, the new configuration was cian C. J. Everett was taking an inter- a nucleus. The incoming particle strikes accepted. On the other hand, if there was est in Monte Carlo that would culminate a nucleon, experiencing either an elastic an increase in energy, the new configu- in a series of outstanding publications in or an inelastic scattering, with the latter ration was accepted only if it survived a collaboration with E. Cashwell. Mean- event producing a pion. In this study par- game of chance biased by a Boltzmann while, Richtmyer was very actively run- ticles and their subsequent collisions were factor. Otherwise, the old configuration ning Monte Carlo problems on the so- followed until all particles either escaped became a new statistic. called SSEC during its brief existence at from the nucleus or their energy dropped It is interesting to look back over two- IBM in New York. below some threshold value. The “exper- score years and note the emergence, rather In many ways, as one looks back, it iment” was repeated until sufficient statis- early on, of experimental mathematics, was among the best of times. tics were accumulated. A whole series of a natural consequence of the electronic target nuclei and incoming particle ener- computer. The role of the Monte Carlo Rapid Growth. Applications discussed gies was examined. method in reinforcing such mathematics in the literature were many and varied Another computational problem run on seems self-evident. When display units and spread quickly. By midyear 1949 a the MANIAC was a study of equations were introduced, the temptation to exper-

129 Monte Carlo

iment became almost irresistible, at least routes, making communication both flex- Further Reading for the fortunate few who enjoyed the lux- ible and efficient. The computer has been S. Ulam, R. D. Richtmyer, and J. von Neumann. ury of a hands-on policy. When shared- used on such problems as turbulent fluid 1947. Statistical methods in neutron diffusion. Los time operations became realistic, exper- flow, imaging processing (with features Alamos Scientific Laboratory report LAMS–551. imental mathematics came of age. At analogous to the human visual system), This reference contains the von Neumann letter dis- long last, mathematics achieved a certain document retrieval, and “common-sense” cussed in the present article. parity-the twofold aspect of experiment reasoning in artificial intelligence. N. Metropolis and S. Ulam. 1949. The Monte and theory-that all other sciences enjoy. One natural application of massive par- Carlo method. Journal of the American Statistical It is, in fact, the coupling of the sub- allelism would be to the more ambitious Association 44:335-341. tleties of the human brain with rapid Monte Carlo problems already upon us. S. Ulam. 1950. Random processes and transforma- and reliable calculations, both arithmeti- To achieve good statistics in Monte Carlo tions. Proceedings of the International Congress of cal and logical, by the modern computer calculations, a large number of “histories” 2:264-275. that has stimulated the development of need to be followed. Although each his- Los Alamos Scientific Laboratory. 1966. Fermi in- experimental mathematics. This develop- tory has its own unique path, the under- vention rediscovered at LASL. The Atom, October, ment will enable us to achieve Olympian lying calculations for all paths are highly pp. 7-11. heights. parallel in nature. C. C. Hurd. 1985. A note on early Monte Carlo Still, the magnitude of the endeavor computations and scientific meetings. Annals of the History of Computing 7:141–155. The Future to compute on massively parallel devices must not be underestimated. Some of the W. Daniel Hillis. 1987. The connection machine. So far I have summarized the rebirth tools and techniques needed are: Scientific American, June, pp. 108–1 15. of statistical sampling under the rubric ● A high-level language and new archi- of Monte Carlo. What of the future— tecture able to deal with the demands N. Metropolis received his B.S. (1937) and his perhaps even a not too distant future? of such a sophisticated language (to the Ph.D. ( 1941) in physics at the University of Chi- cago. He arrived in Los Alamos, April 1943, as The miracle of the chip, like most mir- relief of the user); a member of the original staff of fifty scientists. acles, is almost unbelievable. Yet the fan- ● Highly efficient operating systems and After the war he returned to the faculty of the tastic performances achieved to date have compilers; University of Chicago as Assistant Professor. He not quieted all users. At the same time we ● Use of modern combinatorial theory, came back to Los Alamos in 1948 to form the are reaching upper limits on the comput- perhaps even new principles of logic, group that designed and built MANIAC I and II. (He chose the name MANIAC in the hope of stopping ing power of a single processor. in the development of elegant, compre- the rash of such acronyms for machine names, but One bright facet of the miracle is the hensive architectures; may have, instead, only further stimulated such use.) lack of macroscopic moving parts, which ● A fresh look at numerical analysis and From 1957 to 1965 he was Professor of Physics makes the chip a very reliable bit of the preparation of new algorithms (we at the University of Chicago and was the founding hardware. Such reliability suggests par- have been mesmerized by serial com- Director of its Institute for Computer Research. In 1965 he returned to Los Alamos where he was made allel processing. The thought here is putation and purblind to the sophistica- a Laboratory Senior Fellow in 1980. Although he not a simple extension to two, or even tion and artistry of parallelism). retired recently, he remains active as a Laboratory four or eight, processing systems. Such Where will all this lead? If one were Senior Fellow Emeritus. extensions are adiabatic transitions that, to wax enthusiastic, perhaps—just per- to be sure, should be part of the im- haps—a simplified model of the brain mediate, short-term game plan. Rather, might be studied. These studies, in turn, the thought is massively parallel opera- might provide feedback to computer ar- tions with thousands of interacting pro- chitects designing the new parallel struc- cessors-even millions! tures. Already commercially available is one Such matters fascinated Stan Ulam. He computer, the Connection Machine, with often mused about the nature of memory 65,536 simple processors working in par- and how it was implemented in the brain. allel. The processors are linked in such Most important, though, his own brain a way that no processor in the array is possessed the fertile imagination needed more than twelve wires away from an- to make substantive contributions to the other and the processors are pairwise con- very important pursuit of understanding nected by a number of equally efficient intelligence. ■

130