A Small Dilemma Tournament
Build a strategy for the repeated prisoner's dilemma and see how it scores in a small seeded tournament that checks its own arithmetic.
Made by Claude, an AI model. Nothing is fetched. Every score, count and sentence of results on this page is computed in your browser by core.js and the page's own script, and the page re-checks its totals every time you change something.
What this is, and is not. This page runs its own tournament, with the strategies listed below and any you add. It does not reproduce Robert Axelrod's 1980 tournament or its table, and I did not check that table against a second source. Which strategy comes out on top here depends on who is in the field, and you can change the field.
1. The game
Two players each choose, at the same moment, to cooperate (C) or defect (D). Whatever the other does, defecting pays you more that round, yet two cooperators each do better than two defectors. A match is rounds of that choice, and each player sees every earlier move of the other. Points for one round, to the player named on the left:
2. Pick the field and the rules
Every strategy meets every other once. A strategy can also meet a twin of itself (its score there is the average of the twin's two sides).
3. Build your own
Your strategy looks only at the last round. Choose its first move and the chance that it cooperates after each of the four ways a round can end. Optionally give it a grudge. With the right numbers it becomes Tit for Tat, Pavlov and others (the buttons fill them in).
4. Results
| Rank | Strategy | Points | Per round | Outscored | Tied | Outscored by |
|---|
Every match
Each cell is the row strategy's score against the column strategy over rounds. Bold means the row strategy outscored that column; grey means it was outscored; the italic diagonal is a strategy against its twin.
5. Watch one match
6. Other seeds
The same field and settings, run again under other seeds. A single tournament is one draw; this shows how much the answer moves when only the dice change.
| Strategy | Finished first | Mean points |
|---|
7. Does the page agree with itself?
These checks run in your browser. The first use fixed settings of their own; the rest use your current field, rounds, noise and seed and run again whenever you change them.
8. What this leaves out
- It is not Axelrod's tournament. His entrants were programs submitted by researchers; here the field is a handful of well-known strategies that I chose and wrote, plus yours. I recall that his tournaments are widely cited and that Tit for Tat did well in them, but that is from memory and I did not check it, or his table, against any source.
- The four payoffs () are the numbers usually used for this game, as far as I remember; I did not check that against a source. The dilemma conditions are checked by the page.
- Names and rules of Pavlov and Tit for Two Tats are my reading of the common definitions. Other sources describe them a little differently.
- The winner depends on the field and the noise. Nothing here says which strategy is best in general, or what people or animals do.
- No strategy uses the end of the match. For a game of known length, textbook theory says defecting every round is the only stable outcome of a single such match; the page does not test that.
- The dice are a seeded pseudo-random generator, and other seeds are a sample, not a proof. There is no evolution of a population here, only one round robin.
- The second scorer in the checks uses the same four payoffs as the first, so it catches counting slips, not a wrong payoff table. Not seen on a real phone.
Files: core.js (the model), test.mjs (the Node checks), README.md.