Game Theory Basics

GATE Relevance: Medium

Prerequisites

🎯 Learning Objectives

  • Understand why adversarial search differs from standard search
  • Classify games by their properties (deterministic vs stochastic, perfect vs imperfect information, zero-sum vs general-sum)
  • Define game trees, terminal states, and utility functions
  • Explain two-player zero-sum games and their significance in AI
  • Distinguish normal form and extensive form representations
  • Recognize the connection between game trees and search trees

1. Why Adversarial Search?

In standard search problems (Chapters 2–3), the agent is the sole decision-maker. The environment is passive — it doesn’t fight back. In adversarial search, the agent faces an opponent who actively tries to minimize the agent’s success.

Adversarial Search

A search problem in which two or more agents have conflicting goals, and each agent must account for the opponent’s moves when choosing its own actions. The game tree is a search tree where the opponent controls half (or some fraction) of the moves.

Games are an ideal domain for studying AI because they are:

  • Well-defined — clear rules, states, and outcomes
  • Challenging — opponents create enormous complexity
  • Measurable — win/loss/draw provides clear performance metric
  • Abstract — strip away real-world noise, focus on reasoning
Search vs. Games

In standard search, the agent plans a complete path from start to goal. In a game, the agent can only decide its next move because the opponent’s response is uncertain. The agent must use a strategy (or policy) rather than a fixed plan.

2. Types of Games

Games can be classified along several dimensions. Understanding these classifications is essential for choosing the correct algorithm.

2.1 Deterministic vs. Stochastic

PropertyDeterministicStochastic
RandomnessNo chance elementsInvolves dice, card draws, etc.
Outcome of actionsFully predictableProbabilistic outcomes
ExamplesChess, Checkers, Go, Tic-Tac-ToeBackgammon, Poker, Monopoly
AlgorithmMinimax, Alpha-BetaExpectiminimax

2.2 Perfect vs. Imperfect Information

PropertyPerfect InformationImperfect Information
State visibilityBoth players see the complete game stateSome information is hidden
ExamplesChess, Go, CheckersPoker, Battleship, Bridge
Decision basisFull knowledge of current positionBelief states, probability estimates

2.3 Zero-Sum vs. General-Sum

Zero-Sum Game

A game is zero-sum if the total payoff to all players sums to zero (or a constant) for every outcome. One player’s gain is exactly the other player’s loss. Formally: UA + UB = 0 for all terminal states.

PropertyZero-SumGeneral-Sum
Payoff relationshipStrictly competitive: one wins, other loses equallyMixed motives: cooperation possible
ExamplesChess (+1/0/−1), Go, Tic-Tac-ToePrisoner’s Dilemma, trade negotiations
AI focusPrimary focus of adversarial searchMore complex, game theory heavy

2.4 Number of Players

  • Two-player games — Most studied in AI (Chess, Go, Tic-Tac-Toe)
  • Multi-player games — Alliances may form; more complex strategies (e.g., Risk)
  • Single-player “games” — Really just search/optimization problems (e.g., puzzles)
GATE Focus

GATE DA questions focus almost exclusively on two-player, deterministic, perfect-information, zero-sum games. This is the setting for Minimax and Alpha-Beta pruning. Stochastic games (Expectiminimax) appear occasionally.

3. The Game Tree

A game tree represents all possible plays of a game. It is essentially a search tree, but with an important difference: different levels are controlled by different players.

Game Tree Components
  • S0 — Initial state (starting position of the game)
  • PLAYER(s) — Function that returns which player moves in state s
  • ACTIONS(s) — Set of legal moves in state s
  • RESULT(s, a) — Transition model: state resulting from action a in state s
  • IS-TERMINAL(s) — Returns true if s is a terminal state (game over)
  • UTILITY(s, p) — Numeric payoff for player p at terminal state s

3.1 Example: Tic-Tac-Toe Game Tree (Partial)

                        (empty board)          ← MAX moves (X)
                       /     |     \
                    X..     .X.     ..X  ...     ← 9 possible first moves
                   / | \   / | \
                 XO. X.O  ...                    ← MIN moves (O)
                / | \
             XOX XO. ...                         ← MAX moves (X)
               ...
            Terminal states: X wins (+1), O wins (-1), Draw (0)

For Tic-Tac-Toe:

  • Branching factor: starts at 9, decreases each level
  • Maximum depth: 9 moves
  • Total game tree nodes: 9! = 362,880 (upper bound; actual ≈ 255,168 due to early termination)
  • Unique states: about 5,478 (after accounting for symmetry)

3.2 Terminal States and Utility

The utility function (also called payoff function) assigns a numeric value to each terminal state from the perspective of a player.

GameWinLossDraw
Tic-Tac-Toe+1−10
Chess+1−10
Backgammon+192 (max)−192N/A

In a zero-sum game, UTILITY(s, MAX) = −UTILITY(s, MIN). So we only need to track one value — the utility for MAX. MAX tries to maximize this value; MIN tries to minimize it.

4. Normal Form vs. Extensive Form

4.1 Normal Form (Strategic Form)

A normal form game is represented as a matrix showing payoffs for each combination of player strategies. Both players choose simultaneously.

Example: Prisoner’s Dilemma (Normal Form)
                    Player B
                  Cooperate    Defect
Player A  Coop   (-1, -1)    (-3, 0)
          Defect ( 0, -3)    (-2, -2)

Each cell: (Payoff for A, Payoff for B)
Dominant strategy: Both defect → (-2, -2)

Note: This is a general-sum game — not zero-sum since (-1)+(-1) ≠ 0.

4.2 Extensive Form (Game Tree)

An extensive form game is represented as a tree showing the sequential structure of decisions. This is the standard representation used in adversarial search.

Example: Simple Game in Extensive Form
         MAX (root)
        /          \
    a1 /            \ a2
      /              \
    MIN              MIN
   /   \            /   \
  b1    b2        b3    b4
  |     |         |     |
 (3)   (12)      (8)   (2)
 
Terminal utilities shown for MAX player.
MAX wants highest value, MIN wants lowest.

Optimal play: MAX chooses a1 (value 3)
  because MIN will choose b1 (giving 3) at left,
  and MIN will choose b4 (giving 2) at right.
  MAX prefers 3 over 2, so chooses a1.
Key Distinction

Normal form is used primarily in classical game theory (simultaneous moves). Extensive form (game tree) is the standard representation in AI adversarial search (sequential moves). For GATE, you’ll almost always work with the extensive form / game tree.

5. Two-Player Zero-Sum Games in Detail

The vast majority of adversarial search algorithms focus on two-player zero-sum games with perfect information. Here are the key properties:

Two-Player Zero-Sum Game
  • Players: MAX and MIN (by convention)
  • MAX moves first (or is the player we’re computing for)
  • MIN is the opponent
  • They alternate turns (in most games)
  • UTILITY(s, MAX) + UTILITY(s, MIN) = 0 for all terminal states s
  • MAX wants to maximize UTILITY; MIN wants to minimize it

The minimax value of a node is the utility that both players can guarantee under optimal play. This is the foundation of the Minimax algorithm (next section).

MINIMAX-VALUE(s) =
  UTILITY(s)                           if IS-TERMINAL(s)
  max over a in ACTIONS(s) of
    MINIMAX-VALUE(RESULT(s, a))        if PLAYER(s) = MAX
  min over a in ACTIONS(s) of
    MINIMAX-VALUE(RESULT(s, a))        if PLAYER(s) = MIN

6. Nash Equilibrium (Brief)

Nash Equilibrium

A set of strategies (one per player) where no player can improve their payoff by unilaterally changing their strategy, given the other players’ strategies remain fixed.

In two-player zero-sum games, the Nash equilibrium corresponds exactly to the minimax solution. Both players play optimally, and neither can benefit from deviating. The minimax theorem (von Neumann, 1928) guarantees that such an equilibrium always exists in finite two-player zero-sum games.

Example: Nash Equilibrium in Tic-Tac-Toe

The Nash equilibrium of Tic-Tac-Toe is a draw. If both players play optimally, neither can force a win. The minimax value of the initial state is 0 (draw). Any deviation from optimal play by one player can only benefit the other.

7. Solved vs. Unsolved Games

GameStatusGame Tree ComplexityResult
Tic-Tac-ToeStrongly solved~105Draw with optimal play
Connect FourStrongly solved (1988)~1013First player wins
CheckersWeakly solved (2007)~1031Draw with optimal play
ChessUnsolved~10123Unknown (likely draw)
Go (19×19)Unsolved~10360Unknown
  • Strongly solved: Optimal strategy known for all positions
  • Weakly solved: Optimal strategy known from the initial position with both players playing optimally
  • Unsolved: Too complex to solve completely with current technology

9. GATE Practice Points

⚠ Common Mistakes
  • Confusing zero-sum with general-sum games — Prisoner’s Dilemma is NOT zero-sum
  • Assuming all games have perfect information — Poker has hidden cards
  • Forgetting that in a zero-sum game, MIN’s utility = −(MAX’s utility)
  • Treating game trees like regular search trees (ignoring the alternating min/max)

⚡ Quick Facts for GATE

  • Adversarial search applies to competitive multi-agent environments
  • GATE focuses on two-player, deterministic, perfect-information, zero-sum games
  • A game tree has MAX and MIN nodes alternating by level
  • Utility is always defined from MAX’s perspective in zero-sum games
  • Nash equilibrium = minimax solution for two-player zero-sum games
  • Tic-Tac-Toe, Chess, Go are deterministic perfect-information zero-sum games
  • Backgammon is stochastic (dice); Poker has imperfect information

Summary

  • Adversarial search differs from standard search because an opponent actively works against the agent.
  • Games are classified as deterministic/stochastic, perfect/imperfect information, zero-sum/general-sum.
  • A game tree represents all possible plays, with alternating MAX and MIN decision levels.
  • Terminal states have utility values; MAX maximizes, MIN minimizes.
  • Two-player zero-sum games are the primary focus of adversarial search algorithms.
  • The minimax value gives the guaranteed outcome under optimal play by both sides.
  • Nash equilibrium in zero-sum games corresponds to the minimax solution.

References

  • Russell, S. & Norvig, P. Artificial Intelligence: A Modern Approach, 4th Edition — Chapter 5.1–5.2
  • von Neumann, J. & Morgenstern, O. Theory of Games and Economic Behavior (1944)
  • Schaeffer, J. et al. “Checkers Is Solved” — Science, 2007