When Martin Nowak was in high school, his parents thought he would be a nice boy and become a doctor. But when he left for the University of Vienna, he abandoned medicine for something called biochemistry. As far as his parents could tell, it had something to do with yeast and fermenting. They became a little worried. When their son entered graduate school, they became even more worried. He announced that he was now studying games.

In the end, Dr. Nowak turned out all right. He is now the director of the Program for Evolutionary Dynamics at Harvard. The games were actually versatile mathematical models that Dr. Nowak could use to make important discoveries in fields as varied as economics and cancer biology.

“Martin has a passion for taking informal ideas that people like me find theoretically important and framing them as mathematical models,” said Steven Pinker, a Harvard linguist who is collaborating with Dr. Nowak to study the evolution of language. “He allows our intuitions about what leads to what to be put to a test.”

On the surface, Dr. Nowak’s many projects may seem randomly scattered across the sciences. But there is an underlying theme to his work. He wants to understand one of the most puzzling yet fundamental features of life: cooperation.

When biologists speak of cooperation, they speak more broadly than the rest of us. Cooperation is what happens when someone or something gets a benefit because someone or something else pays a cost. The benefit can take many forms, like money or reproductive success. A friend takes off work to pick you up from the hospital. A sterile worker bee tends to eggs in a hive. Even the cells in the human body cooperate. Rather than reproducing as fast as it can, each cell respects the needs of the body, helping to form the heart, the lungs or other vital organs. Even the genes in a genome cooperate, to bring an organism to life.

In recent papers, Dr. Nowak has argued that cooperation is one of the three basic principles of evolution. The other two are mutation and selection. On their own, mutation and selection can transform a species, giving rise to new traits like limbs and eyes. But cooperation is essential for life to evolve to a new level of organization. Single-celled protozoa had to cooperate to give rise to the first multicellular animals. Humans had to cooperate for complex societies to emerge.

“We see this principle everywhere in evolution where interesting things are happening,” Dr. Nowak said.

While cooperation may be central to evolution, however, it poses questions that are not easy to answer. How can competing individuals start to cooperate for the greater good? And how do they continue to cooperate in the face of exploitation? To answer these questions, Dr. Nowak plays games.

His games are the intellectual descendants of a puzzle known as the Prisoner’s Dilemma. Imagine two prisoners are separately offered the same deal: if one of them testifies and the other doesn’t talk, the talker will go free and the holdout will go to jail for 10 years. If both refuse to talk, the prosecutor will only be able to put them in jail for six months. If each prisoner rats out the other, they will both get five-year sentences. Not knowing what the other prisoner will do, how should each one act?

The way the Prisoner’s Dilemma pits cooperation against defection distills an important feature of evolution. In any encounter between two members of the same species, each one may cooperate or defect. Certain species of bacteria, for example, spray out enzymes that break down food, which all the bacteria can then suck up. It costs energy to make these enzymes. If one of the microbes stops cooperating and does not make the enzymes, it can still enjoy the meal. It can gain a potential reproductive edge over bacteria that cooperate.

The Prisoner’s Dilemma may be abstract, but that’s why Dr. Nowak likes it. It helps him understand fundamental rules of evolution, just as Isaac Newton discovered that objects in motion tend to stay in motion.

“If you were obsessed with friction, you would have never discovered this law,” Dr. Nowak said. “In the same sense, I try to get rid of what is inessential to find the essential. Truth is simple.”

Dr. Nowak found his first clues to the origin of cooperation in graduate school, collaborating with his Ph.D. adviser, Karl Sigmund. They built a version of the Prisoner’s Dilemma that captured more of the essence of how organisms behave and evolve.

In their game, an entire population of players enters a round-robin competition. The players are paired up randomly, and each one chooses whether to cooperate or defect. To make a choice, they can recall their past experiences with other individual players. Some players might use a strategy in which they had a 90-percent chance of cooperating with a player with whom they have cooperated in the past.

The players get rewarded based on their choices. The most successful players get to reproduce. Each new player had a small chance of randomly mutating its strategy. If that strategy turned out to be more successful, it could dominate the population, wiping out its ancestors.

Dr. Nowak and Dr. Sigmund observed this tournament through millions of rounds. Often the winners used a strategy that Dr. Nowak called, “win-stay, lose-shift.” If they did well in the previous round, they did the same thing again. If they did not do so well, they shifted. Under some conditions, this strategy caused cooperation to become common among the players, despite the short-term payoff of defecting.

In order to study this new version of the Prisoner’s Dilemma, Dr. Nowak had to develop new mathematical tools. It turned out that these tools also proved useful for studying cancer. Cancer and the Prisoner’s Dilemma may seem like apples and oranges, but Dr. Nowak sees an intimate connection between the two. “Cancer is a breakdown of cooperation,” he said.

Mutations sometimes arise in cells that cause them to replicate quickly, ignoring signals to stop. Some of their descendants acquire new mutations, allowing them to become even more successful as cancer cells. They evolve, in other words, into more successful defectors. “Cancer is an evolution you don’t want,” Dr. Nowak said.

To study cancer, however, Dr. Nowak had to give his models some structure. In the Prisoner’s Dilemma, the players usually just bump into each other randomly. In the human body, on the other hand, cells only interact with cells in their neighborhood.

A striking example of these neighborhoods can be found in the intestines, where the lining is organized into millions of tiny pockets. A single stem cell at the bottom of a pocket divides, and its daughter cells are pushed up the pocket walls. The cells that reach the top get stripped away.

Dr. Nowak adapted a branch of mathematics known as graph theory, which makes it possible to study networks, to analyze how cancer arises in these local neighborhoods. “Our tissue is actually organized to delay the onset of cancer,” he said.

Pockets of intestinal cells, for example, can only hold a few cell generations. That lowers the chances that any one will turn cancerous. All the cells in each pocket are descended from a single stem cell, so that there’s no competition between lineages to take over the pocket.

As Dr. Nowak developed this neighborhood model, he realized it would help him study human cooperation. “The reality is that I’m much more likely to interact with my friends, and they’re much more likely to interact with their friends,” Dr. Nowak said. “So it’s more like a network.”

Dr. Nowak and his colleagues found that when they put players into a network, the Prisoner’s Dilemma played out differently. Tight clusters of cooperators emerge, and defectors elsewhere in the network are not able to undermine their altruism. “Even if outside our network there are cheaters, we still help each other a lot,” Dr. Nowak said. That is not to say that cooperation always emerges. Dr. Nowak identified the conditions when it can arise with a simple equation: B/C>K. That is, cooperation will emerge if the benefit-to-cost (B/C) ratio of cooperation is greater than the average number of neighbors (K).

“It’s the simplest possible thing you could have expected, and it’s completely amazing,” he said.

Another boost for cooperation comes from reputations. When we decide whether to cooperate, we don’t just rely on our past experiences with that particular person. People can gain reputations that precede them. Dr. Nowak and his colleagues pioneered a version of the Prisoner’s Dilemma in which players acquire reputations. They found that if reputations spread quickly enough, they could increase the chances of cooperation taking hold. Players were less likely to be fooled by defectors and more likely to benefit from cooperation.

In experiments conducted by other scientists with people and animals, Dr. Nowak’s mathematical models seem to fit. Reputation has a powerful effect on how people play games. People who gain a reputation for not cooperating tend to be shunned or punished by other players. Cooperative players get rewarded.

“You help because you know it gives you a reputation of a helpful person, who will be helped,” Dr. Nowak said. “You also look at others and help them according to whether they have helped.”

The subject of human cooperation is important not just to mathematical biologists like Dr. Nowak, but to many people involved in the current debate over religion and science. Some claim that it is unlikely that evolution could have produced humans’ sense of morality, the altruism of heroes and saints. “Selfless altruism presents a major challenge for the evolutionist,” Dr. Francis S. Collins, the director of the National Human Genome Research Institute, wrote in his 2006 book, “The Language of God.”

Dr. Nowak believes evolutionary biologists should study average behavior rather than a few extreme cases of altruism. “Saintly behavior is unfortunately not the norm,” Dr. Nowak said. “The current theory can certainly explain a population where some people act extremely altruistically.” That does not make Dr. Nowak an atheist, however. “Evolution describes the fundamental laws of nature according to which God chose to unfold life,” he declared in March in a lecture titled “Evolution and Christianity” at the Harvard Divinity School. Dr. Nowak is collaborating with theologians there on a project called “The Evolution and Theology of Cooperation,” to help theologians address evolutionary biology in their own work.

Dr. Nowak sometimes finds his scientific colleagues astonished when he defends religion. But he believes the astonishment comes from a misunderstanding of the roles of science and religion. “Like mathematics, many theological statements do not need scientific confirmation. Once you have the proof of Fermat’s Last Theorem, it’s not like we have to wait for the scientists to tell us if it’s right. This is it.”