↑ ↓ to move · enter to open

024 · Game theory · Backward induction, subgame perfection

centipede game

Two players take turns beside a growing pot. The player whose turn it is can take the bigger share and end the game, or pass and let the pot double for the other player. Reasoning backward from the last move says take at once. Real people usually pass for a while, and a small doubt about the other player is enough to make that sensible.

LAB 1

play it

You are P1 and move first. At every node the pot is split 80/20: whoever takes gets 80% and the other player gets 20%. Passing doubles the pot and hands the move to the other side. If nobody takes, the final pot is split 80/20 in favor of the player who would have moved next. Pick an opponent and see how much you walk away with.

your move · node 1
Opponent
Nodes

How to read this: play runs left to right. At each circle the mover can Take (T, down, ends the game) or Pass (P, right). The two numbers under each T are what you (green, top) and the opponent (amber, below) get if the game stops there.

  • your move
  • opponent's move
  • gold: where the game ended
  • small square at the right end: everyone passed
—
Pot at this node
—
Taking now gets you
—
Your total
—
Opponent total

Nowround 1

The game treePython

The whole game is one list. take[k] is what both players get if the mover stops at node k, and the last entry is what happens if everyone passes. Its mover index n % 2 belongs to the player who would move next, which is exactly the flipped split.

The opponents

Rational plays the subgame-perfect strategy from Lab 2: take at every node. Trusting passes until its own final move, then takes, because no later move can reward a pass there. Random flips a fair coin at each node.

LAB 2

solve it from the end

Start at the last node, where the choice is easy because nothing comes after it. Record what the mover picks and what both players end up with. Then step one node back: that mover now knows what passing leads to. Repeat until you reach node 1. This is backward induction, the same idea as 004 · Dynamic programming filling a table from the base case.

solved
8
×2

How to read this: solving starts at the right. The box above each circle shows what both players end up with from there (you in green, opponent in amber).

  • gold edge: the move the mover picks
  • red dashed edge: the move they reject

Try this: press Step and follow the gold edges as they spread back to node 1.

—
Node just solved
—
Mover: take vs pass
—
Subgame-perfect outcome
—
If everyone passes

Now

Backward inductionPython

One pass from right to left, so the cost is O(n). Uses centipede() from Lab 1.

Why it unravels

take at k ⇔ 0.8·Pk > 0.2·g·Pk ⇔ g < 4

Taking gives the mover 80% of the pot Pk. If the next player takes, the mover gets 20% of a pot that is g times bigger. For every growth on this slider, 0.8 beats 0.2·g, so the last mover takes, so the one before takes, and so on back to node 1.

A subgame-perfect equilibrium is a strategy pair that is a Nash equilibrium in every subgame, which here means at every node. With no ties, backward induction finds exactly one: both players take everywhere, and the game ends at node 1 with $4 and $1.

LAB 3

why people pass

A simplified model. You are P1 and plan the node where you will take. Your opponent is an altruist who always passes with probability q, and otherwise a selfish player who takes at a fixed node. Each plan's expected payoff is a weighted average of how it does against the two types. Bars use a log scale. The pot doubles each pass.

expected payoff by plan
2.0%
6 #1

How to read this: each bar is a plan: "@3" means take at node 3. Taller means more money on average. The strip below shows which plan is best for every chance q that your opponent is an altruist; the ▲ marks the current q.

  • gold bar: best plan now
  • bright outline: beats taking at node 1
  • payoff of taking at node 1
  • strip red: take at once
  • strip green: pass first (brighter = take later)
  • strip gold: never take
—
Best plan for you
—
Its expected payoff
—
Taking at node 1 pays
—
Passing pays once q exceeds

Now

Expected value of a planPython

E[plan] = q·payoff vs altruist + (1 − q)·payoff vs selfish

A stop of None means never take. Uses centipede() from Lab 1. Node indices in the code start at 0, so your first move is k = 0.

What the experiments found

Robert Rosenthal introduced the game in 1981. In 1992 Richard McKelvey and Thomas Palfrey ran it in the lab with an 80/20 split and a doubling pot, the same rules used on this page. Most players passed at least once, and games that ended at the first node were rare.

Their explanation used the idea in this lab: if a few players might be altruists, a selfish player can do better by passing early. The pot grows so fast that a tiny chance of a big payoff outweighs a likely small loss. Their full model also lets selfish players imitate altruists, which this simplified version leaves out.