Skip to content
AI360Xpert
Beta

Zero-Sum Games

In pure conflict one side's gain is the other's loss, so optimal play means randomizing to stay unpredictable and guaranteeing a floor.

Row guarantees a floor by mixing while column caps a ceiling, and optimal play squeezes both to the same game value
Row guarantees a floor by mixing while column caps a ceiling, and optimal play squeezes both to the same game value

Why Does This Exist?

Chess, poker duels, and adversarial training share a shape: interests diametrically opposed, one player's gain the other's exact loss. Guessing the opponent is then fatal, because anything predictable gets exploited. Zero-sum theory replaces guessing with guarantees: each side can secure a floor regardless of the opponent, and optimal play makes both floors meet at the game's value.

This is the setting of GAN training dynamics and robust optimization, and the companion minimax theorem proves the floors always meet. The general nonzero-sum case (cooperation possible) is the parent overview; equilibrium computation by learning is under game-theoretic optimization.

The one idea you need first

A zero-sum game is one matrix AA: row gains AijA_{ij}, column loses the same. Row picks a row distribution xx, column a column distribution yy, and the expected payment is xTAyx^T A y. Row maximizes it, column minimizes it.

Think of It Like This

A penalty shootout

The kicker picks left or right; the keeper dives left or right. Score or save: pure conflict, no shared interest. A kicker who always shoots left gets read within minutes; a keeper who always dives right gets chipped down the middle.

Both randomize. The kicker's mix makes the keeper indifferent (no dive systematically better), and the keeper's mix makes the kicker indifferent. Neither wins every kick, but each guarantees their long-run conversion rate whatever the other does. The "value" of the shootout is that rate, fixed once both mix well.

How It Actually Works

Row's security level: max⁡xmin⁡j(xTA)j\max_x \min_j (x^T A)_j, the best floor over row mixes against column's best reply. Column's cap: min⁡ymax⁡i(Ay)i\min_y \max_i (A y)_i. Optimal x∗x^* and y∗y^* make these equal at value vv: row guarantees at least vv, column holds row to at most vv.

Worked example

Matching pennies, row wins on match:

A=(1−1−11)A = \begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix}

Row mixing (1/2,1/2)(1/2, 1/2): against column Heads, payment 1/2−1/2=01/2 - 1/2 = 0; against Tails, −1/2+1/2=0-1/2 + 1/2 = 0. Floor 00. Column mixing (1/2,1/2)(1/2, 1/2) caps row at 00 the same way. Value v=0v = 0: a fair game. Pure strategies guarantee −1-1 (the opponent exploits the revealed side), so mixing gains a full point over any deterministic choice.

A second check with an asymmetric row: x=(3/4,1/4)x = (3/4, 1/4) against column's best reply gives min⁡(3/4−1/4,−3/4+1/4)=min⁡(1/2,−1/2)=−1/2\min(3/4 - 1/4, -3/4 + 1/4) = \min(1/2, -1/2) = -1/2: worse than 00. Deviating from the mix costs half a point.

Code

def expected(ax: list[float], ay: list[float], pay: list[list[float]]) -> float:    total = 0.0    for i, pi in enumerate(ax):        for j, qj in enumerate(ay):            total += pi * qj * pay[i][j]  # payment row receives    return round(total, 3)

pennies = [[1, -1], [-1, 1]]print(expected([0.5, 0.5], [0.5, 0.5], pennies))  # -> 0.0print(expected([1.0, 0.0], [0.5, 0.5], pennies))  # -> 0.0print(expected([0.75, 0.25], [0.0, 1.0], pennies))  # -> -0.5

Optimal mixing holds the value; the skewed mix against a best reply loses half a point.

Watch Out For

Playing the equilibrium against a weak opponent

The max-min mix guarantees the value against anyone, but against a predictable opponent it leaves money on the table: exploiting needs a best response to their mix, not the equilibrium mix. In poker and security games, play equilibrium as the default but shift to exploitation once the opponent's bias is measured.

Assuming zero-sum where interests partly align

GAN generators and discriminators look zero-sum but practitioners add feature-matching and gradient penalties that break strict opposition. Results proved for exact zero-sum (value, convergence of specific dynamics) can fail for these variants. Verify the payoff sums to zero before quoting the theorems.

The Quick Version

  • Zero-sum means one's gain is the other's loss, captured in a single matrix.
  • Optimal play randomizes to stay unpredictable and guarantees a floor.
  • Matching pennies has value 00 at (1/2,1/2)(1/2, 1/2) each; any pure choice guarantees −1-1.
  • Row's best floor and column's best cap meet at the value under optimal mixes.
  • Deviating to (3/4,1/4)(3/4, 1/4) against a best reply costs half a point.
  • Exploit weak opponents with best responses, not equilibrium mixes.