Public goods game · agent-based simulator

The CommonsDrain

Put people in a group, hand each of them the same money, and let them choose how much to put into a shared pot that pays everyone back. Nearly half goes in on the first round. By the tenth it is down to a seventh. Every agent below follows one fixed rule, and unless you tell them when the game ends, not one of them can see a round number. The collapse is not scheduled. Run it and watch it happen.

The rules

One round, start to finish

Everyone gets the same endowment. You decide privately how much of it to put in the pot. The pot is multiplied and then split evenly across the whole group. The split ignores what you put in.

payoffi  =  E − ci  +  m · Σcj
E your endowment ci what you put in Σcj the whole pot m your return per unit in the pot
Where the dilemma lives

Everything turns on one number: m, what a single unit in the pot pays back to you personally. Keep a unit and you have 1. Contribute it and you get m back while everyone else also gets m. So the group gains m × n and you personally lose 1 − m. Both of those are true at once, and that is the entire problem.

1/n
1.00
0.40
m < 1

Every unit you contribute costs you more than it returns to you. Giving nothing is your best move no matter what anyone else does.

m > 1/n

Every unit multiplied across n people returns more than it cost. Everyone giving everything is the best outcome available to the group.

Both hold at once whenever m sits between them, and that window gets wider as the group grows. Below 1/n there is no public good worth funding. Above 1.00 contributing pays for itself and nobody has to be talked into it.

The players

Four ways to answer the same question

When you ask people how much they would give for every possible group average, they do not give one answer. They sort into stable types, and the types keep their shape across sessions and countries (Fischbacher et al., 2001). Each curve below is a rule for reading the room. The dashed line is exact matching: give back what you see.

10.0
Conditional cooperator
—would give

Gives roughly what the group gives, and reliably a little less. That small shortfall is the engine of everything that follows.

Free rider
—would give

Gives nothing, whatever anyone else does. In real sessions they still put something in early, then stop.

Hump-shaped
—would give

Matches while contributions are modest, then pulls back once the group is giving a lot. Generous up to a point, unwilling to be the most generous.

Unconditional
—would give

Gives everything regardless. Too few to hold an average up on their own, but enough to keep it off the floor.

Nothing in the simulator changes a type. Nobody learns, nobody gets more selfish, nobody defects. The whole population is exactly as generous in round twenty as it was in round one.

Start from
Round
0
not started
Mean contribution
—
of endowment
Pool this round
—
before multiplier
Zero contributors
—
gave nothing
The pool
Conditional Free rider Hump-shaped Unconditional Outer arc = total earned
Decay trace drag or arrow keys to replay any round
Every player, separately hover a line
The average hides this. Free riders sit on the floor, unconditional cooperators stay at the ceiling, and the conditional ones in between drag each other down. Hover a line to pick that player out.
Against the lab data
Who ends up ahead
Turn punishment on. Nobody is coded to exploit the punishers, but somebody will.
The whole parameter space

Where cooperation survives

One run tells you about one group. This sweeps every combination of matching bias and free rider share, runs several groups at each, and colours the square by how much is still being contributed at the end. Amber is a group that held together. Dark is a group that emptied out.

Contribution at round 15
Uses the return per contributor and group size set in the panel above. Takes a moment.
Things worth trying

Seven runs that each prove something

Set matching bias to 1.00
Cooperators now return exactly what they see. It barely helps: round fifteen moves from 14% to 17%. Free riders alone are enough to bleed a group dry.
Set free riders to 0%, bias to 0.70
A group containing not one free rider still gives away half its cooperation, 50% down to 21% by round fifteen. Nobody has to defect for cooperation to fail.
Run fifteen rounds, then press Restart
Contributions leap back up. Same people, same rules, same group. Only the announcement changed (Andreoni, 1988).
Turn on punishment before round one
Contributions hold near 40% instead of sinking to 14%. Enforcement does not persuade anyone. It changes what free riding costs.
With punishment on, read the payoff panel
The people who contribute but refuse to pay for enforcement finish ahead of the people who enforce. Nothing in the code puts them there.
Turn on Announce a fixed ending
Rounds one through seven are untouched. Then contributions fall away over the last three, ending near a quarter of where they would have been. Knowing when it stops is enough on its own.
Push return per contributor past 1.00
Everyone gives everything instantly, free riders included. The dilemma was never about who was in the room.
The argument

Why anyone cares

This game is small enough to fit in a lab and old enough to have been stated in plain English before anyone could formalise it. What it measures is whether a group of people can fund something that benefits all of them when nobody can be made to pay.

Hume got there first

Hume (1739/1978) put the whole problem in one image. Two neighbours can agree to drain a meadow they share, because each can see the other and the bargain is easy to keep. A thousand people cannot, because each of them looks for a pretext to spare himself the trouble and lay the whole burden on the others. Nothing about that observation required a payoff matrix. It required only noticing that the reasoning which is sound for one person is ruinous when everyone performs it.

Samuelson (1954) later gave the object its formal definition. A public good is non-rival and non-excludable: your use of it does not diminish anyone else's, and once it exists nobody can be kept away from it. Olson (1965) drew the consequence that made it a political problem rather than an economic curiosity. Rational, self-interested individuals will not act to achieve their common interest merely because that interest is common, and the larger the group, the worse the failure.

The pessimistic reading, and the correction

Hardin (1968) turned this into a doctrine. Shared resources are destroyed by the individually rational use of them, and the only exits are private ownership or coercion imposed from outside. The essay was enormously influential and, as a general empirical claim, wrong.

Ostrom (1990) spent decades documenting communities that govern shared fisheries, forests, irrigation systems and pastures for centuries without either privatisation or an external sovereign. She extracted the conditions that make it work: clear boundaries, rules matched to local circumstance, the people affected participating in setting those rules, monitoring by the users themselves, graduated sanctions, and cheap conflict resolution. The commons is not doomed. It is difficult, and the difficulty is institutional. She received the Nobel in 2009 for it.

The finding that should bother you

Here is what the simulator above is really for. The obvious explanation for collapsing cooperation is that people are selfish, or that they start out hopeful and learn better. Fischbacher and Gächter (2010) tested both and found neither is the driver. What causes the collapse is that most people are conditional cooperators who want to contribute somewhat less than the people around them.

Universal free riding emerges even though most people are not free riders.

Everyone is behaving decently by their own lights. Each individual shortfall is small enough to be invisible, certainly small enough to be defensible. Iterate it across a group and the group ends at zero. There is no villain in the run, no moment of betrayal, no point at which anyone did anything they would be ashamed to explain. The shortfall alone is not quite enough to do it, either. Raise the matching bias to exact matching and the collapse only softens, from 14% to 17%. Take every free rider out of the room and leave the shortfall in place and the group still surrenders half of what it started with. It takes both, and almost every real group has both. The phase diagram above shows the whole space at once, and the belt where cooperation survives is narrow.

Why the restart works

The rebound needs its own explanation, because it looks like it should contradict the finding above. If the decline is caused by a preference rather than by souring expectations, why does simply announcing a fresh sequence bring contributions most of the way back?

Because the two are answers to different questions. The preference governs how much of what you see you hand back, and it never changes. Expectations govern what you think you are about to see, and a restart wipes those. A conditional cooperator that has spent ten rounds matching a shrinking average falls back on its prior when the sequence is declared new, and the prior was never revised downward. The decay is preference-driven, the rebound is expectation-driven, and this model implements exactly that split.

It is a modelling choice rather than a settled fact. The competing account of the restart is strategic: in a game everyone knows is finite, cooperating early can be worth it, and a restart restores the horizon that made it worth it. You can put some weight on that reading by turning on the announced ending in the panel above, watching contributions fall away over the last three rounds, and noticing that agents who can see the clock behave very differently from agents who cannot.

Punishment, and the hole underneath it

People do not simply accept this. Given the chance to pay their own money to reduce a free rider's earnings, with no prospect of recovering the cost and no future interaction to protect, they take it (Fehr & Gächter, 2000, 2002). Contributions rise and stay up. This is genuinely hard to square with a model of people as self-interested, and it is one of the sturdier results in experimental economics.

But enforcement is expensive, and its benefits spill onto everyone. So a sanctioning system is itself a public good, and refusing to pay for it is a second-order free ride (Yamagishi, 1986). You can watch this appear in the simulator: turn punishment on and the contributors who never punish quietly out-earn the ones who do. The obvious fix, punishing the people who won't punish, is a third-order public good with the same structure. The regress does not terminate on its own. Reputation, indirect reciprocity, and selection between groups are the standard candidates for stopping it.

There is a further problem, and it is worse. Herrmann et al. (2008) ran punishment experiments across sixteen participant pools worldwide and found that in many of them, high contributors were punished too, sometimes as heavily as free riders. In several pools this antisocial punishment was strong enough to erase the cooperative benefit entirely. Punishment reliably helps only where norms of civic cooperation and the rule of law are already strong. As a foundation for cooperation it is closer to a symptom of a healthy society than a cause of one.

What this model is not

The agents here have fixed types and no memory of individuals. They cannot build reputations, form coalitions, talk to each other, leave a group, or choose the rules they play under. Communication alone lifts contributions dramatically in real experiments, and Ostrom's design principles are mostly about the institutional layer this model has no representation of. How willing a cooperator is to match what it sees is derived rather than assumed: a unit you contribute is worth m to each other person and costs you 1 − m, and the matching bias control sets how much weight an agent puts on the first against the second. That is why the return slider moves behaviour while group size barely does, which is the right way round (Isaac & Walker, 1988). Read the whole thing as a demonstration of one mechanism, cleanly isolated: what heterogeneous preferences plus imperfect matching do to a group over time, with everything else stripped out.

References

Sources

  1. Andreoni, J. (1988). Why free ride? Strategies and learning in public goods experiments. Journal of Public Economics, 37(3), 291–304.
  2. Andreoni, J. (1995). Cooperation in public-goods experiments: Kindness or confusion? American Economic Review, 85(4), 891–904.
  3. Fehr, E., & Gächter, S. (2000). Cooperation and punishment in public goods experiments. American Economic Review, 90(4), 980–994.
  4. Fehr, E., & Gächter, S. (2002). Altruistic punishment in humans. Nature, 415(6868), 137–140.
  5. Fischbacher, U., & Gächter, S. (2010). Social preferences, beliefs, and the dynamics of free riding in public goods experiments. American Economic Review, 100(1), 541–556.
  6. Fischbacher, U., Gächter, S., & Fehr, E. (2001). Are people conditionally cooperative? Evidence from a public goods experiment. Economics Letters, 71(3), 397–404.
  7. Hardin, G. (1968). The tragedy of the commons. Science, 162(3859), 1243–1248.
  8. Hauert, C., Traulsen, A., Brandt, H., Nowak, M. A., & Sigmund, K. (2007). Via freedom to coercion: The emergence of costly punishment. Science, 316(5833), 1905–1907.
  9. Herrmann, B., Thöni, C., & Gächter, S. (2008). Antisocial punishment across societies. Science, 319(5868), 1362–1367.
  10. Hume, D. (1978). A treatise of human nature (L. A. Selby-Bigge & P. H. Nidditch, Eds.; 2nd ed.). Oxford University Press. (Original work published 1739–1740)
  11. Isaac, R. M., & Walker, J. M. (1988). Group size effects in public goods provision: The voluntary contributions mechanism. The Quarterly Journal of Economics, 103(1), 179–199.
  12. Ledyard, J. O. (1995). Public goods: A survey of experimental research. In J. H. Kagel & A. E. Roth (Eds.), The handbook of experimental economics (pp. 111–194). Princeton University Press.
  13. Olson, M. (1965). The logic of collective action: Public goods and the theory of groups. Harvard University Press.
  14. Ostrom, E. (1990). Governing the commons: The evolution of institutions for collective action. Cambridge University Press.
  15. Samuelson, P. A. (1954). The pure theory of public expenditure. The Review of Economics and Statistics, 36(4), 387–389.
  16. Yamagishi, T. (1986). The provision of a sanctioning system as a public good. Journal of Personality and Social Psychology, 51(1), 110–116.