Monte Carlo simulation, born of a game of solitaire
Los Angeles, January 1946. A 36-year-old mathematician wakes up from emergency brain surgery. Encephalitis has nearly killed him. During the crisis he lost the power of speech, and he wonders whether his mind is intact. To pass the time, he plays solitaire. A simple question comes to him: what are my chances of winning?

Fifty-two cards
The mathematician is Stanislaw Ulam. Born in 1909 in Lemberg, today's Lviv, he sailed for the United States in August 1939, eleven days before Germany invaded Poland. He worked on the Manhattan Project at Los Alamos, then became a professor at the University of Southern California. While he recovers, friends come to visit. The mathematician Paul Erdős reassures him: "Stan, you are just like before."
On his table is a game of Canfield solitaire, laid out with fifty-two cards. What is the probability that it will come out? Ulam tries to work it out by pure combinatorics. He spends a long time on it. The calculation will not come.
So he wonders whether there might be a more practical method than "abstract thinking": lay the game out, say, a hundred times, and simply observe and count the successful plays.
The neutron problem
Ulam's idea might have stayed a pastime but for one detail. The first fast computers are arriving. What would be tedious by hand, a machine can repeat thousands of times.
Ulam immediately thinks of a problem blocking the physicists at Los Alamos: neutron diffusion in the core of a nuclear weapon. They have almost all the data they need, such as the average distance a neutron travels before hitting a nucleus and the energy it gives off in the collision. But conventional mathematical methods cannot produce the answer.
Later in 1946 Ulam describes his idea to John von Neumann. Von Neumann sees its significance at once. In March 1947 he proposes a statistical approach to neutron diffusion. Instead of solving the equation, you follow thousands of neutrons at random, collision after collision, and count what becomes of them.
A casino's name
The work is secret, so it needs a code name. A colleague, Nicholas Metropolis, suggests one. Ulam often talks about his uncle Michał, who borrowed money from relatives because he "just had to go to Monte Carlo" to gamble. The Monte Carlo method has its name.
In the spring of 1948 von Neumann, Metropolis and others program ENIAC, one of the first electronic computers, to run the first fully automated Monte Carlo calculations. In 1949 Metropolis and Ulam publish the first unclassified paper on the method.
The idea had ancestors. Buffon's needle problem, posed in the 18th century, makes it possible to estimate pi by dropping needles on a floor of parallel strips. In the 1930s Enrico Fermi had experimented along these lines with neutrons, without publishing. But it was Ulam, with computers, who turned it into a general method: using randomness to solve problems that have nothing random about them.
A cap and a neck
In a packaging plant, Ulam's question comes back in another form. A cap screws onto a neck. Every dimension has its tolerance: thread diameter, wall thickness, finish height. All of them vary slightly from one part to the next. Will the cap seal properly?
This is the tolerance stack-up. There are two ways to answer it: - worst case: each dimension is set at its least favourable limit. If the assembly works, it will always work. But this method often demands very tight tolerances, hence costly manufacturing and inspection, or high scrap rates; - statistics: each dimension is described by its distribution, often close to the normal distribution, and the distribution of the assembly is predicted. A Monte Carlo simulation draws thousands of caps and necks at random, assembles them by calculation, and counts the ones that seal badly.
Worst case is still often required for critical interfaces. Elsewhere, statistics allows wider tolerances without losing quality. See injection molding tolerances, the bottle neck finish, cap torque, parting line and shrinkage and mold flow analysis. For how we design our molds, see our expertise.
In 1946, convalescing in bed, Ulam did not find the probability of winning at solitaire. He found something better: permission not to calculate it. Today, before the steel of a mold is cut, the same game is played thousands of times, with caps and necks instead of cards, and the results are counted.
Glossary
- Monte Carlo method
- A calculation method that repeats a large number of random draws to estimate a result.
- Monte Carlo simulation
- Applying the method to a real system, such as an assembly of parts.
- Tolerance stack-up
- Calculating the combined effect of variations in several dimensions on an assembly.
- Worst case
- An analysis that sets each dimension at its least favourable limit.
- Neutron diffusion
- The path of neutrons through matter, from collision to collision.