INTERACTIVE COMPANION · TOURNAMENT BENCH · GAME THEORY
The Tournament Bench
Two benches sit below. The first runs a round robin over whichever strategies you check, at whatever noise you set, and fills in the payoff matrix and the leaderboard live. The second takes that same matrix and lets the strategies breed, so you can watch tit for tat hold its own in a clean room and lose it as soon as the moves start landing wrong.
Everything runs in your browser, in plain JavaScript, with a seeded random number generator so the same settings always give the same answer. The strategies are the same fifteen the article used and the code is a direct translation of the Python.
Model 1. The round robin
Payoffs are Axelrod's: T = 5 for defecting against a cooperator, R = 3 for mutual cooperation, P = 1 for mutual defection, S = 0 for cooperating into a defector. A match is the number of rounds you set. Every checked strategy plays every other one and also plays a copy of itself, which is how Axelrod scored his entrants against their twins. A strategy's score is its mean payoff per round averaged over all the opponents in the room, including its twin.
Noise is an execution error. Each player's intended move is flipped with the probability you set, and the flipped move is what both players see. Neither player is told that an error happened.
TFT against TFT = 3.000. Both cooperate on round one and copy a cooperation forever after, so every round pays R = 3.
TFT against ALLD = 0.995. Tit for tat cooperates into a defector once for S = 0, then mirrors defection for 199 rounds at P = 1, so (0 + 199) / 200 = 0.995.
ALT against TFT = 2.515. Round one is mutual cooperation, R = 3. After that the alternator takes T = 5 on its hundred defecting rounds and S = 0 on its ninety-nine remaining cooperating rounds, so (3 + 500 + 0) / 200 = 2.515.
All three are exact, because neither strategy in any of those pairs carries a coin. They are printed in the raw output of the article's analysis script with the same values.
Why the leaderboard is a statement about the room
Press Nice only with the noise at zero. Every score in the leaderboard reads exactly 3.000. There is no winner: all eight of those strategies cooperate with all the others on every round, so the tournament ends in an eight-way tie at the maximum and the sort order breaks it arbitrarily. A room with nobody willing to punish anything cannot tell its members apart. Now nudge the noise up one step and watch the tie come apart.
Press No exploiters and grim trigger climbs. Press Drop Joss with noise at zero and the gap between generous tit for tat and tit for tat almost vanishes, because that gap was one opponent. Joss cooperates like tit for tat and then defects at random one time in ten. Tit for tat echoes the defection, Joss echoes the echo, and the two of them fall into a feud neither one is trying to have. Generous tit for tat lets a defection go one time in three, which is enough to break the loop.
A round robin score is an average over whoever else is in the room. Change the room, change the answer. This is the single largest weakness of the tournament as a way of learning anything, and it is why the second bench matters.
Model 2. Letting them breed
Replicator dynamics take the payoff matrix and make the strategies compete for population rather than for points. Every strategy starts at some frequency, each one earns the average payoff its opponents give it, and the ones earning more than the population average grow while the rest shrink:
xi(t+1) = xi(t) · fi(t) / φ(t), fi = ∑j Mij xj, φ = ∑i xi fi
The chart below is a stacked area: the height of each band is that strategy's share of the population, and the whole stack sums to one at every generation. Nothing here mutates and nothing here is spatial. The only thing happening is that earning more means having more descendants.
Watch the last readout. Frequencies are never renormalised after the update, so the total staying at 1.000000 is the arithmetic checking itself rather than a constraint being imposed. In the article's run the largest departure from one over four thousand generations at ten noise levels was 5.6 parts in ten million billion, which is two and a half units in the last binary place of a double.
What this bench cannot tell you
It cannot tell you anything about cooperation in living things. It is a game with two moves, four payoffs, fixed partners and no way to walk away, and every strategy in it was written by a person who already knew the rules. The result is about the model.
The noise here is misimplementation: the error happens to the move and both players see it. Under misperception, where the move is played correctly and only the opponent's copy of it is corrupted, contrite tit for tat would lose its whole mechanism, because it works by knowing its own defection was an accident. That version is not implemented here and we did not run it in the article either.
And the population is infinite, well mixed, and free of mutation. A finite population would drift, a structured one would let clusters of cooperators survive where a well mixed one cannot, and a mutating one would keep reintroducing the strategies this model lets go extinct for good.