Game Theory Tutorial
Learn Game Theory step by step: 37 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Game Theory? Meet game theory, the math of strategic decisions. Learn what a game is, who the players are, why interdependence matters, and run your first game in Python.
- Rational Choice and Utility Learn how game theory turns preferences into utility numbers, what rational means, how expected utility handles risk, and why risk attitude changes choices.
- Payoff Matrices in NumPy Represent two-player games as pair of NumPy payoff matrices, look up outcomes, compute expected payoffs with matrix products, and build a reusable Game class.
- A First Game: The Beauty Contest Play the classic guess two thirds of the average game, learn level-k thinking and iterated reasoning, and simulate how guesses shrink toward the equilibrium.
Games and Strategies
- Normal-Form Games and Strategies Define normal-form games formally with players, strategy sets and payoff functions, enumerate strategy profiles with itertools, and handle games with three or more players.
- Dominant Strategies Learn strict and weak dominance, dominant strategy equilibrium and the prisoner's dilemma, and write Python functions that find dominated and dominant strategies.
- Iterated Elimination of Dominated Strategies Solve games by repeatedly removing strictly dominated strategies, learn why order does not matter for strict dominance, and code IESDS including mixed-strategy dominance.
- Zero-Sum and Constant-Sum Games Understand zero-sum and constant-sum games, compute security levels with maximin and minimax, find saddle points in a payoff matrix, and see why some games have none.
- Classic 2x2 Games Meet the classic two-by-two games: prisoner's dilemma, stag hunt, chicken, battle of the sexes and matching pennies. Learn their payoff patterns and code a classifier.
Nash Equilibrium
- Best Responses Learn what a best response is, how best-response correspondences work with ties, how to mark best responses in a payoff matrix, and code them for pure and mixed beliefs.
- Pure Nash Equilibrium Understand Nash equilibrium as a profile of mutual best responses, check it by testing unilateral deviations, and write Python code that finds pure equilibria in any normal-form game.
- Pareto Efficiency and Social Dilemmas Learn Pareto efficiency and social welfare, measure the price of anarchy, and simulate the public goods game and tragedy of the commons to see why equilibria can be inefficient.
- Multiple Equilibria and Selection Learn what to do when a game has several Nash equilibria: focal points, payoff dominance, risk dominance and basins of attraction, with Python code for each criterion.
- Cournot Duopoly: Nash Equilibrium with Continuous Choices Solve the Cournot quantity-competition game with best-response functions, sympy and iteration; compare the equilibrium with monopoly and collusion, and extend to n firms.
Mixed Strategies
- Mixed Strategies Learn why players randomize, what a mixed strategy is, how to compute expected payoffs, and how unpredictability protects you in matching pennies, penalty kicks and rock-paper-scissors.
- The Indifference Principle Find mixed-strategy Nash equilibria of 2x2 games by making the opponent indifferent. Derive the formulas with sympy, check them numerically, and apply them to chicken, battle of the sexes and penalties.
- Mixed Equilibria in Larger Games: Support Enumeration Solve any bimatrix game by support enumeration: guess which actions are played, solve the indifference equations with NumPy linear algebra, and keep the profiles with no profitable deviation.
- The Minimax Theorem and Linear Programming Learn von Neumann's minimax theorem and solve any zero-sum matrix game with scipy linprog: build the LP for the row and column player, check that the values agree, and try a Colonel Blotto game.
Sequential Games
- Extensive-Form Games and Game Trees Model games where players move in turn with game trees: nodes, actions, payoffs, perfect and imperfect information, and how a tree converts to a payoff matrix.
- Backward Induction Solve sequential games from the leaves up. Write a backward induction solver in Python, apply it to the entry game, the centipede game and a take-away game.
- Subgame-Perfect Equilibrium Learn subgames and subgame-perfect equilibrium (SPE), why it refines Nash equilibrium, and how to find SPE in the ultimatum game with runnable Python code.
- Stackelberg Competition and Commitment Solve the Stackelberg leader-follower game with backward induction, compare it with Cournot, and see how commitment and entry deterrence create a first-mover advantage.
Repeated and Evolutionary Games
- The Repeated Prisoner's Dilemma See how repetition can sustain cooperation in the prisoner's dilemma: finite versus infinite horizons, discounting, tit-for-tat, grim trigger, and a Python simulator.
- The Folk Theorem and Repeated-Game Equilibria Understand the folk theorem for repeated games: feasible payoffs, minmax values, average discounted payoffs and why almost any outcome can be sustained. Includes Python checks.
- Evolutionary Stable Strategies Learn evolutionary game theory and ESS: Maynard Smith's conditions, the Hawk-Dove game, mixed ESS, and a Python checker for invasion by mutants.
- Replicator Dynamics Simulate how strategy shares in a population change over time with the replicator equation. Python examples: Hawk-Dove convergence, rock-paper-scissors cycles, coordination games.
Mechanism Design and Auctions
- Auction Formats and Bidding Strategies Learn the four basic auction formats, how private values and Bayesian games work, and compute the first-price equilibrium bid with a Python Monte Carlo simulation.
- The Vickrey Second-Price Auction Prove and test that bidding your true value is a dominant strategy in a second-price auction, with Python checks, edge cases, collusion issues and sponsored-search use.
- Revenue Equivalence and Optimal Auctions Why first-price, second-price and all-pay auctions raise the same revenue, and how a reserve price from Myerson's optimal auction theory raises it. Python simulations included.
- Mechanism Design and the VCG Mechanism Design rules so that selfish players reveal the truth: incentive compatibility, the revelation principle and the VCG mechanism, with a brute-force Python implementation.
Applications
- Cooperative Games and the Shapley Value Split the gains of cooperation fairly: coalitions, characteristic functions, the core and the Shapley value, with Python code and a cost-sharing example.
- Stable Matching and the Gale-Shapley Algorithm Match two sides with preferences using the Gale-Shapley deferred acceptance algorithm. Learn stability, proposer-optimality, and real markets such as residency matching.
- Bargaining: The Nash Solution and Rubinstein Offers Divide a surplus by negotiation: the Nash bargaining solution, its axioms, disagreement points, and Rubinstein's alternating-offers model solved by backward induction in Python.
- Voting, Condorcet Paradox and Arrow's Theorem Compare plurality, runoff, Borda and Condorcet voting in Python, see why rankings can cycle, and learn what Arrow's impossibility theorem and Gibbard-Satterthwaite say.
Projects and Practice
- Project: An Axelrod Tournament Build a round-robin prisoner's dilemma tournament in Python with eight strategies, add noise, run an evolutionary population, and learn what makes a strategy succeed.
- Project: An Auction Simulator Build a simulator that compares first-price, second-price and all-pay auctions with reserves, learn bidding strategies by best-response iteration, and measure revenue and efficiency.
- Practice Problems: Sequential, Repeated and Auction Games Ten worked game theory exercises on backward induction, subgame perfection, repeated games, evolutionary stability, auctions and matching, with Python checks for each answer.