Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 37 ยท 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.

Everything in this chapter rests on one simple question: given what I think you will do, what should I do? The answer is called a best response. It is the building block of Nash equilibrium, and learning it well makes the equilibrium concept feel almost obvious.

You already used the idea without naming it: the loops in What Is Game Theory? printed "if the rival picks X, my best reply is Y", and the vector A @ y from Payoff Matrices in NumPy lists the payoff of each of your actions against a belief y. In this lesson we define best responses carefully, handle ties, and use the "underline the best payoffs" method that makes equilibria visible at a glance.

Definition

Fix the strategies s_{-i} of all other players. Player i's best response to s_{-i} is a strategy that gives i the highest payoff against it:

BR_i(s_{-i}) = argmax over s_i of u_i(s_i, s_{-i}).

Three details deserve attention.

  • It is a set, not always a single strategy. If two actions tie for the highest payoff, both are best responses. That is why we call it a best-response correspondence rather than a function.
  • It depends on the others' strategy only. What you do yourself is the variable you are choosing.
  • If the other player's strategy is uncertain, you play a best response to your belief, a probability distribution y over their actions. Then you maximize the expected payoff (A @ y)[i].
flowchart LR
    B["Belief about the other player<br/>(a strategy y)"] --> E["Compute my payoff<br/>for each of my actions"]
    E --> M["Pick the action(s)<br/>with the highest payoff"]
    M --> R["Best response"]

A best response is a decision problem: the other player's strategy is treated as given.

Pure best responses in code

Let us write helpers that return the best-response set for each side. For the row player facing column j, we look down column j of A. For the column player facing row i, we look along row i of B. Because of ties, we return every index that attains the maximum (with a small tolerance for floating-point numbers).

Python Best-response sets for each opponent action

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice the tie: against Bob's column R, both M and B give Ann 4, so both are best responses and the code reports both. Ties are common when payoffs are small whole numbers; do not assume a unique answer.

The marking method

For a bimatrix game, a convenient pencil-and-paper method is to mark each player's best-response payoffs inside the table. In every column, mark Ann's highest payoff. In every row, mark Bob's highest payoff. A cell where both payoffs are marked is a cell in which each player is best-responding to the other, and that cell is a Nash equilibrium (the next lesson, Pure Nash Equilibrium, studies this in depth).

The code below prints the table with * after each marked payoff.

Python Mark the best responses in the table

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The table makes the structure visible: each player's best-response payoffs carry an asterisk, and the cells with two asterisks, (T, L), (M, C) and (B, R), are the ones where both players best-respond to each other. Note that (M, R) is not among them: Ann is best-responding there (she ties at 4), but Bob would rather switch to C.

Best responses to a belief

When you are unsure what the other player will do, describe your belief as a probability vector y over their actions. For each of your pure actions, its expected payoff is (A @ y)[i], and your best response is the action (or actions) with the highest value. A remarkable fact: a mixed strategy is a best response only if every pure strategy it uses is itself a best response. A mixture is an average, and an average cannot beat its largest component. We use this "equal payoff" fact in the chapter on mixed strategies.

Python Best response to a belief

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

As Bob's chance of playing L rises from 0 to 1, Ann's best response switches from B to T. At exactly P(L) = 0.5 both actions pay 1.5 and she is indifferent. Such a switching point is where mixed equilibria hide: the indifference point is where mixing becomes optimal.

Best-response functions for continuous actions

When actions are numbers, such as prices or quantities, the best response is a function and you can often compute it with calculus. As a taste, suppose two players each choose a number a or b in [0, 10], and player 1's payoff is a * (10 - a - b) (more on this setup in Cournot Duopoly). Then the best response to b solves a one-line optimization.

Python A best-response function by grid search

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The grid search reproduces the formula (10 - b) / 2: when the rival raises their choice, your best choice falls. That downward-sloping relationship is called strategic substitutes. When best responses slope upward (as in a price war where raising your price makes the rival raise theirs), they are strategic complements.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A best response to the other players' strategies is...

    A best response solves a decision problem: hold the others' strategies fixed and pick what pays the most.
  2. 2. Why is a best response a 'correspondence' and not a function?

    When two or more actions tie, all of them are best responses, so the answer is a set.
  3. 3. In the marking method, what does a cell with both payoffs marked mean?

    Each marked payoff is a best response to the other's action, so a doubly marked cell is a mutual best response.
  4. 4. If Ann's payoff matrix is [[3, 0], [1, 2]] and Bob plays L with probability 0.25, what is Ann's best response?

    T gives 0.253 + 0.750 = 0.75 and B gives 0.251 + 0.752 = 1.75, so B is better.

Summary

  • A best response maximizes your payoff given the others' strategies (or beliefs).
  • It can be a set because of ties; with mixed beliefs use the expected payoff vector A @ y.
  • Marking each player's best-response payoffs in the table reveals cells where both players best-respond.
  • A mixed strategy can be a best response only if every pure action it uses is also a best response.
  • With continuous actions the best response is a function; downward sloping means strategic substitutes.

Next: Pure Nash Equilibrium