AI Wiki中文/EN

Game theory fundamentals: when your best choice depends on someone else's

博弈论基础

Write strategic situations as normal-form games, compute expected utility, dominance, Pareto optimality, best responses and maxmin values exactly, and see where each concept stops answering the question.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

One decision, two decision-makers

Two delivery robots approach a narrow corridor from opposite ends. Each can wait or go. If both go they block each other; if both wait nothing moves; if exactly one goes, both finish, but the one that went finishes sooner. A planner that controlled both robots would simply pick an outcome. Here each robot runs its own controller, and the best action for one depends on what the other does. Single-agent decision theory, which maximizes expected utility against a fixed environment, has no answer until we say something about the other agent.

Game theory supplies a vocabulary for that situation: who the players are, what each can do, and how each ranks every combination of actions. It does not supply a single notion of “the right move”. Instead it offers several solution concepts, each answering a different question: is one action better whatever the others do (dominance)? Could everyone be made weakly better off (Pareto optimality)? Is anyone tempted to deviate alone (Nash equilibrium)? What can I guarantee if the others are hostile (maxmin)? Shoham and Leyton-Brown frame the field exactly this way, noting that in a multiagent setting an “optimal strategy” for one agent is not even well defined because it depends on the choices of others. Normal-form games and solution concepts

This article covers the framework and the elementary concepts, computed exactly on small synthetic games. How Nash equilibria are found and how hard that is belongs to Nash equilibrium; designing the rules of a game so that self-interested play produces a desired outcome is mechanism design.

From payoff tables to solution concepts

A finite normal-form (strategic-form) game is a tuple (N,A,u)(N,A,u): a finite set NN of nn players; for each player ii a finite action set AiA_i, with action profiles a=(a1,…,an)∈A=A1×⋯×Ana=(a_1,\ldots,a_n)\in A=A_1\times\cdots\times A_n; and utility functions ui:A→Ru_i:A\to\mathbb R. With two players the game is a table: rows are player 1’s actions, columns are player 2’s, and each cell lists both payoffs. Definition 3.2.1

Utilities are measured on an interval scale, so a positive affine transformation ui↦αui+βu_i\mapsto\alpha u_i+\beta with α>0\alpha>0 describes the same preferences. That has a sharp consequence: any concept that compares one player’s payoff with another’s, such as “maximize the sum of utilities”, can change its answer when one player’s payoffs are rescaled. The concepts below avoid such interpersonal comparisons.

Mixed strategies and expected utility. A mixed strategy sis_i is a probability distribution over AiA_i; the set of actions it plays with positive probability is its support. Players randomize independently, so the probability of a profile is a product, and expected utility is

ui(s)=∑a∈Aui(a)∏j=1nsj(aj).u_i(s)=\sum_{a\in A}u_i(a)\prod_{j=1}^{n}s_j(a_j).

The source discusses several readings of a mixed strategy. The two most common are actual randomization by the player and the other players’ uncertainty about a player who acts deterministically; it also gives two readings based on repeated play and populations of players. Interpretations of mixed strategies

Dominance. Write s−is_{-i} for the strategies of everyone except ii. Strategy sis_i strictly dominates si′s_i' if ui(si,s−i)>ui(si′,s−i)u_i(s_i,s_{-i})>u_i(s_i',s_{-i}) for every s−is_{-i}; weak dominance replaces >> with ≥\ge and requires at least one strict inequality. A strictly dominated action is never a sensible choice, whatever beliefs a player holds, so it can be deleted, after which other actions may become dominated. Note that the dominating strategy may be mixed: an action can lose to a fifty-fifty blend of two other actions while beating each of them somewhere. Definition 3.4.8

Pareto optimality. Profile ss Pareto dominates s′s' if every player is at least as well off and someone is strictly better off; ss is Pareto optimal if nothing Pareto dominates it. This is an outside observer’s criterion and it is invariant to affine rescaling, because it never trades one player’s utility against another’s. It usually leaves many noncomparable outcomes. Definitions 3.3.1–3.3.2

Best response and Nash equilibrium. If player ii knew s−is_{-i}, the problem would be single-agent again. A best response is any si∗s_i^* with

ui(si∗,s−i)≥ui(si,s−i)for all si∈Si,u_i(s_i^*,s_{-i})\ge u_i(s_i,s_{-i})\quad\text{for all } s_i\in S_i,

and a profile is a Nash equilibrium when every player’s strategy is a best response to the others. If a mixed best response puts positive weight on two actions, the player must be indifferent between them; this indifference principle is what makes small mixed equilibria computable by hand. Nash’s theorem guarantees that every finite game has at least one equilibrium, possibly mixed. Definitions 3.3.3–3.3.4, Theorem 3.3.22

Maxmin and the zero-sum case. A cautious player can ask what it can guarantee if the others act to minimize its payoff:

v‾i=max⁡simin⁡s−iui(si,s−i).\underline v_i=\max_{s_i}\min_{s_{-i}}u_i(s_i,s_{-i}).

In a two-player zero-sum game (u1=−u2u_1=-u_2) the minimax theorem says that moving first or second does not matter:

max⁡xmin⁡yx⊤Ay=min⁡ymax⁡xx⊤Ay,\max_x\min_y x^{\top}Ay=\min_y\max_x x^{\top}Ay,

where AA is the row player’s payoff matrix and x,yx,y are mixed strategies. In such games every Nash equilibrium gives the row player this common value, and the equilibrium strategies are exactly the maxmin strategies. Roughgarden’s notes add the historical thread: von Neumann first proved the theorem in the 1920s with fixed-point arguments and later with arguments equivalent to linear-programming duality, and the notes then prove it from the existence of no-regret learning algorithms. Minimax theorem and its proofs Theorem 3.4.4 Outside zero-sum games the link breaks: maxmin values and equilibrium strategies can differ, as the implementation below shows.

Other representations. Sequential moves (extensive form), private information (Bayesian games) and repeated interaction have their own representations. Shoham and Leyton-Brown note that many of them can be reduced to a much larger normal-form game, which is why the table form is treated as the base case. Normal form as base representation Because such reductions can blow up the table (in an extensive-form game, for instance, a pure strategy must specify an action at every decision point), richer forms are usually analyzed directly; this last remark is our own, not the book’s.

Five small games, computed exactly

The program below uses only the Python standard library and exact fractions, so every printed probability and value is exact rather than a rounded float. All payoff tables are synthetic teaching examples, not data from real agents. It computes pure Nash equilibria by checking every cell for profitable unilateral deviations, Pareto-optimal pure profiles, iterated elimination of actions strictly dominated by another pure action, interior mixed equilibria of 2×2 games from the indifference conditions, and a 2×2 row player’s exact maxmin value by checking the endpoints and every crossing of two column lines.

The games are: a Prisoner’s-Dilemma-shaped game with payoffs 3/0/5/1; a coordination game in which both players want to match but the row player prefers X (3 vs 2) and the column player prefers Y; the same game with the row player’s payoffs multiplied by ten; Matching Pennies; a 3×3 game built so that one deletion triggers the next; and a 3×3 game in which a row is dominated only by a mixture.

"""Exact normal-form analysis of small synthetic two-player games (stdlib only)."""
from fractions import Fraction as F
from itertools import product


def game(rows, cols, cells):
    """cells[r][c] = (row payoff, column payoff); stored as exact fractions."""
    return {'rows': rows, 'cols': cols,
            'u': [[(F(a), F(b)) for a, b in line] for line in cells]}


def payoff(g, r, c, player):
    return g['u'][r][c][player]


def pure_nash(g):
    found = []
    for r, c in product(range(len(g['rows'])), range(len(g['cols']))):
        row_ok = all(payoff(g, r, c, 0) >= payoff(g, k, c, 0) for k in range(len(g['rows'])))
        col_ok = all(payoff(g, r, c, 1) >= payoff(g, r, k, 1) for k in range(len(g['cols'])))
        if row_ok and col_ok:
            found.append((g['rows'][r], g['cols'][c]))
    return found


def pareto_optimal(g):
    cells = [(r, c) for r in range(len(g['rows'])) for c in range(len(g['cols']))]
    def dominates(a, b):
        ua, ub = g['u'][a[0]][a[1]], g['u'][b[0]][b[1]]
        return all(x >= y for x, y in zip(ua, ub)) and any(x > y for x, y in zip(ua, ub))
    return [(g['rows'][r], g['cols'][c]) for r, c in cells
            if not any(dominates(o, (r, c)) for o in cells)]


def iterated_strict_dominance(g):
    """Remove actions strictly dominated by another PURE action, until none remain."""
    rows, cols, log = list(range(len(g['rows']))), list(range(len(g['cols']))), []
    changed = True
    while changed:
        changed = False
        for r in list(rows):
            if any(all(payoff(g, k, c, 0) > payoff(g, r, c, 0) for c in cols) for k in rows if k != r):
                rows.remove(r); log.append('row ' + g['rows'][r]); changed = True
        for c in list(cols):
            if any(all(payoff(g, r, k, 1) > payoff(g, r, c, 1) for r in rows) for k in cols if k != c):
                cols.remove(c); log.append('col ' + g['cols'][c]); changed = True
    return log, [g['rows'][r] for r in rows], [g['cols'][c] for c in cols]


def mixed_dominated(g, target, weights):
    """Does the row mixture `weights` strictly beat row `target` against every column?"""
    gaps = [sum(w * payoff(g, k, c, 0) for k, w in weights.items()) - payoff(g, target, c, 0)
            for c in range(len(g['cols']))]
    return all(x > 0 for x in gaps), gaps


def row_maxmin_2x2(g):
    """Exact maxmin for a row player with two actions: check endpoints and the crossing."""
    def worst(p):
        return min(p * payoff(g, 0, c, 0) + (1 - p) * payoff(g, 1, c, 0) for c in range(len(g['cols'])))
    candidates = {F(0), F(1)}
    cols = range(len(g['cols']))
    for c1 in cols:
        for c2 in cols:
            a = payoff(g, 0, c1, 0) - payoff(g, 1, c1, 0) - payoff(g, 0, c2, 0) + payoff(g, 1, c2, 0)
            if a != 0:
                p = (payoff(g, 1, c2, 0) - payoff(g, 1, c1, 0)) / a
                if 0 <= p <= 1:
                    candidates.add(p)
    best = max(candidates, key=lambda p: (worst(p), -p))
    return best, worst(best)


def mixed_2x2_interior(g):
    """Interior mixed equilibrium of a 2x2 game from indifference, if it exists."""
    (a, b), (c, d) = [[payoff(g, r, k, 0) for k in range(2)] for r in range(2)]
    (e, f), (h, i) = [[payoff(g, r, k, 1) for k in range(2)] for r in range(2)]
    if a - b - c + d == 0 or e - f - h + i == 0:
        return None
    q = (d - b) / (a - b - c + d)   # column prob. of first column, makes row indifferent
    p = (i - h) / (e - f - h + i)   # row prob. of first row, makes column indifferent
    if not (0 < p < 1 and 0 < q < 1):
        return None
    row_value = q * a + (1 - q) * b
    col_value = p * e + (1 - p) * h
    return p, q, row_value, col_value


def fmt(x):
    return str(x) if isinstance(x, F) else x


pd = game(['C', 'D'], ['C', 'D'], [[(3, 3), (0, 5)], [(5, 0), (1, 1)]])
bos = game(['X', 'Y'], ['X', 'Y'], [[(3, 2), (0, 0)], [(0, 0), (2, 3)]])
pennies = game(['H', 'T'], ['H', 'T'], [[(1, -1), (-1, 1)], [(-1, 1), (1, -1)]])
chain = game(['T', 'M', 'B'], ['L', 'C', 'R'],
             [[(4, 3), (5, 1), (6, 2)], [(2, 1), (8, 4), (3, 6)], [(3, 0), (9, 6), (2, 8)]])
hidden = game(['T', 'M', 'B'], ['L', 'R'], [[(3, 0), (0, 0)], [(1, 0), (1, 0)], [(0, 0), (3, 0)]])

print('Prisoner-dilemma-shaped game')
print('  dominance log:', iterated_strict_dominance(pd)[0])
print('  pure NE:', pure_nash(pd))
print('  Pareto-optimal pure profiles:', pareto_optimal(pd))
print('Coordination game with conflict (X/Y)')
print('  pure NE:', pure_nash(bos))
p, q, vr, vc = mixed_2x2_interior(bos)
print('  mixed NE: row plays X w.p.', p, '; column plays X w.p.', q, '; payoffs', vr, vc)
print('  row maxmin (prob. of X, value):', tuple(map(fmt, row_maxmin_2x2(bos))))
scaled = game(['X', 'Y'], ['X', 'Y'], [[(30, 2), (0, 0)], [(0, 0), (20, 3)]])
print('  row payoffs x10 -> pure NE:', pure_nash(scaled))
for name, g in (('original', bos), ('scaled', scaled)):
    sums = {(g['rows'][r], g['cols'][c]): sum(g['u'][r][c]) for r in range(2) for c in range(2)}
    top = max(sums.values())
    print('  utility-sum maximizers (' + name + '):', [k for k, v in sums.items() if v == top], 'sum', top)
print('Matching pennies')
print('  pure NE:', pure_nash(pennies))
print('  mixed NE:', tuple(map(fmt, mixed_2x2_interior(pennies))))
print('  row maxmin (prob. of H, value):', tuple(map(fmt, row_maxmin_2x2(pennies))))
print('3x3 chain of strict dominance')
log, rows_left, cols_left = iterated_strict_dominance(chain)
print('  removal order:', log, '-> survivors', rows_left, cols_left)
print('  pure NE:', pure_nash(chain))
print('Pure-only elimination misses mixed domination')
print('  pure-action elimination log:', iterated_strict_dominance(hidden)[0])
ok, gaps = mixed_dominated(hidden, 1, {0: F(1, 2), 2: F(1, 2)})
print('  M strictly dominated by 1/2 T + 1/2 B:', ok, 'gaps', [str(x) for x in gaps])

Recorded output:

Prisoner-dilemma-shaped game
  dominance log: ['row C', 'col C']
  pure NE: [('D', 'D')]
  Pareto-optimal pure profiles: [('C', 'C'), ('C', 'D'), ('D', 'C')]
Coordination game with conflict (X/Y)
  pure NE: [('X', 'X'), ('Y', 'Y')]
  mixed NE: row plays X w.p. 3/5 ; column plays X w.p. 2/5 ; payoffs 6/5 6/5
  row maxmin (prob. of X, value): ('2/5', '6/5')
  row payoffs x10 -> pure NE: [('X', 'X'), ('Y', 'Y')]
  utility-sum maximizers (original): [('X', 'X'), ('Y', 'Y')] sum 5
  utility-sum maximizers (scaled): [('X', 'X')] sum 32
Matching pennies
  pure NE: []
  mixed NE: ('1/2', '1/2', '0', '0')
  row maxmin (prob. of H, value): ('1/2', '0')
3x3 chain of strict dominance
  removal order: ['col C', 'row M', 'row B', 'col R'] -> survivors ['T'] ['L']
  pure NE: [('T', 'L')]
Pure-only elimination misses mixed domination
  pure-action elimination log: []
  M strictly dominated by 1/2 T + 1/2 B: True gaps ['1/2', '1/2']

What the numbers show. In the Prisoner’s-Dilemma-shaped game, C is strictly dominated for both players, so elimination leaves (D,D), which is the unique pure Nash equilibrium and also the only cell that is not Pareto optimal: individually sensible play produces an outcome everyone would trade away.

The coordination game has two pure equilibria and one mixed equilibrium in which the row player plays X with probability 3/5 and the column player plays X with probability 2/5. Each mixture is fixed by the other player’s indifference: the column player must be indifferent between X and Y, which requires 2p=3(1−p)2p=3(1-p). Both players then earn 6/5, below what either pure equilibrium gives each of them. The row player’s maxmin value is also 6/5, but it is reached by playing X with probability 2/5, not 3/5. Same value, different strategy: in a general-sum game the security strategy and the equilibrium strategy answer different questions.

Multiplying the row player’s payoffs by ten leaves both pure equilibria unchanged, because best responses only compare a player’s own payoffs. The utility-sum criterion, however, goes from a tie (sum 5 in both coordinated cells) to a strict preference for (X,X) with sum 32. That is the affine-invariance argument from the theory section in two lines of output.

Matching Pennies has no pure equilibrium; the unique equilibrium mixes one half on each side, and the row player’s maxmin value is 0, as the minimax theorem requires for a zero-sum game.

In the 3×3 chain game, column C is dominated by R first (2>1, 6>4, 8>6); only after C is gone do M and B become dominated by T, and then R by L. One profile, (T,L), survives and it is the unique pure equilibrium. In the last game, pure-action elimination removes nothing, yet M is strictly dominated by the mixture ½T+½B, which beats it by 1/2 against each column. A procedure that only checks pure dominators would miss this. Searching over all mixtures is a linear feasibility problem in the mixture weights, so it can be done with a small linear program, which this program does not implement; it only verifies the one mixture we supply.

All computations enumerate the full table, so their cost is proportional to the number of cells, ∏i∣Ai∣\prod_i|A_i|, which grows exponentially with the number of players. The 2×2 maxmin routine is exact only for a row player with two actions; larger games need linear programming.

What the framework assumes

The normal form assumes that the action sets and payoffs are common knowledge and fixed. Real robots, firms or bidders often do not know each other’s payoffs; that leads to Bayesian games, which this article only mentions. The expected-utility formula treats the payoff numbers as already encoding each player’s attitude to risk; if outcomes are money and players are risk averse, the table must contain their utilities for money, not the raw amounts.

Solution concepts are predictions only under behavioral assumptions. Iterated deletion of strictly dominated strategies assumes, for every extra round, one more layer of players knowing that the others are rational and have already deleted their dominated actions. Nash equilibrium needs more: each player must correctly anticipate the others’ strategies, and the coordination game shows that with several equilibria the concept alone does not say which one will occur. Maxmin assumes adversaries even when the other player is not one.

Exact enumeration does not scale. The table size is exponential in the number of players, and even for two players, finding a Nash equilibrium in general-sum games has no known polynomial-time algorithm; see Nash equilibrium. These toy games show definitions behaving as stated; they are not models of any real system.

Predict before you compute

  1. In the Prisoner’s-Dilemma-shaped game, replace the (D,D) payoffs (1,1) by (2,2). Does C stop being dominated? Does (D,D) become Pareto optimal?

    Answer: Against C, D still gives 5>3; against D, D gives 2>0. So C remains strictly dominated and (D,D) is still the unique equilibrium. (D,D) with (2,2) is still Pareto dominated by (C,C) with (3,3), so it is still not Pareto optimal. C stays strictly dominated for any positive (D,D) payoff; (D,D) becomes Pareto optimal only once its payoffs reach 3 or more for both players.

  2. In the coordination game with payoffs (3,2) at (X,X) and (2,3) at (Y,Y), compute by hand the probability with which the column player plays X in the mixed equilibrium and the row player’s payoff there.

    Answer: The column mixture must make the row player indifferent: 3q=2(1−q)3q=2(1-q), so q=2/5q=2/5. The row player’s expected payoff is 3⋅2/5=6/53\cdot 2/5=6/5, matching the program.

  3. A student claims: “If a player’s equilibrium payoff equals its maxmin value, it must be playing its maxmin strategy.” Give a counterexample from this article.

    Answer: The coordination game. In the mixed equilibrium the row player earns 6/5, equal to its maxmin value, but plays X with probability 3/5, while the maxmin strategy plays X with probability 2/5. Against the column player’s equilibrium mixture the row player is indifferent between its actions, so many strategies give 6/5; only one of them guarantees 6/5 against every column choice. The claim holds in two-player zero-sum games, not in general.

  4. A team wants to choose between two traffic-merge protocols for autonomous cars by “maximizing the total utility of all vehicles”. Each manufacturer reports utilities on its own internal scale. What goes wrong, and what can the team say without additional information?

    Answer: Because each manufacturer’s scale is fixed only up to a positive affine transformation, rescaling one manufacturer’s numbers can change which protocol has the larger sum, as the ×10 example shows. Without a defensible common scale (for example, measured travel time or an agreed cost unit), the team can still use Pareto comparisons and check each protocol’s equilibria and dominance structure, but it cannot rank Pareto-noncomparable outcomes by summing utilities.

Where to go from here

Shoham and Leyton-Brown’s chapter 3 is a compact, computer-science-oriented reference for everything above, including further concepts not treated here (minimax regret, rationalizability, correlated equilibrium, trembling-hand perfection and ε-Nash equilibrium) and the history of the field from von Neumann’s 1928 minimax result to Nash’s 1950–1951 papers. Further solution concepts and history Roughgarden’s lecture places these concepts in a nested hierarchy (pure Nash inside mixed Nash inside correlated inside coarse correlated equilibria), with the larger sets marked as easier to compute and learn, which is a useful lens when game-theoretic models meet algorithms. Equilibrium hierarchy

Before relying on a game model, write down which concept answers your question: a guarantee (maxmin), a stability prediction (equilibrium), or an efficiency check (Pareto). Then test whether the conclusion survives a rescaling of each player’s utilities and a change in what players know.

Make a prediction, then check

If one player's payoffs are all multiplied by 10, which of these can change?

Choose one answer

Learning objectives

  • Write a strategic interaction as a normal-form game and compute expected utility, dominance, Pareto optimality and best responses exactly.
  • Distinguish the questions answered by maxmin, Nash equilibrium and Pareto criteria, and test whether conclusions survive rescaling of utilities.

Prerequisites & connections

Explore related knowledge →

References

  1. Multiagent Systems: Algorithmic, Game-Theoretic, and Logical Foundations — Revision 1.1 PDF, chapter 3 (normal-form games), scoped
    Yoav Shoham; Kevin Leyton-Brown · 2010
  2. CS364A Lecture #18: From External Regret to Swap Regret and the Minimax Theorem — scoped lecture notes
    Tim Roughgarden · 2013

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Claude · 2026-12-02 · Independent AI check (Claude subagent, not the author; not a human or expert review). Ran example.py with python3 and diffed it against example.stdout.txt (identical); confirmed the python block in en.mdx and zh.mdx is byte-identical to example.py and that every quoted number matches the output. Re-derived by hand the PD dominance and Pareto results, the coordination-game mixed equilibrium (p=3/5, q=2/5, payoffs 6/5) and row maxmin (x=2/5, value 6/5), the x10 utility-sum change (5 tie to 32), Matching Pennies, the 3x3 elimination order and the 1/2 gaps of the mixed dominator, and all exercise answers. Re-read in the Revision 1.1 PDF of Shoham and Leyton-Brown printed pages 55-60 (normal-form definition, base-representation remark, the statement that an optimal strategy is not meaningful with other agents), 64-65 (interpretations of mixed strategies), 72 (Theorem 3.3.22 statement), 74-76 (Theorem 3.4.4 and proof), 78 (Definition 3.4.8) and the section 3.5 history on 87-88; re-read Roughgarden's Lecture 18 pages 1-2 and 6-8 (hierarchy figure, Theorem 3.1, Borel/von Neumann paragraph, start of no-regret proof). Compared zh and en section by section. Did not read the existence proof body or sections 3.4.4-3.4.7, and did not render the MDX.

  • Code output matches the recorded stdout; code blocks are byte-identical across languages; prose and exercise numbers re-derived by hand.
  • Claims attributed to MAS chapter 3 and Roughgarden Lecture 18 were checked against the pages; Nash 1950/1951 is mentioned only via the book's history notes.
  • zh and en compared section by section: definitions, numbers, exercises and answers match.

Source locations checked:

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.