Stephen Wolfram was in his Caltech office more than 20 years ago, working late on an autumn evening, when he saw something on his computer screen that shocked and confused him.

The 21-year-old physicist, already a member of the Caltech faculty, had been experimenting with elementary computer programs. He expected them to generate simple, predictable patterns: checkerboards or nested triangles.

Instead, one of the programs spawned complex images that resembled the veins in a leaf. Another filled the screen with what looked like the elegant lace of snowflakes. A third spun out wave after wave of shapes that grew increasingly intricate and varied.

Wolfram had stumbled onto a few lines of computer code that mimicked the ordered chaos of nature. Infinite complexity seemed to arise from ultimate simplicity.

Two decades later, that revelation has blossomed into a grand theory that has raised a furor in the scientific world and sparked a rush by laymen to grasp Wolfram’s audacious thesis: The universe is no more than a computer playing out a program of stupefying simplicity.

“If things work out as I expect, there will come a day when one can hold the lines of code that created the whole universe in one’s hand,” said Wolfram, who revealed his big idea in a 1,200-page self-published opus titled “A New Kind of Science.”

Released in May, the tome has soared to the top of Amazon.com’s bestseller list, selling out its first printing of 50,000 at $44.95 each.

To Wolfram, a British-born prodigy who earned a doctorate in theoretical physics at age 20 and won a MacArthur “genius” fellowship at 21, rules as simple as tick-tack-toe are the driving force behind all of nature--from single-cell amoebas to the Rev. Martin Luther King Jr.

The universe began, he maintains, with a few basic instructions that played themselves out over billions of years to produce everything that exists today. This simple code, he says, underlies consciousness itself, giving rise to our every thought--from the sudden desire for a scoop of chocolate ice cream to Wolfram’s own theory.

Like a literary big bang, Wolfram’s book has stimulated dozens of reviews and articles in the general and scientific press and has lit up Internet discussion groups. Much of the scientific world is howling in protest, calling his theory the product of a monumental ego unleashed from reality.

For centuries, scientists have sought to explain the natural world--from the rotations of galaxies to the spin of subatomic particles--with mathematical equations. From Isaac Newton’s epiphany about gravity and a falling apple to the building of the atomic bomb, the arcane abstractions of calculus have been the key to the universe.

But math falls short when it comes to describing the soft-edged diversity of the natural world. Scientists could fill all the chalkboards in all the universities in the world with equations and still fail to explain the brilliant spots on tropical fish, the contours of wind-blown sand or the shifting shape of a plume of cigar smoke. Mathematics is even more inadequate when it comes to simulating intangibles such as the economy, let alone the vagaries of human thought.

Wolfram, 42, says the answers lie not in the limited tools of old science but in simple computer programs.

He does not pretend to know what lines of code would create a sausage, let alone a solar system. His point is that the basic instructions that create intricate patterns on a computer screen will help us understand what creates similar patterns in nature.

His book is packed with images of Sumerian mosaics and strawberries, earthquake fissures and leopard spots, thermonuclear mushroom clouds and streams of clear water--all modeled with uncanny precision, he says, by shimmering dot patterns generated on a computer screen by a few simple rules.

These pictures, Wolfram argues, reveal a pervasive truth that has been hiding in plain sight.

In presenting this notion to the world, Wolfram has sidestepped time-honored scientific procedures. Instead of submitting a paper to a peer-reviewed scholarly journal and letting colleagues try to pick it apart, he is making his case directly to a mass audience in simple, nontechnical language. This fall, he plans a road show to proselytize about his ideas.

“There just isn’t a mechanism within the current structure of science to present things as big as what I’m trying to do,” he said.

Actually, “big” doesn’t begin to capture it, Wolfram says. He describes his theory as “one of the more important single discoveries in the whole history of theoretical science,” akin to those of Copernicus, who overturned centuries of orthodoxy by proving in 1530 that the Earth was not the center of the universe, and Charles Darwin, whose 1859 theory of natural selection shattered religious dogma about creation.

A Leap of Faith?

Raymond Kurzweil, a celebrated inventor and expert in artificial intelligence, has posted on his Web site a stinging 8,000-word critique that faults Wolfram for an outrageous leap of faith--for concluding that because simple rules can spin out beguiling complexity, they must be behind the deepest mysteries of life.

Kurzweil finds elements of Wolfram’s theory intriguing but says he fails to prove that the unending variation of dots on a page explains higher orders of complexity. “How do we get from these interesting but limited patterns,” Kurzweil asks, “to those of insects or humans or Chopin preludes?”

Chris Adami, a Caltech theoretical physicist who is a leader in using computers to model complex living systems, dismissed Wolfram’s work as “pathetic” and “exasperating.”

“Wolfram’s naivete about biological complexity is stunning,” Adami said. “We call this ‘crackpot science.’ ”

But amid the criticism is a persistent murmur of curiosity from general readers and scientists alike.

Wolfram’s premise is particularly seductive for anyone who has ever struggled in physics or math class. Instead of relying on impenetrable equations to describe the universe, he sees the boundless complexity of the natural world--from the coloration of seashells to worldwide weather patterns--as the result of inherent rules simple enough for anyone to understand.

Sequestered near Boston--his precise location kept secret to foil “the next Unabomber"--he talked nonstop recently for nearly two hours, with the unique confidence of a millionaire genius who has been building his case for two decades.

“There will come a time when we can emulate the essence of human thinking in machines,” he said, characteristically racing ahead to the outer edge of his idea. “What does that mean for the future of the human condition?”

Wolfram’s theory traces its roots to a computer game created by Princeton University mathematician John Conway more than 30 years ago. The game, called simply Life, became a cult classic after it was reviewed in Scientific American magazine.

Players begin by using their cursors to blacken selected squares on a grid. Then they click on the “go” button and the game unfolds according to three rules. Any blackened square with two or three blackened neighbors “lives.” Any square with four neighbors “dies"--that is, disappears from the screen. An empty square bordered by three blackened squares gives birth to a new blackened square.

The ensuing patterns, basic at first, soon develop mesmerizing complexity as the game’s logic plays itself out. As successive generations of blackened squares breed and die, the computer screen becomes a roiling stew of activity that looks like a petri dish of bacteria blooming at high speed.

Each game varies according to how many squares were darkened at the beginning and in what pattern. Most starting points end up as static patterns after bubbling through many generations. But others cause unending growth and perpetual motion.

Initially, Wolfram had dismissed Life as a toy. Then he began to experiment with his own simple computer programs, called “cellular automata” for their property of automatically generating cells, or squares. By 1981, he came to see Life as a validation of his budding theory.

The programs with which Wolfram was tinkering are slightly more complex than Life, governed by eight rules, rather than Life’s three, for determining whether squares “live” or “die.” These programs come in 256 variations. Wolfram began testing all 256 of them.

He discovered that some--such as Rule 30, on which many of his conclusions are based--build infinitely varying patterns. He gradually came to believe that the frenetic disorder generated by Rule 30 was as complex as anything in the universe.

Credibility an Issue

Wolfram nurtured his obsession as he migrated from Caltech to Princeton’s Institute for Advanced Studies, where colleagues expected him to expand his promising career in cosmology and particle physics. Instead, Wolfram stubbornly pursued his research in the obscure field of automata, working in an office upstairs from one Albert Einstein had occupied two generations earlier.

His ideas would have been ignored as the ravings of a crank, were he not Stephen Wolfram.

His staggering intellect had long set him apart. Aside from his early theoretical achievements, at age 27 Wolfram created Mathematica, a software program widely used to perform complex mathematical functions and analyze and display data. It became the dominant software for math and physics and made Wolfram rich.

With Mathematica, “Wolfram’s already taken over a large part of how science is done,” said Mott Greene, another MacArthur fellow and a science historian at the University of Puget Sound in Tacoma, Wash. “His influence is felt everywhere.”

Unshakable confidence and financial independence freed Wolfram to follow his passion. For 10 years he became a recluse--a phantom whose occasional appearances sparked the question: “What is Stephen Wolfram really up to?”

On the first page of his long-awaited book, he answers:

“Three centuries ago, science was transformed by the dramatic new idea that rules based on mathematical equations could be used to describe the natural world. My purpose in this book is to initiate another such transformation, and to introduce a new kind of science that is based on the much more general types of rules that can be embodied in simple computer programs.”

The first part of the book lays out how cellular automata model natural phenomena, such as the shapes of snowflakes. Wolfram then extends the idea to living or dynamic systems--from wasp nests to water jets--and argues that these too can be simulated by simple computer programs.

Next, he moves on to human-designed systems and says that he was able to mimic the gyrations of financial markets with a program that uses just four rules for buying and selling securities.

The heart of his argument is that his computer patterns are as intricate as any object in nature, and that, therefore, the screen images and the objects in nature must have a common origin.

This idea finds its most ambitious expression as Wolfram’s “principle of computational equivalence.” It holds that a leaf, a star, a human being and one of Wolfram’s cellular automata are all equivalent in that they arise from the same kind of simple rules.

“If we compare ourselves with other systems in nature, we might ask, ‘What’s special about us?’ ” he said.

Wolfram believes his ideas will transform science and engineering and influence philosophy, economics, even art.

“It seems so easy for nature to produce forms of great beauty,” he writes. “In the past, art has mostly just had to be content to imitate such forms.” But with his discoveries, he says, “extremely simple rules will often be able to generate pictures that have striking aesthetic qualities--sometimes reminiscent of nature, but often unlike anything ever seen before.”

Simple programs, he says, may one day unlock problems too complex to solve even with today’s massive computer power, such as how traffic jams form and how they can be unwound. Basic rules that model the growth of a tumor could explain how to stop cancer. Programs that simulate neural pathways might lead to super-intelligent machines.

“One can imagine building things that capture the essential purposes achieved by natural systems,” even the brain, Wolfram said, “but without the extra baggage of, for example, having the actual hairy animal.”

No leading scientist has endorsed Wolfram’s theory wholesale, but many say his ideas are provocative.

“The feeling is that this is written by a genius,” said H. Eugene Stanley, a physicist at Boston University. Maybe not all of nature is as described by Wolfram, he said, “but at least a big part of it is.”

Wolfram’s “new kind of science” entices specialists frustrated with mathematical formulas that explain hydrogen atoms or planetary orbits but “fail miserably” in fields such as biology, where systems are much more diverse, said Terry Sejnowski, director of the Computational Neurobiology Laboratory at UC San Diego and a Wolfram confidant.

Raymond Jeanloz, a UC Berkeley geophysicist, says Wolfram’s hypothesis has revolutionary potential.

“The modern approach in much of science has been reductionist: You take a complicated thing and split it up into units that are less complicated,” he said. “Wolfram’s approach is the direct opposite: Start with simplicity instead of complexity. If he’s right, this could be a huge step forward in the way we approach scientific problems--and maybe most complicated issues in life as a whole.”

Links to Chaos Theory

Other scholars regard many of Wolfram’s “discoveries” as uncredited borrowings. They note that physicist Richard Feynman and mathematician Norbert Weiner described the universe as kind of a giant digital computer decades ago, and that physicist Edward Fredkin explored biological processes and consciousness through the framework of simple computer programs.

Some experts say Wolfram also borrows heavily from chaos theory--the study of complex interactive systems.

Paradoxically, Wolfram’s hypothesis also embraces one of humanity’s earliest attempts to comprehend the natural world--the pre-Christian creed of animism, which considers living beings and inanimate objects equal in that all possess a soul.

In Wolfram’s “new science,” a person, a dog and a rock all emerge from the same kind of simple rules and therefore are, in an essential way, the same.

Wolfram’s theory also could bolster the age-old belief in predestination. The idea that God preordains all things is uncannily similar to simple computer programs playing out in inevitable, though unpredictable, ways.

During a recent interview, Wolfram acknowledged that the implications of his theory sometimes scare even him. He began to sputter, stumbling over his words in an effort to explain. Gradually, he regained his footing. He said he expects, before he dies, to discover the simple source code from which all works of creation have flowed.

“Will that be fundamentally disappointing?” he asked softly. “That this is all there is, a few lines of code?”

Then he fell silent.