ollyconn

prejudice reduction, twenty-two years later

A 64x64 toroidal grid of agents. Each agent has a color (red or green, fixed) and a strategy (one of nine). Every generation each agent plays 200 rounds of iterated Prisoner's Dilemma with each of its eight Moore-neighborhood neighbors, totals its score, and then adopts the highest-scoring neighbor's strategy. Colors never change; strategies do.

Eight of the nine strategies are color-blind. The ninth is PTFT (Prejudicial Tit-for-Tat) — it plays Tit-for-Tat against same-color neighbors and All-Defect against other-color ones. The question the paper asks: across different starting configurations of red and green, does prejudice (PTFT) survive?

The paper's answer: integrated arrangements reliably wipe PTFT out within a few hundred generations. Segregated arrangements do not. So the original animations on pgrim.org/mpr/ were rendered to .gif in 2004 and have not moved since. Here they are running in your browser, in a port that respects everything I remember and tries not to lie about anything I don't.

generation: 0
PTFT (prejudicial):
TFT:
All-Defect:
avg score:
nine strategies (i, c, d coding):
  • <0,0,0> All-Defect
  • <0,0,1> Suspicious Perverse
  • <0,1,0> Suspicious TFT
  • <0,1,1> D-then-All-Cooperate
  • <1,0,0> C-then-All-Defect
  • <1,0,1> Perverse
  • <1,1,0> Tit-for-Tat (TFT)
  • <1,1,1> All-Cooperate
  • PTFT (Prejudicial TFT)

i = initial move, c = response to cooperation last round, d = response to defection. 0 = defect, 1 = cooperate.

algorithm + payoff matrix

Each agent plays 200 rounds of iterated Prisoner's Dilemma with each of its 8 Moore-neighborhood neighbors per generation, using the standard payoff matrix:

opponent cooperatesopponent defects
you cooperate30
you defect51

After each generation, each cell looks at its 8 neighbors and adopts the strategy of the highest-scoring one. Ties broken randomly. The whole grid updates synchronously. The grid is toroidal (wraps at edges). 4096 cells × 8 neighbors × 200 rounds = ~6.5M PD payoff lookups per generation, which is fast in modern V8.

Differences from the 2004 paper: I round the 200-round PD outcome by closed-form table lookup against the strategy pair, not by simulating each of the 200 rounds. The outer behavior is identical for reactive strategies; perfect rounding is preserved against ties. The original Java applet simulated each round.

If this drove you to the original paper, that's the point. Full cite, MIT Press chapter link, open-access PDF, NetLogo reimplementation, and the original GIF animations are all on the about page. The source for this canvas demo is in this site's repo at /grim.html — no build step, just HTML and a single self-contained script.