This story is over 5 years old.


How Solitaire Inspired the World’s Most Useful Simulation Tool

A brief history of the Monte Carlo method.
Monte Carlo simulation of runaway relativistic electron avalanche (RREA) in air. Credit: Becarlson

Science history is packed with tall tales about groundbreaking revelations sparked by everyday observations. From Archimedes's "Eureka!" moment in his bathtub to Newton's apple-based paradigm shift, some of the science legends that have gained the most cultural traction are the ones that are the most obviously apocryphal.

However, that doesn't mean there's no truth to the idea that great insights frequently emerge from the most casual ruminations, and nowhere is that more clear than with the origins of the Monte Carlo method of computation.


This method of using random number sequences to simulate complex phenomena has become one of the most influential computing tools in the world, and is used to model everything from the stock market to the entire universe. But when it was first developed by mathematician Stanislaw Ulam, it had a much simpler purpose—predicting solitaire outcomes.

Ulam was one of the key figures involved in the Manhattan Project, and a total visionary in the field of thermonuclear physics. But just as his work at Los Alamos was coming to a close in 1945, Ulam slipped into a coma as a result of viral encephalitis. His family prepared for the possibility that he might suffer brain damage, and indeed, Ulam was rendered temporarily mute.

Stanislaw Ulam with the FERMIAC analog computer that helped make the Monte Carlo method a reality. Credit: Gregg C. Giesler, Los Alamos National Laboratory

But they needn't have feared that his discoveries were at an end. Instead, Ulam made one of his most significant breakthroughs before he was even out of his recovery period, and indeed, some believed his invasive brain surgery may have even catalyzed his next wave of genius.

"The first thoughts and attempts I made to practice [the Monte Carlo method] were suggested by a question which occurred to me in 1946 as I was convalescing from an illness and playing solitaires," said Ulam in 1983, according to Los Alamos Science. "The question was what are the chances that a Canfield solitaire laid out with 52 cards will come out successfully?"

Canfield solitaire is a variation of solitaire with very low odds of winning. Ulam thought he might be able to figure out a mathematical shortcut to predicting the game's outcome, but had no luck deriving one. Instead, he began to wonder if it would be more effective to simply record the outcomes of 100 games and calculate a crude percentage that way.


Ulam was familiar with the pioneering research being conducted with the Electronic Numerical Integrator And Computer (ELIAC), the world's first large scale electrical computer. He quickly recognized the machine's potential to become an artificial statistics buff, capable of running through numerous models and outcomes in a fraction of the time it would take a human.

ENIAC in the 1940s, operated by Betty Jennings (left) and Frances Bilas (right). Image: United States Army

"This was already possible to envisage with the beginning of the new era of fast computers," said Ulam, "and I immediately thought of problems of neutron diffusion and other questions of mathematical physics, and more generally how to change processes described by certain differential equations into an equivalent form interpretable as a succession of random operations."

By the end of 1946, Ulam had reached out to the prolific mathematician John von Neumann with this idea, and the pair began to work out the basis of what would become the one of the most widely used simulations in computational science. The team gave it the code name "Monte Carlo" after the European gambling capital because, in essence, the method is one of the most sophisticated slot machines in the world.

In the seven decades since Ulam and von Neumann first developed the method, Monte Carlo simulations have permeated practically every field that utilizes probability and statistics (and honestly, what fields don't?). As computational speeds have accelerated and random number generators have matured, the method's ability to model complex phenomena has become increasingly more accurate, multipurpose, and widespread.


Just yesterday, for example, Motherboard's Victoria Turk wrote about using Monte Carlo simulations to try to predict the United Kingdom's election outcome. A spattering of other recent applications include modeling the gambling intelligence of plants, the inner mechanics of cellular metabolism, or the likelihood of surviving a zombie attack. It goes to show that the method's reach can extend from the most essential of scientific mysteries to the most frivolous of statistical riffs, including the below demonstration of how LeBron James should strategize his late game plays.

Monte Carlo simulation of basketball plays. Credit: Khan Academy/YouTube

In fact, it would be interesting to run a Monte Carlo simulation predicting how many Monte Carlo simulations are being run worldwide every day—a meta Monte Carlo. The answer would no doubt further consolidate the method's status as a major cornerstone of 21st century research.

It's weird to reflect on the fact that this all-encompassing technique originated with Ulam laid up in bed, playing cards to pass the time. While other people had experimented with proto-versions of Monte Carlo before him, including Ulam's friend and fellow visionary Enrico Fermi, it wasn't until Ulam himself was physically forced to take a break from his thermonuclear research that the method's true potential became apparent.

As I mentioned up top, this idea of an "epiphany moment" tends to be heavily romanticized in science history, as evidenced by the legends surrounding Newton and Archimedes. In a way, that impulse to idealize history reflects the upshot of the Monte Carlo method itself—to simplify an aggressively unsimple world.

But in the case of the method's own history, no grandiose frills are needed. What began as a game of Canfield solitaire almost 70 years ago has now become an endlessly diversifying technique of modeling every aspect of our universe—and universes beyond it. And that is an outcome that even the most sophisticated Monte Carlo simulation would have been hard-pressed to predict.

Perfect Worlds is a series on Motherboard about simulations, imitations, and models. Follow along here.