HOW people collaborate, in the face of numerous temptations to cheat, is an important field of psychological and economic research. A lot of this research focuses on the “tit-for-tat” theory of co-operation: that humans are disposed, when dealing with another person, to behave in a generous manner until that other person shows himself not to be generous. At this point co-operation is withdrawn. Fool me once, in other words, shame on you. Fool me twice, shame on me.

When he encounters such a withdrawal of collaboration, the theory goes, the malefactor will learn the error of his ways and become a more co-operative individual. And there is experimental evidence, based on specially designed games, that tit-for-tat does work for pairs of people. Human societies, though, are more complex than mere dyads. And until recently, it has been difficult to model that complexity in the laboratory. But a paper published this week in the Proceedings of the National Academy of Sciences by Nicholas Christakis and his colleagues at Harvard has changed that. Dr Christakis arranged for a collaboration-testing game to be played over the web, with many participants. As a result, he and his team have gained a more sophisticated insight into the way co-operation develops.

Dr Christakis used what is known as a public-goods game for his experiment. At the beginning of such a game, points are doled out to each participant. During every round, players are given the opportunity to donate points to their neighbours. Points so donated are augmented by an equal number from the masters of the game. If everyone co-operates, then, everyone ends up richer. A “defector” who refuses to donate to his co-operating neighbours will, however, benefit at the expense of those neighbours. At the game's end, the points are converted into real money, to ensure that proper incentives are in place.

To play his large-scale public-goods game, Dr Christakis recruited 785 volunteers via Mechanical Turk—a service provided by Amazon, an online retailer, that works by farming out small tasks to an army of individual workers. Each volunteer was randomly assigned links to, on average, eight other players. Together, they played repeated rounds of one of three variations of the game.

In the first, participants always interacted with the same group of people. In the second, the connections were randomly reshuffled after each round. In the final version, one-third of the possible pairings between participants were chosen at random after each round (such pairs may or may not, therefore, have been dealing with each other in the previous round). One player from each pair was first told or reminded of how the other had behaved in the previous round, and was then asked whether he wanted to break his connection with that player, if he already had one, or form a new connection, if he had not.

In all versions of the game, roughly 60% of players started out co-operating. However, in the first two, this decreased over time as the pernicious influence of the freeloaders spread. The larger the fraction of a subject's partners who defected in a given round, the less likely that person was to co-operate in the next—classical tit-for-tat. However, this tit-for-tat retaliation was not enough to save co-operation, and after a dozen rounds only 10-20% of the players were still willing to co-operate.

In the variant where participants had some choice over whom they interacted with, though, the amount of co-operation stayed stable as the rounds progressed. When Dr Christakis and his team looked at how the relationships between players were evolving in this third version, they found that connections between two co-operators were much more likely to be maintained than links that involved a defector. Over time, the co-operators accumulated more social connections than the defectors did.

Furthermore, as they were shunned, the defectors began to change their behaviour. A defector's likelihood of switching to co-operation increased with the number of players who had broken links with him in the previous round. Unlike straightforward tit-for-tat, social retaliation was having a marked effect.

The next question, then, is whether such a mechanism holds outside the laboratory. To find out, Dr Christakis has forged links with some anthropologists. They hope to report the answer soon.