Algorithmic Game Theory · Prerequisites
Prerequisites for Algorithmic Game Theory
This page collects the background that the 16 slide decks build on. The Chapter 0 · Preliminaries deck covers the most essential core: sets, counting, sums and the geometric series, argmax and derivatives, probability, Bayes' rule, U[0, 1], expected value, xᵀAy, best response, indifference and backward induction. Chapters 1–14 use the topics below. Each topic's card says what you need to know, in which chapters it is used, and includes two short self-check questions. The details open with the Details and self-check button. Click a question to see its answer.
The essential core. Sets and logic, expected value, conditional probability, reading a payoff matrix, argmax, Big-O notation and basic Python. The other topics are explained in the decks. Even so, the course moves faster if they are known in advance.
Terms. The Terms line gives the terms used in the slides. The full list is in the course glossary.
Mathematics
Sets, proofs, counting, sums and logarithms, derivatives, convexity, matrices and fixed points.
Sets, functions and logic
Terms strategy set; strategy profile; unilateral deviation
Every game is a tuple of sets and functions: players N, strategy sets Sᵢ, payoffs uᵢ : S → ℝ. Equilibrium definitions are built from the patterns “for every …” and “there exists a … such that”.
Chapters Chapter 0 Chapter 2 Chapter 3 Chapter 4 Chapter 7
- The set of strategy profiles is a Cartesian product: S = S₁ × S₂ × ··· × Sₙ. Its number of elements is |S₁|·|S₂|·…·|Sₙ|.
- s₋ᵢ denotes the strategies of everyone except player i. A profile is then written (sᵢ, s₋ᵢ).
- Nash equilibrium with quantifiers: for every player i and every sᵢ′ ∈ Sᵢ, uᵢ(sᵢ*, s₋ᵢ*) ≥ uᵢ(sᵢ′, s₋ᵢ*).
- In the negation the quantifiers swap: there exist a player i and a strategy sᵢ′ with uᵢ(sᵢ′, s₋ᵢ*) > uᵢ(sᵢ*, s₋ᵢ*). This is a profitable deviation.
- Relations: preferences are binary relations (≻, ≿). Voting theory relies on transitivity and completeness.
Self-check
Three players have 2, 3 and 4 pure strategies respectively. How many pure strategy profiles are there?
2 · 3 · 4 = 24.
What is the negation of the statement “for every player, no deviation is profitable”?
“There is a player with a profitable deviation.” In that case the profile is not a Nash equilibrium.
Proof techniques
Terms backward induction; strategy-stealing argument
Most results in the course are claims about every deviation, every mechanism or every preference profile. That is why you need to be able to read and write short proofs.
Chapters Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning Chapter 3 Chapter 4 Chapter 7 Chapter 9
- Direct proof: show one by one that no unilateral deviation increases any player's payoff.
- Induction: backward induction and Zermelo's theorem proceed from the leaves of a finite game tree toward the root. Nim strategies are proved by induction on the position.
- Contradiction: the strategy-stealing argument shows that the first player cannot lose in Hex.
- Counterexample: a small game is enough to refute a general claim. For example, a vote profile that breaks monotonicity.
- Impossibility theorems (Arrow, Gibbard–Satterthwaite, Myerson–Satterthwaite) say that no rule satisfies a list of properties at the same time.
Self-check
How can the claim “every finite game has a Nash equilibrium in pure strategies” be refuted?
Matching Pennies is enough: in each of the four pure profiles, one of the players wants to change their strategy. A mixed equilibrium, on the other hand, always exists by Nash's theorem.
Which proof technique does backward induction rest on?
Induction on the depth of the game tree. First the subgames of depth 1 are solved, then those of depth 2, and so on up to the root.
Combinatorics and permutations
Terms Shapley value; marginal contribution; Bell number
Strategy spaces, rankings, player orders and coalition structures grow very fast. Counting shows when brute-force search is hopeless.
Chapters Chapter 0 Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning Chapter 3 Chapter 7 Chapter 10
- n objects have n! orderings (permutations). A set of n elements has 2ⁿ subsets. C(n, k) = n! / (k!(n − k)!).
- The Shapley value is the average of player i's marginal contributions over the n! arrival orders. Equivalent form: φᵢ = Σ (S ⊆ N∖{i}) |S|!(n − |S| − 1)!/n! · [v(S ∪ {i}) − v(S)]. This sum runs over 2ⁿ⁻¹ coalitions.
- For m candidates there are m! strict rankings. This is why the Kemeny rule searches a very large space.
- The number of coalition structures (set partitions) of n players is the Bell number Bₙ: B₃ = 5, B₄ = 15, B₁₀ = 115,975.
Self-check
To compute the Shapley value exactly in a game with 4 players, over how many arrival orders do you average?
4! = 24.
For n = 3, what weight does the formula give a coalition S with
S| = 1?|1! · 1! / 3! = 1/6.
Sums, logarithms and the exponential function
Terms discount factor; harmonic number; learning rate
Discounted repeated games, the Price of Stability, multiplicative weights and differential privacy are written with geometric sums, logarithms and the exponential function.
Chapters Chapter 0 Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning Chapter 9 Chapter 13 Chapter 14
- Geometric series: for 0 ≤ δ < 1, Σt≥0 δᵗ = 1/(1 − δ). The total value of a payoff c in every round is therefore c/(1 − δ).
- Harmonic number Hₙ = 1 + 1/2 + … + 1/n ≈ ln n + 0.577. In fair cost-sharing games the Price of Stability (PoS) is bounded by this number: PoS ≤ Hₙ.
- Logarithm rules: ln(ab) = ln a + ln b, ln(aᵏ) = k ln a. Logarithmic growth is very slow (ln 10⁶ ≈ 13.8).
- Exponential function: ex ≥ 1 + x for every x; for small ε, eε ≈ 1 + ε. Differential privacy guarantees are expressed with factors of eε.
- The multiplicative weights update has the form wᵢ ← wᵢ · eη·gᵢ. Adding gains in the exponent means multiplying the weights.
Self-check
In a Prisoner's Dilemma with R = 3, T = 5, P = 1, for which values of δ does cooperation survive under the grim trigger strategy?
3/(1 − δ) ≥ 5 + δ·1/(1 − δ) ⇔ 3 ≥ 5 − 4δ ⇔ δ ≥ 1/2. The general condition is δ ≥ (T − R)/(T − P).
What is H₄?
1 + 1/2 + 1/3 + 1/4 = 25/12 ≈ 2.08.
Derivatives and first-order conditions
Terms maximize; minimize; first-order condition
Continuous strategies (quantities, bids, prices, flows) are optimized by setting the derivative to zero. Then you check that the point found is really a maximum.
Chapters Chapter 0 Chapter 1 Chapter 3 Chapter 5 Chapter 6 Chapter 8
- First-order condition: at an interior maximum of a differentiable f, f′(x) = 0. The second derivative (f″ < 0) or the endpoints are also checked, because f′ = 0 can also indicate a minimum.
- The product rule (fg)′ = f′g + fg′ and the power rule (xᵏ)′ = k xᵏ⁻¹ are enough for the derivations in the course.
- Cournot: each firm maximizes its profit qᵢ·P(q₁ + q₂) − cost. Taking the derivative gives the best-response function.
- The integral as accumulated cost: the Beckmann potential Φ(f) = Σₑ ∫₀fₑ ℓₑ(t) dt. The derivative of this potential with respect to fₑ is the delay ℓₑ(fₑ).
Example (Chapter 5). There are n bidders and the rivals bid β·vⱼ, with vⱼ ~ U[0, 1]. Then a bid b wins with probability (b/β)ⁿ⁻¹. When (v − b)(b/β)ⁿ⁻¹ is maximized, the derivative vanishes when (n − 1)(v − b) = b. The result is b = (n − 1)v/n.
Self-check
What is the maximum of f(q) = q(10 − q) for q ≥ 0?
f′(q) = 10 − 2q = 0 ⇒ q = 5. Since f″ = −2 < 0, the maximum is f(5) = 25.
What is ∫₀ˣ t dt, and what is its derivative?
x²/2. Its derivative is x. This is the delay of the edge ℓ(x) = x in the Pigou network.
Convex and concave functions
Terms convex; concave; Jensen's inequality
Convexity makes optimization easy: a local optimum is also a global optimum. Risk aversion is also explained by Jensen's inequality.
Chapters Chapter 1 Chapter 3 Chapter 8 Chapter 12
- f is convex if f(λx + (1 − λ)y) ≤ λf(x) + (1 − λ)f(y) for every λ ∈ [0, 1]. For a twice differentiable f this condition means f″ ≥ 0. f is concave if −f is convex.
- A local minimum of a convex function is a global minimum. This is why the Wardrop equilibrium is well defined by the convex Beckmann potential.
- A set is convex if it contains the line segment between any two of its points. The set of mixed strategies (the simplex) is convex. Kakutani's theorem relies on this property.
- Jensen's inequality: if f is convex, f(E[X]) ≤ E[f(X)]; if u is concave, E[u(X)] ≤ u(E[X]). That is why a concave utility means risk aversion.
Self-check
Let u(x) = √x. A lottery pays 0 or 900 with probability 1/2 each. What are E[u] and the certainty equivalent?
E[u] = (0 + 30)/2 = 15. The certainty equivalent is 15² = 225, which is less than E[X] = 450. The risk premium is 225.
Is f(x) = x² convex, concave, or neither?
It is convex, because f″(x) = 2 ≥ 0. It is a risk-loving utility function, as in Chapter 1.
Vectors and payoff matrices
Terms payoff matrix; mixed strategy; support
Finite two-player games are a pair of matrices. Mixed strategies are probability vectors. Expected payoffs are found by matrix–vector multiplication.
Chapters Chapter 0 Chapter 2 Chapter 3 Chapter 13
- Two-matrix game (A, B): when row i meets column j, the row player gets Aᵢⱼ and the column player gets Bᵢⱼ. In a zero-sum game B = −A.
- A mixed strategy is a vector in the simplex Δ = { x : xᵢ ≥ 0, Σxᵢ = 1 }. Its support is the set of actions with xᵢ > 0.
- Expected payoffs: (Ay)ᵢ is the row player's payoff from pure action i against y. xᵀAy is the payoff of x against y.
- Support enumeration solves small systems of linear equations: the payoffs on the support are equal and the probabilities sum to 1.
Self-check
Let A = [[3, 0], [5, 1]] (rows: cooperate, defect). For x = (1/2, 1/2) and y = (1, 0), what is xᵀAy?
Ay = (3, 5), so xᵀAy = (3 + 5)/2 = 4.
In the same matrix, does row D dominate row C?
Yes, strictly: 5 > 3 and 1 > 0 in both columns.
Fixed points (Brouwer and Kakutani)
Terms fixed-point theorem; Nash's existence theorem; best-response correspondence
Nash's existence theorem is a fixed-point theorem. An equilibrium is a profile that is a best response to itself.
Chapters Chapter 3 Chapter 6 Chapter 13
- A fixed point of f is a point satisfying f(x) = x. For a set-valued correspondence F, this condition becomes x ∈ F(x).
- Brouwer: every continuous f mapping a nonempty, compact (closed and bounded) and convex set K ⊂ ℝⁿ into itself has a fixed point.
- Kakutani: the same result holds for a correspondence F whose values F(x) are nonempty and convex and whose graph is closed. Nash applies this theorem to the best-response correspondence on mixed profiles: σ* ∈ BR(σ*).
- These theorems prove existence but give no efficient algorithm. The class PPAD measures exactly this gap.
- Dynamics such as the adoption model in Chapter 6 or the learning rules in Chapter 13 stop at fixed points of their update maps.
Self-check
What is the fixed point of f(x) = 1 − x on [0, 1]?
x = 1 − x ⇒ x = 1/2.
Why does f(x) = x/2 have no fixed point on the open interval (0, 1)? Doesn't Brouwer's theorem rule this out?
The only solution of x = x/2 is 0, and 0 is not in (0, 1). Brouwer's theorem does not apply because the set is not closed.
Probability and statistics
Distributions, expected value, Bayes' rule, order statistics, sampling and Markov models.
Probability and distributions
Terms uniform distribution; common prior; independent private values
Mixed strategies, private types, bidder values and model errors are random variables. You need to read distributions and compute simple probabilities.
Chapters Chapter 0 Chapter 1 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 12
- Discrete distribution: probabilities pᵢ ≥ 0 with Σpᵢ = 1. Continuous distribution: a density f ≥ 0 and a distribution function F(x) = P(X ≤ x).
- Uniform distribution U[0, 1]: on [0, 1], F(x) = x and f(x) = 1. E[X] = 1/2, Var(X) = 1/12.
- Independence: P(A ∩ B) = P(A)·P(B). Independent private values (IPV) means each bidder's value is drawn independently.
- The key step in auctions: for k independent U[0, 1] values, P(all ≤ b) = bᵏ. This is the probability of beating k rivals who bid their values.
Self-check
Let X ~ U[0, 1]. What is P(X ≤ 0.3)?
F(0.3) = 0.3.
What is the probability that two independent U[0, 1] values are both at most 0.5?
0.5 · 0.5 = 0.25.
Expected value and variance
Terms expected value; expected payoff; lottery
Mixed-strategy payoffs, expected revenue, bandit rewards and decision trees are all expected values.
Chapters Chapter 0 Chapter 1 Chapter 2 Chapter 3 Chapter 5 Chapter 12 Chapter 13
- E[X] = Σ x·P(X = x) (discrete) or ∫ x f(x) dx (continuous).
- Linearity: E[aX + bY] = aE[X] + bE[Y]. It holds even when X and Y are dependent.
- If f is not linear, in general E[f(X)] ≠ f(E[X]) (Jensen's inequality in the convexity card).
- Var(X) = E[X²] − (E[X])² measures the spread. Two lotteries with the same mean can have very different risk.
- The expected payoff is not the most likely payoff: a lottery that pays 100 with probability 0.3 never pays 30.
Self-check
A lottery pays 100 with probability 0.3 and 0 otherwise. What are E[X] and Var(X)?
E[X] = 30. Since E[X²] = 3000, Var(X) = 3000 − 900 = 2100.
Does the equality E[X + Y] = E[X] + E[Y] require independence?
No. Linearity of expectation always holds. Independence is needed for E[XY] = E[X]E[Y].
Conditional probability and Bayes' rule
Terms Bayes' rule; prior; posterior; base rate
Bayesian games, reputation systems, fairness metrics and decision analysis update beliefs with conditional probabilities.
Chapters Chapter 0 Chapter 1 Chapter 3 Chapter 4 Chapter 6 Chapter 11
- For P(B) > 0, P(A | B) = P(A ∩ B) / P(B).
- Bayes' rule: P(H | E) = P(E | H)·P(H) / P(E). The denominator comes from the law of total probability: P(E) = P(E | H)P(H) + P(E | ¬H)P(¬H).
- Fairness rates are conditional probabilities: the true positive rate TPR = P(Ŷ = 1 | Y = 1), the false positive rate FPR = P(Ŷ = 1 | Y = 0), the precision PPV = P(Y = 1 | Ŷ = 1).
- Ignoring the base rate: if P(H) is not taken into account, a positive result of an accurate test looks far more conclusive than it is.
- Sequential updating: today's posterior is tomorrow's prior.
Self-check
The prevalence is 1%, the sensitivity is 90% and the false positive rate is 5%. What is P(sick
positive)?|0.9·0.01 / (0.9·0.01 + 0.05·0.99) = 0.009 / 0.0585 ≈ 0.15.
An independent second test is also positive. What is the updated probability?
Take the prior 0.154: 0.9·0.154 / (0.9·0.154 + 0.05·0.846) ≈ 0.77.
Order statistics for auctions
Terms revenue equivalence theorem; winner's curse; virtual value
Auction revenue is the expected value of the highest or second-highest bid. That is why the expected value of the k-th largest of n random values appears throughout Chapter 5.
Chapters Chapter 5 Chapter 14
- For n independent U[0, 1] values, the expectation of the k-th highest value is (n + 1 − k)/(n + 1). The expectation of the highest value is n/(n + 1), and that of the second highest is (n − 1)/(n + 1).
- Revenue of the second-price auction = E[second-highest value] = (n − 1)/(n + 1).
- Revenue of the first-price auction with the bid b = (n − 1)v/n = (n − 1)/n · n/(n + 1) = (n − 1)/(n + 1). As revenue equivalence predicts, the result is the same.
- The winner's curse: if estimation errors are distributed U[−a, a], the expectation of the largest of n errors is a(n − 1)/(n + 1). The winner is the bidder who overestimates the value the most.
- Virtual value φ(v) = v − (1 − F(v))/f(v). For U[0, 1], φ(v) = 2v − 1 and the best reserve price is 1/2.
Self-check
With two bidders whose values are U[0, 1], what is the expected revenue of the second-price auction?
(2 − 1)/(2 + 1) = 1/3. This is the expectation of the smaller of two uniform variables.
With 4 bidders, what is the expected value of the winner?
4/5 = 0.8.
Sampling, rates and simulation
Terms confusion matrix; true positive rate; sample complexity
Simulations, bandit estimates, fairness audits and learned mechanisms estimate quantities from noisy samples.
Chapters Chapter 5 Chapter 11 Chapter 13 Chapter 14
- Law of large numbers: the sample mean of N independent draws approaches the true mean. Its standard error is σ/√N.
- Confusion matrix rates: TPR = TP/(TP + FN), FPR = FP/(FP + TN), PPV = TP/(TP + FP), selection rate = (TP + FP)/total.
- In a simulation, the frequencies with which actions are seen estimate the mixed strategies. With small samples these frequencies fluctuate a lot.
- Sample complexity asks how many samples are needed to estimate to accuracy ε. With few samples, overfitting appears.
Self-check
By what factor must the sample grow to halve the standard error?
Four times, because the error scales as 1/√N.
TP = 40, FN = 10, FP = 10, TN = 40. What are TPR and FPR?
TPR = 40/50 = 0.8; FPR = 10/50 = 0.2.
Markov chains and Markov decision processes
Terms policy; state–action value
Q-learning and repeated games evaluate long sequences of rewards. The model behind them is the Markov decision process.
Chapters Chapter 2 Chapter 13
- Markov property: the next state depends only on the present state (and action), not on the whole history.
- A Markov decision process (Markov decision process, MDP) consists of states S, actions A, transition probabilities P(s′ | s, a), rewards r and a discount γ ∈ [0, 1). The goal is to maximize E[Σ γᵗ rₜ].
- A policy maps states to actions. The greedy policy picks the action argmaxₐ Q(s, a).
- Q-learning update: Q(s, a) ← Q(s, a) + α[r + γ·maxₐ′ Q(s′, a′) − Q(s, a)]. Here α is the learning rate.
Self-check
Q(s, a) = 2; r = 1; γ = 0.9; max Q(s′, ·) = 4; α = 0.5. What is the new Q(s, a)?
2 + 0.5·(1 + 3.6 − 2) = 3.3.
A reward of 1 is received at every step forever and γ = 0.9. What is the discounted total return?
1/(1 − 0.9) = 10.
Optimization
argmax, linear programming and duality. This is the language of best responses, welfare and minimax.
Optimization basics and argmax
Terms optimization; social welfare; social optimum
Best responses, VCG allocations and social optima do the same job: among the feasible options, pick the one with the largest objective.
Chapters Chapter 0 Chapter 3 Chapter 4 Chapter 5 Chapter 9 Chapter 10 Chapter 12
- An optimization problem has decision variables, an objective to maximize or minimize, and constraints that define the feasible set.
- max f is a value. argmax f is the set of maximizing points. In case of ties, argmax can contain more than one point. This is why mechanisms need a tie-breaking rule.
- Best response: BRᵢ(s₋ᵢ) = argmax (over sᵢ) uᵢ(sᵢ, s₋ᵢ). VCG chooses the allocation x* = argmaxₓ Σᵢ bᵢ(x).
- OPT denotes the best objective value. The Price of Anarchy compares the cost of an equilibrium with OPT.
Self-check
For f(x) = −(x − 2)² on [0, 5], what are max f and argmax f?
max f = 0, argmax f = {2}.
The payoffs are a: 3, b: 5, c: 5. What is the argmax?
{b, c}. A tie-breaking rule is needed to pick one.
Linear programming and duality
Terms linear programming; minimax theorem; value of the game; saddle point
Zero-sum games, correlated equilibria and some mechanism design problems are solved by linear programs. The reason the maximin value equals the minimax value is LP duality.
Chapters Chapter 3 Chapter 13 Chapter 14
- An LP maximizes or minimizes a linear objective under linear inequality constraints. The feasible set is a convex polyhedron. If the feasible set is a nonempty, bounded polyhedron, at least one optimum is at a vertex.
- LPs are solved in polynomial time (ellipsoid and interior-point methods). The simplex method is fast in practice but exponential in the worst case.
- Duality: every maximization LP has a minimization dual. Weak duality: primal value ≤ dual value. Strong duality: at the optimum the two are equal.
- The row player's LP in a zero-sum game: maximize v subject to Σᵢ xᵢAᵢⱼ ≥ v for every column j, Σxᵢ = 1 and x ≥ 0. The column player's LP is its dual. Hence max min = min max (von Neumann's minimax theorem).
- Correlated and coarse correlated equilibria are also LP feasibility problems. That is why they can be computed in polynomial time.
Self-check
Let A = [[3, 1], [4, 2]] (the row player maximizes). What are the maximin, the minimax and the saddle point?
Row minima are 1 and 2 ⇒ maximin 2. Column maxima are 4 and 2 ⇒ minimax 2. The saddle point is (row 2, column 2), with value 2.
In Matching Pennies (payoffs ±1), what are the value of the game and the best strategy?
The value is 0. Both players mix (1/2, 1/2).
Algorithms and complexity
Running time, algorithm design, XOR, graphs and the classes P, NP, PPAD and PLS.
Big-O and running time
Terms greedy; alpha–beta pruning
Algorithmic game theory is not content with whether a result exists. It also asks whether that result can be computed quickly.
Chapters Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning Chapter 4 Chapter 8 Chapter 9 Chapter 10
- Common growth rates: O(1) < O(log n) < O(n) < O(n log n) < O(n²) < O(n³) < O(2ⁿ) < O(n!). O is an upper bound, and Θ is a tight bound.
- Polynomial time (O(nᵏ)) is the working definition of the word “efficient”.
- A game tree with branching factor b and depth d has about bᵈ leaves. If moves are examined in the best order, alpha-beta pruning looks at about bd/2 leaves.
- Examples in the course: Gale–Shapley O(n²), the Hungarian algorithm O(n³), Dijkstra with a binary heap O((V + E) log V).
Self-check
Assigning 10 robots to 10 tasks: how do brute force and the Hungarian algorithm compare?
Brute force tries 10! = 3,628,800 assignments. The Hungarian algorithm takes about 10³ = 1000 steps.
Is O(n log n) polynomial?
Yes. It is bounded by O(n²).
Algorithm design and step-by-step tracing
Terms deferred acceptance
Many of the slide decks contain step-by-step code traces. You need to be able to trace an algorithm, state its input and output, and justify that it halts and is correct.
Chapters Chapter 0 Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning Chapter 4 Chapter 10
- Recursion: minimax computes a node from the values of its children. Backward induction is the same idea on a game tree.
- Dynamic programming stores solved subproblems. For example, the winning and losing positions of a subtraction game.
- Greedy algorithms make the locally best choice at each step. They are fast but do not always give the optimum. The Hungarian algorithm, however, finds the optimal assignment.
- Gale–Shapley (deferred acceptance): proposers propose in order of preference, and receivers hold on to the best offer. The algorithm ends with a stable matching that is best for the proposing side.
Self-check
Why does Gale–Shapley terminate?
Each proposer proposes to each receiver at most once. Hence at most n² proposals are made.
The minimax leaves under a MAX node are 3, 7 and 2. What is the value of the node?
The largest of its children, 7.
Trees, recursion and exponential growth
Terms game tree; branching factor; depth-first search; iterative deepening
Minimax and alpha-beta traverse the game tree recursively, in depth-first order. The size of the tree grows exponentially with the branching factor and depth. How deep one can search in a given time is computed with a logarithm.
Chapters Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning
- Tree terms: the root is the starting position, the leaves are game endings or positions at the depth limit. The depth of a node is its distance from the root. In a game tree the layers belong alternately to the MAX and MIN players.
- If every internal node has b children, there are bd leaves at depth d and 1 + b + … + bd = (bd+1 − 1)/(b − 1) nodes in total. The vast majority of nodes are in the last layer: about 90% of them for b = 10.
- In a recursive traversal, the value of a node is computed from the values of its children. Only the path from the root to the current node is held in memory. So the time is O(bd) while the memory is only O(b·d).
- Logarithm: with a budget of N leaves, the reachable depth is d = logb N = ln N / ln b. Since bd/2 = (√b)d, with the best move ordering alpha-beta reaches about twice the depth with the same budget.
- Iterative deepening repeats the search for d = 1, 2, 3, …. The total cost of the earlier rounds is only about 1/(b − 1) times that of the last round.
Self-check
In a uniform tree with b = 3 and d = 2, how many nodes and how many leaves are there?
1 + 3 + 9 = 13 nodes, 9 leaves. With the best ordering, alpha-beta looks at 3 + 3 − 1 = 5 leaves.
In chess b ≈ 35, and a program evaluates 10⁶ leaves per second. How many layers deep can it search in 10 seconds?
N = 10⁷ and ln 10⁷ / ln 35 ≈ 16.1 / 3.56 ≈ 4.5. Plain minimax reaches about 4 layers, and alpha-beta with the best ordering about 9 layers.
Binary numbers and XOR
Terms nim-sum; impartial game; Sprague–Grundy theorem
Nim is solved exactly by the bitwise XOR of the pile sizes. The Sprague–Grundy theory extends this result to other impartial games.
Chapters Chapter 2 Chapter 2 · Minimax and Alpha-Beta Pruning
- XOR (⊕) adds binary digits without carry: a bit of the result is 1 if the number of inputs with a 1 in that position is odd.
- x ⊕ x = 0 and x ⊕ 0 = x. XOR is commutative and associative.
- Nim (normal play): if the nim-sum of the piles is 0, the player to move loses when both sides play best.
Self-check
What is 3 ⊕ 4 ⊕ 5?
011 ⊕ 100 ⊕ 101 = 010 = 2. Since the sum is not zero, the player to move can win.
The piles are 1, 2 and 3. Who wins under best play?
1 ⊕ 2 ⊕ 3 = 0, so the player to move loses.
P, NP, PPAD and PLS
Terms NP-hard; PPAD-complete; PLS-complete; ε-approximate equilibrium
Complexity classes explain which objects in game theory are easy to compute (equilibria of zero-sum games, correlated equilibria) and which are believed to be hard (general Nash equilibria, optimal allocations).
Chapters Chapter 3 Chapter 4 Chapter 7 Chapter 8 Chapter 14
- P: problems solvable in polynomial time. NP: problems for which a proposed solution can be verified in polynomial time.
- NP-hard: every NP problem reduces to it in polynomial time. NP-complete = both NP-hard and in NP. Examples in the course: the argmax step of VCG in combinatorial auctions, the Kemeny ranking, manipulating some voting rules.
- Why isn't finding a Nash equilibrium NP-complete? An equilibrium always exists, so the yes/no question is trivial. The hardness lies in finding the equilibrium.
- PPAD: search problems whose solution is guaranteed by a parity (end-of-the-line) argument. Brouwer, Sperner and Nash are in this class. Two-player Nash equilibrium is PPAD-complete (Chen–Deng, 2006; journal version Chen–Deng–Teng, 2009).
- PLS: local search problems. Finding a pure equilibrium of a congestion game is PLS-complete.
Self-check
Can a correlated equilibrium be computed in polynomial time?
Yes. It is a linear program over the probabilities of the action profiles.
Why is “Does this game have a mixed Nash equilibrium?” not an interesting NP question?
The answer is always yes (Nash's theorem). The hardness concerns finding the equilibrium. PPAD measures exactly this.
Graphs, shortest paths and flows
Terms graph; node; edge; latency function
Routing games, network formation, matching markets, voting tournaments and kidney exchange are all graph problems.
Chapters Chapter 4 Chapter 7 Chapter 8 Chapter 9 Chapter 10
- Graphs consist of nodes and (directed or undirected) edges. They are stored as an adjacency list or an adjacency matrix. Basic concepts: path, cycle, connectivity, bipartite graph.
- Shortest paths: Dijkstra requires nonnegative weights. Bellman–Ford allows negative weights (provided there is no negative cycle).
- Flows: a flow of r units from s to t is split over paths. The load of an edge is the sum of the flows of the paths that use it. Flow is conserved at every internal node.
- In routing games the edge costs are not fixed weights but load-dependent latency functions ℓₑ(x). This is what gives rise to congestion and Braess's paradox.
- Cycles matter elsewhere too: Top Trading Cycles (TTC) extracts the cycles of a pointer graph. A majority graph containing a cycle is the Condorcet paradox.
Self-check
Pigou network: one unit of flow, edge costs 1 and ℓ(x) = x. What are the equilibrium cost, the optimal cost and the PoA?
At equilibrium all the flow is on the x edge and the cost is 1. At the optimum the flow splits 1/2–1/2 and the cost is 1/2 + 1/4 = 3/4. PoA = 4/3.
Does Dijkstra work with negative edge weights?
In general, no. Bellman–Ford is used in that case.
Strategic reasoning and economics
Expected utility, best responses, welfare terms and regret.
Expected utility and mixed strategies
Terms expected utility; indifference principle; risk-neutral; certainty equivalent
When there is chance, a player compares lotteries by their expected utility Σ p(x)·u(x). Mixed equilibria are computed this way, and risk attitudes are modeled this way too.
Chapters Chapter 0 Chapter 1 Chapter 3 Chapter 5 Chapter 12
- The expected utility of a lottery is Σ p(x)·u(x). For a risk-neutral player, u(x) = x. Risk aversion means a concave u.
- The indifference principle: in a mixed Nash equilibrium, every action in a player's support yields the same expected payoff. Actions outside the support do not yield more.
- So each player's mixing probabilities are chosen to make the other player indifferent. A player's own payoffs determine the opponent's mixture.
- Most auction results assume that bidders are risk neutral (Chapter 5). Risk attitudes are the subject of Chapter 1.
Self-check
The column player plays Left with probability q. The row player's payoffs are: Top = 2q, Bottom = 1 − q. For which q is the row player willing to mix?
2q = 1 − q ⇒ q = 1/3.
In a mixed equilibrium, can an action outside the support yield strictly more than the actions in the support?
No. Then the player would shift probability to that action, and the actions in the support would not be best responses either.
Best responses and dominance
Terms best response; dominant strategy; dominated strategy; Nash equilibrium
The core skill of the course is this: given the others' choices, what is each player's best response, and does anyone want to deviate?
Chapters Chapter 0 Chapter 2 Chapter 3 Chapter 8 Chapter 12
- Best response: the action or actions that maximize a player's payoff while the others' actions are fixed.
- Strict dominance: sᵢ is strictly better than sᵢ′ in every case. A strictly dominated strategy is not played in any Nash equilibrium, not even with positive probability.
- Weak dominance: never worse, sometimes strictly better. Weakly dominated strategies can still appear in equilibria. The result of eliminating them can depend on the order of elimination.
- If every player best-responds to the others, the profile is a Nash equilibrium. Individual stability does not guarantee the social optimum (Prisoner's Dilemma).
Self-check
In the Prisoner's Dilemma, is (Cooperate, Cooperate) a Nash equilibrium?
No. Each player gains by defecting. The only equilibrium is (Defect, Defect), although both players prefer the outcome (Cooperate, Cooperate).
Can a strictly dominated strategy be in the support of a mixed equilibrium?
No. Shifting its probability to the dominating strategy would strictly increase the payoff.
Economics terms
Terms valuation; quasi-linear utility; revenue; surplus
Mechanism design and auctions use a small set of economics terms again and again. Confusing these terms, especially welfare and revenue, is a common mistake.
Chapters Chapter 4 Chapter 5 Chapter 6 Chapter 9
- Valuation vᵢ: the value of an outcome to agent i. Quasi-linear utility: uᵢ = vᵢ(x) − pᵢ, that is, value minus payment.
- Social welfare: Σᵢ vᵢ(x). Payments are transfers between the agents and the seller. They therefore cancel out in welfare.
- Revenue: Σᵢ pᵢ, the amount the seller collects. Welfare = the agents' total utility + revenue.
- Surplus (gains from trade) in a market is the difference between the buyer's value and the seller's cost in the trades that take place.
- An externality is the effect of one agent's action on the others' payoffs. The agent does not pay for this effect (congestion, network effects).
Self-check
A bidder with value 10 wins and pays 7. What are the utility, the revenue and the welfare?
Utility 3, revenue 7, welfare 10 (= 3 + 7).
Can a mechanism raise revenue while lowering welfare?
Yes. A high reserve price can leave the good unsold. Then welfare falls, while expected revenue may rise.
Regret and online learning
Terms regret; no-regret; multiplicative weights; multi-armed bandit
Learning in games measures an algorithm by its regret: how much worse it did, in hindsight, than the best single action.
Chapters Chapter 1 Chapter 9 Chapter 13
- External regret after T rounds: R_T = maxₐ Σₜ gₜ(a) − Σₜ gₜ(aₜ). If R_T / T → 0, the algorithm is no-regret.
- With n actions and payoffs in [0, 1], multiplicative weights (Hedge) gives R_T ≤ ln n/η + ηT. Choosing η = √(ln n / T) gives R_T ≤ 2√(T ln n).
- The follow-the-leader algorithm can be forced to switch constantly and suffers linear regret. Randomization fixes this problem.
- If all players use no-regret learning, the time average of the game converges to the coarse correlated equilibria. The PoA bounds for smooth games remain valid.
- In bandit problems only the reward of the chosen action is seen. UCB adds an exploration bonus of size √(2 ln t / Nₐ).
- The minimax regret (Savage) in Chapter 1 carries the same word but is a different criterion, used for a single decision.
Self-check
Hedge with n = 2 actions and T = 100 rounds: what is the bound on total and average regret?
In total 2√(100 · ln 2) ≈ 16.7. About 0.17 per round.
Why does an average regret going to 0 not mean that the learner played the best action in every round?
Regret compares not with the best action of each round but with the best fixed action in hindsight.
Programming
Every deck contains short Python programs and code traces.
Programming with Python
Every deck contains short Python programs and code traces: payoff tables, auctions, Shapley values, bandits, Q-learning. You need to be able to read, run and modify these programs.
Chapters Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14
- The core of the language: variables, loops, functions, recursion, lists, tuples, dictionaries and list comprehensions.
- Payoff matrices as nested lists (A[i][j]), strategy profiles with itertools.product, player orders with itertools.permutations.
- Randomness: random.random(), random.choice, and seeded generators for reproducible simulations (random.Random(3)).
- Math functions: math.exp, math.log, math.sqrt (multiplicative weights, UCB).
- Experiments: a simulation is repeated many times, the results are averaged and compared with the theoretical prediction.
Self-check
How many tuples does itertools.product(range(2), repeat=3) produce?
2³ = 8. Each is a pure profile of a game with 3 players and 2 actions.
How many orders does itertools.permutations(range(3)) produce?
3! = 6. These orders are also used in the Shapley value code in Chapter 10.
No topic matches the search or the filters.
Prerequisites chapter by chapter
The topics each deck builds on (Python is used in every chapter).
© Sercan Külcü · Algorithmic Game Theory