Mixed-strategy equilibrium probabilities of a 2 x 2 game from the indifference conditions

In a mixed equilibrium of a game in which each player has two strategies, each player randomises over both, which it is willing to do only if both give it the same expected payoff, so each player's mixing probability is set by the other player's payoffs. Equating the row player's expected payoffs from its two strategies, q u_11 + (1 minus q) u_12 = q u_21 + (1 minus q) u_22, gives the probability q_star that the column player chooses its first strategy, and the column player's indifference gives the probability p_star that the row player chooses its first strategy. Slantchev states this condition for 2 x 2 games and solves it for the equilibrium probabilities; the closed forms are that equation solved (derived). The pair is a mixed equilibrium when both values are above 0 and below 1, which is what Proposition 1 of Slantchev requires when each player mixes over two strategies (derived); when q_star is not, the row player has a strictly dominant strategy (derived, for games without the ties of HE-AS-NASH-005), and likewise p_star for the column player. The algebra is that of the decision curve threshold HE-FM-DCA-004, p_t = L / (G + L), and of the blend weight in HE-FM-EXD-002, with a_1 and a_2 in place of G and L, but HE-VR-DCA-013 to HE-VR-DCA-015 define p_t as a patient's risk and G and L as a patient's benefit and harm, while here the probability is the other player's equilibrium choice, set by the payoffs of the player it leaves indifferent and an equilibrium only as a pair with p_star. When a_1 and a_2 are both negative, as in the angioplasty game, listing the row player's strategies in the other order makes both positive and leaves q_star unchanged (derived). Each player's expected payoff at the equilibrium is HE-FM-CHN-001 applied to its payoffs against the other's mix.

Signature

a_1 = u_11 - u_21; a_2 = u_22 - u_12; q_star = a_2 / (a_1 + a_2); b_1 = v_11 - v_12; b_2 = v_22 - v_21; p_star = b_2 / (b_1 + b_2); interior = (q_star > 0) and (q_star < 1) and (p_star > 0) and (p_star < 1)
Inputs
InputsDefinitionUnit
u_11Payoff to the row player when it plays its first strategy and the column player plays its firstthe row player's payoff unit, such as GBP million a year
u_21Payoff to the row player when it plays its second strategy and the column player plays its firstthe row player's payoff unit
u_22Payoff to the row player when it plays its second strategy and the column player plays its secondthe row player's payoff unit
u_12Payoff to the row player when it plays its first strategy and the column player plays its secondthe row player's payoff unit
v_11Payoff to the column player when the row player plays its first strategy and the column player plays its firstthe column player's payoff unit, such as GBP million a year
v_12Payoff to the column player when the row player plays its first strategy and the column player plays its secondthe column player's payoff unit
v_22Payoff to the column player when the row player plays its second strategy and the column player plays its secondthe column player's payoff unit
v_21Payoff to the column player when the row player plays its second strategy and the column player plays its firstthe column player's payoff unit
Output
a_1Row player's payoff from its first strategy less its payoff from its second when the column player plays its first, u_11 minus u_21the row player's payoff unit
a_2Row player's payoff from its second strategy less its payoff from its first when the column player plays its second, u_22 minus u_12the row player's payoff unit
q_starProbability that the column player chooses its first strategy in the mixed equilibrium, the value that leaves the row player indifferent, read as a probability only when interior is 1 (HE-ER-NASH-005)probability
b_1Column player's payoff from its first strategy less its payoff from its second when the row player plays its first, v_11 minus v_12the column player's payoff unit
b_2Column player's payoff from its second strategy less its payoff from its first when the row player plays its second, v_22 minus v_21the column player's payoff unit
p_starProbability that the row player chooses its first strategy in the mixed equilibrium, the value that leaves the column player indifferent, read as a probability only when interior is 1 (HE-ER-NASH-005)probability
interior1 when q_star and p_star are both above 0 and below 1, so that both players mix in equilibrium, otherwise 0indicator (1 or 0)

Function

Nash equilibria of a two-player game with two strategies each

Maps the payoffs of two players, each with two pure strategies, over the four strategy pairs to the game's Nash equilibria, the pairs in which each player's strategy is a best reply to the other's, u_i(s_i*, s_-i*) >= u_i(s_i, s_-i*) for every strategy s_i of every player i, as in the article's display. The general condition over any finite strategy sets has no calculator form. For a 2 x 2 game HE-FM-NASH-001 tests each of the four cells as a pure-strategy equilibrium and classifies it as strict or weak, HE-FM-NASH-002 gives the mixed equilibrium in which each player randomises so as to leave the other indifferent, and HE-CF-NASH-001 lists every equilibrium of a game without payoff ties and values the outcome of mixed play. Each player's expected payoff at the mixed equilibrium and the expected value of an outcome measure such as total surplus are probability-weighted sums, the form of HE-FM-CHN-001, and the probability of each cell under independent mixing is the product of HE-FM-CHN-002, so neither is restated. Dominance between interventions in cost-effectiveness analysis (HE-FM-DOM-001) compares the incremental cost and effect of options for one decision maker and is a different test. The Nash bargaining solution (HE-FN-BARG-001, with the negotiated price of HE-FM-BARG-001) divides a surplus between parties who can make a binding agreement, Rubinstein's first proposer's share (HE-FM-BARG-003) comes from the perfect equilibrium of a sequential alternating-offers game, and the voluntary vaccination coverage of HE-FM-VEXT-003 is the equilibrium of a population game solved through an infection risk; all are separate records. Notation follows the Nash Equilibrium article, with u_jk and v_jk for the row and column players' payoffs when the row player chooses its strategy j and the column player its strategy k.

Computational function

  • Computational function for every equilibrium of a 2 x 2 game with the outcome probabilities and expected welfare of mixed play

    Lists every equilibrium of a two-player game with two strategies each and values the outcome of mixed play, the procedure Slantchev sets out for finding all Nash equilibria, checking first for pure-strategy solutions and then for mixed ones. The pure cells come from HE-FM-NASH-001 and the completely mixed equilibrium from HE-FM-NASH-002. Under independent mixing each cell's probability is the product of the two players' probabilities, the pathway probability of HE-FM-CHN-002, and the expected payoffs and the expected value of an outcome measure W over the four cells are probability-weighted sums, the form of HE-FM-CHN-001. At the mixed equilibrium each player's expected payoff can be read from its first strategy alone, because both of its strategies pay the same (derived from the indifference condition). The probabilities, payoffs and E_W apply only when interior is 1.

    Inputs and outputs: u_11, u_12, u_21, u_22 are the row player's payoffs and v_11, v_12, v_21, v_22 the column player's, indexed by the row player's strategy and then the column player's, and W_11, W_12, W_21, W_22 are the value of each cell to the health system (GBP million a year in the article's example). The chain returns the pure indicators NE_11 to NE_22, the mixed probabilities q_star and p_star with the gaps a_1, a_2, b_1, b_2, the indicator interior, the cell probabilities P_11 to P_22 of mixed play, the expected payoffs U_A and U_B and the expected value E_W. The R and Python code also return the number of equilibria found, pure cells plus the completely mixed one.

    Assumption: As in HE-AS-NASH-001 to HE-AS-NASH-006. The count is complete only for games without the payoff ties of HE-AS-NASH-005; with a tie the code reports the pure cells and no mixed equilibrium, and a continuum of partly mixed equilibria can exist besides them (HE-ER-NASH-006). W is any value attached to the cells, such as the players' surpluses plus the patients' net health gain.

    Worked example (angioplasty game): With the payoffs of HE-EX-NASH-001 and W_11 = 7; W_12 = 14; W_21 = 14; W_22 = 0 (step 4 of the article) the chain gives NE_12 = 1; NE_21 = 1; q_star = 0.6667; p_star = 0.6667; interior = 1; P_11 = 0.4444; P_12 = 0.2222; P_21 = 0.2222; P_22 = 0.1111; U_A = 0; U_B = 0; E_W = 9.3333. Both hospitals invest four times in nine and neither one time in nine, and E_W is 84/9 against 14 at either pure equilibrium, as in the article. The code counts 3 equilibria.

    Worked example (battle of the sexes): With the payoffs of HE-EX-NASH-006 and W equal to the sum of the two payoffs in each cell, W_11 = 3; W_12 = 0; W_21 = 0; W_22 = 3, the chain gives NE_11 = 1; NE_22 = 1; q_star = 0.3333; p_star = 0.6667; interior = 1; P_11 = 0.2222; P_12 = 0.4444; P_21 = 0.1111; P_22 = 0.2222; U_A = 0.6667; U_B = 0.6667; E_W = 1.3333. The cell probabilities and each player's expected payoff of two thirds are those Slantchev gives, and the players meet with probability 4/9.

    Excel: With the cells of HE-IM-NASH-001 and HE-IM-NASH-002 and the cell values in WelfareUpLeft, WelfareUpRight, WelfareDownLeft and WelfareDownRight, enter =MixProbAUp*MixProbBLeft in OutcomeUpLeft, =MixProbAUp*(1-MixProbBLeft) in OutcomeUpRight, =(1-MixProbAUp)*MixProbBLeft in OutcomeDownLeft, =(1-MixProbAUp)*(1-MixProbBLeft) in OutcomeDownRight, =MixProbBLeft*PayoffAUpLeft+(1-MixProbBLeft)*PayoffAUpRight in ExpectedPayoffA, =MixProbAUp*PayoffBUpLeft+(1-MixProbAUp)*PayoffBDownLeft in ExpectedPayoffB, =OutcomeUpLeft*WelfareUpLeft+OutcomeUpRight*WelfareUpRight+OutcomeDownLeft*WelfareDownLeft+OutcomeDownRight*WelfareDownRight in ExpectedWelfare, and =EquilibriumUpLeft+EquilibriumUpRight+EquilibriumDownLeft+EquilibriumDownRight+IFERROR(InteriorMixed,FALSE) in CountEquilibria, where Excel adds TRUE as 1.

    R: nash22 <- function(u, v, w) { pure <- outer(1:2, 1:2, Vectorize(function(j, k) u[j, k] >= u[3-j, k] && v[j, k] >= v[j, 3-k])); a1 <- u[1, 1]-u[2, 1]; a2 <- u[2, 2]-u[1, 2]; b1 <- v[1, 1]-v[1, 2]; b2 <- v[2, 2]-v[2, 1]; q <- if (a1+a2 == 0) NA else a2/(a1+a2); p <- if (b1+b2 == 0) NA else b2/(b1+b2); mixed <- !is.na(p) && !is.na(q) && p > 0 && p < 1 && q > 0 && q < 1; P <- if (mixed) outer(c(p, 1-p), c(q, 1-q)) else NA; list(pure = pure, p = p, q = q, mixed = mixed, P = P, EW = if (mixed) sum(P*w) else NA, count = sum(pure)+mixed) } With u <- matrix(c(-2, 0, 4, 0), 2); v <- matrix(c(-2, 4, 0, 0), 2); w <- matrix(c(7, 14, 14, 0), 2), nash22(u, v, w) returns pure cells (1, 2) and (2, 1), p and q 0.6667, mixed TRUE, EW 9.3333 and count 3. For the break-even game (u[1, 1] <- 0; v[1, 1] <- 0) it returns three pure cells, q 1, mixed FALSE, EW NA and count 3, and for a game with a gap sum of zero, such as u <- matrix(c(4, 0, 4, 0), 2), q is NA and mixed FALSE without an error.

    Python: def nash22(u, v, w): pure = [[u[j][k] >= u[1-j][k] and v[j][k] >= v[j][1-k] for k in (0, 1)] for j in (0, 1)]; a1, a2 = u[0][0]-u[1][0], u[1][1]-u[0][1]; b1, b2 = v[0][0]-v[0][1], v[1][1]-v[1][0]; q = a2/(a1+a2) if a1+a2 != 0 else None; p = b2/(b1+b2) if b1+b2 != 0 else None; mixed = p is not None and q is not None and 0 < p < 1 and 0 < q < 1; P = [[(p if j == 0 else 1-p)*(q if k == 0 else 1-q) for k in (0, 1)] for j in (0, 1)] if mixed else None; EW = sum(P[j][k]*w[j][k] for j in (0, 1) for k in (0, 1)) if mixed else None; return dict(pure=pure, p=p, q=q, mixed=mixed, P=P, EW=EW, count=sum(map(sum, pure))+int(mixed)) nash22([[2, 0], [0, 1]], [[1, 0], [0, 2]], [[3, 0], [0, 3]]) returns pure [[True, False], [False, True]], p 0.6667, q 0.3333, mixed True, P [[0.2222, 0.4444], [0.1111, 0.2222]], EW 1.3333 and count 3 (to floating point). With the gap sum of zero of the R example q is None and mixed False.

    Test (angioplasty game): ExpectedWelfare is compared with 84/9, the article's E[W], at a tolerance of 0.0005. Expected result TRUE. FALSE shows the cells with exactly one investor counted once in place of twice, which gives 56/9 (6.2222), and doubling the ExpectedWelfare cell (18.6667) or halving it (4.6667) also gives FALSE. Excel check =ABS(ExpectedWelfare-84/9)<0.0005

    Test (battle of the sexes): CountEquilibria is 3, the four outcome probabilities add to 1 and OutcomeUpRight equals 4/9, Slantchev's probability that the row player plays its first strategy and the column player its second. Expected result TRUE. FALSE shows a count that leaves out the mixed equilibrium (2), and doubling OutcomeUpRight (0.8889) or halving it (0.2222) also gives FALSE. Excel check =AND(CountEquilibria=3,ABS(OutcomeUpLeft+OutcomeUpRight+OutcomeDownLeft+OutcomeDownRight-1)<1E-9,ABS(OutcomeUpRight-4/9)<0.0005)

    Common error (Equal weights on the four cells): Averaging the cell values as if each outcome were equally likely gives (7 + 14 + 14 + 0) / 4 = 8.75 for the angioplasty game in place of 9.3333 (computed here), and reports a value that no equilibrium produces.

    Source: Slantchev BL. Game theory: dominance, Nash equilibrium, symmetry. Lecture notes, Department of Political Science, University of California, San Diego; 23 May 2008 (full text read). Section 2.4.2 (Another Simple Game), the algorithm for finding all Nash equilibria by checking for solutions in pure strategies and then in mixed strategies; section 2.3.1 (Battle of the Sexes), the outcome probabilities as products of the equilibrium probabilities and each player's expected payoff of 2/3; section 2.4, Remark 4, a player's payoff to a mixed profile as the probability-weighted average of its payoffs to its pure strategies.

    NE_11 = (u_11 >= u_21) and (v_11 >= v_12); NE_12 = (u_12 >= u_22) and (v_12 >= v_11); NE_21 = (u_21 >= u_11) and (v_21 >= v_22); NE_22 = (u_22 >= u_12) and (v_22 >= v_21); a_1 = u_11 - u_21; a_2 = u_22 - u_12; q_star = a_2 / (a_1 + a_2); b_1 = v_11 - v_12; b_2 = v_22 - v_21; p_star = b_2 / (b_1 + b_2); interior = (q_star > 0) and (q_star < 1) and (p_star > 0) and (p_star < 1); P_11 = p_star * q_star; P_12 = p_star * (1 - q_star); P_21 = (1 - p_star) * q_star; P_22 = (1 - p_star) * (1 - q_star); U_A = q_star * u_11 + (1 - q_star) * u_12; U_B = p_star * v_11 + (1 - p_star) * v_21; E_W = P_11 * W_11 + P_12 * W_12 + P_21 * W_21 + P_22 * W_22

Try this function

Implementations

  • Excel

    Excel mixed equilibrium probabilities of a 2 x 2 game

    With the payoffs in the cells named in HE-IM-NASH-001, the formulas return GapALeft (a_1), GapARight (a_2), MixProbBLeft (q_star), GapBUp (b_1), GapBDown (b_2), MixProbAUp (p_star) and InteriorMixed in that order. The IF returns #N/A in place of #DIV/0! when a gap sum is zero, and InteriorMixed then also returns #N/A, since AND passes an error on.

    =PayoffAUpLeft-PayoffADownLeft; =PayoffADownRight-PayoffAUpRight; =IF(GapALeft+GapARight=0,NA(),GapARight/(GapALeft+GapARight)); =PayoffBUpLeft-PayoffBUpRight; =PayoffBDownRight-PayoffBDownLeft; =IF(GapBUp+GapBDown=0,NA(),GapBDown/(GapBUp+GapBDown)); =AND(MixProbBLeft>0,MixProbBLeft<1,MixProbAUp>0,MixProbAUp<1)

Assumptions

  • Expected payoffs and independent mixing in the 2 x 2 mixed equilibrium

    Nash defines mixed strategies as probability distributions over the pure strategies, with payoffs measured as expectations, so each payoff is a value whose expectation the player maximises, not only a ranking. The two players randomise independently of each other, as when each hospital decides without knowing the other's choice.

  • No payoff ties against a fixed choice of the other player

    The formula assumes a_1, a_2, b_1 and b_2 are all non-zero, so that no player does equally well with both strategies against one of the other's strategies. With such a tie, as in the break-even angioplasty game of HE-EX-NASH-002 where a_1 is 0, equilibria can form a continuum that the formula does not describe (computed here), and a_1 + a_2 of zero, which occurs when one strategy pays the same amount more against both columns, leaves q_star undefined.

  • Each player mixes over both of its strategies

    The formula gives the completely mixed equilibrium, in which both strategies of each player are used. In a 2 x 2 game any mixture of two strategies uses both, as Slantchev notes for the simplified card game, so the only other equilibria are the pure ones of HE-FM-NASH-001 and, with ties, the partly mixed ones of HE-AS-NASH-005.

Worked examples

  • Mixed equilibrium of the angioplasty investment game

    Step 2 of the article. Hospital A is indifferent when -2q + 4(1 minus q) equals 0, so hospital B invests with probability 4/6, and by symmetry A invests with the same probability. Both values are above 0 and below 1, so the game has a completely mixed equilibrium besides its two pure ones (HE-EX-NASH-001).

    u_11 = -2; u_12 = 4; u_21 = 0; u_22 = 0; v_11 = -2; v_12 = 0; v_21 = 4; v_22 = 0; a_1 = -2; a_2 = -4; q_star = 0.6667; b_1 = -2; b_2 = -4; p_star = 0.6667; interior = 1
  • Mixed equilibrium of the battle of the sexes in which each probability comes from the other's payoffs

    Slantchev's battle of the sexes (Figure 20). The row player is indifferent when 2q equals 1 minus q, so the column player chooses its first strategy with probability one third, and the column player is indifferent when p equals 2(1 minus p), so the row player chooses its first strategy with probability two thirds, Slantchev's equilibrium. Each player puts the higher probability on the strategy it prefers.

    u_11 = 2; u_12 = 0; u_21 = 0; u_22 = 1; v_11 = 1; v_12 = 0; v_21 = 0; v_22 = 2; a_1 = 2; a_2 = 1; q_star = 0.3333; b_1 = 1; b_2 = 2; p_star = 0.6667; interior = 1
  • Mixed equilibrium of matching pennies

    Slantchev's matching pennies, the game of HE-EX-NASH-003 with no pure equilibrium. Each player mixes with probability one half, the unique equilibrium Slantchev gives.

    u_11 = 1; u_12 = -1; u_21 = -1; u_22 = 1; v_11 = -1; v_12 = 1; v_21 = 1; v_22 = -1; a_1 = 2; a_2 = 2; q_star = 0.5; b_1 = -2; b_2 = -2; p_star = 0.5; interior = 1
  • Angioplasty game in which two services both profit has no mixed equilibrium

    Illustrative variant of the article's game in which each hospital earns 1 when both invest. Investing then pays more whatever the other does, the formula returns 1.3333 for each player, which is not a probability, and the only equilibrium is the pure cell (Invest, Invest), which HE-FM-NASH-001 finds.

    u_11 = 1; u_12 = 4; u_21 = 0; u_22 = 0; v_11 = 1; v_12 = 0; v_21 = 4; v_22 = 0; a_1 = 1; a_2 = -4; q_star = 1.3333; b_1 = 1; b_2 = -4; p_star = 1.3333; interior = 0

Common errors

  • Setting a player's mixing probability from its own payoffs

    The row player's probability keeps the column player indifferent, so it comes from v_jk. In the battle of the sexes of HE-EX-NASH-006, solving each player's own indifference for its own probability gives the row player 1/3 and the column player 2/3 in place of 2/3 and 1/3. At a column probability of two thirds the row player earns 1.3333 from its first strategy and 0.3333 from its second (computed here), so it would switch and the pair is not an equilibrium. In a symmetric game such as the angioplasty game the two values coincide and the error goes unseen.

  • Reporting a value outside the unit interval as a mixing probability

    The formula returns a number for any game whose gap sums are not zero, and when investing is dominant it gives 1.3333 (HE-EX-NASH-008), which is not a probability. The game then has no completely mixed equilibrium and its single equilibrium is the pure cell (Invest, Invest), so q_star and p_star are read only when interior is 1.

  • Missing a continuum of equilibria when payoffs tie

    In the break-even angioplasty game of HE-EX-NASH-002, a_1 is 0, the formula gives q_star = 1 and interior = 0, and it would be easy to conclude that only pure equilibria exist. With hospital B investing for sure, hospital A earns 0 whatever it does and investing stays a best reply for B against any mix by A, so every probability with which A invests is part of an equilibrium (computed here).

Sources

  • Slantchev on indifference in mixed equilibria of 2 x 2 games

    Slantchev BL. Game theory: dominance, Nash equilibrium, symmetry. Lecture notes, Department of Political Science, University of California, San Diego; 23 May 2008 (full text read). Section 2.3 (Mixed Strategy Nash Equilibrium), matching pennies, each player's expected payoffs from its pure strategies against the other's mix and the unique equilibrium with both probabilities one half; section 2.3.1 (Battle of the Sexes), the row player's payoffs 2q and 1 minus q equal at q = 1/3 and the column player's equal at p = 2/3, the mixed equilibrium (2/3, 1/3) for the row player and (1/3, 2/3) for the column player, and outcome probabilities found by multiplying the two players' equilibrium probabilities. Section 2.4 (Computing Nash Equilibria), Proposition 1, a mixed profile is an equilibrium only if each player's pure strategies in its support give the same payoff and no other strategy gives more, and the statement that a randomising player must be indifferent among the pure strategies in its support. Section 2.4.1 (Myerson's Card Game), the simplified 2 x 2 game, in which any mixture uses both strategies and the equilibrium probabilities are found by equating the payoffs, and the statement that each player's mixed strategy makes the other indifferent.

    View source →

  • Nash on mixed strategies with payoffs as expectations

    Nash JF. Equilibrium points in n-person games. Proc Natl Acad Sci USA. 1950;36(1):48-49 (full text read from the original page scan). Mixed strategies are probability distributions over the pure strategies and the payoff functions are the expectations of the players; Nash proves, with Kakutani's fixed point theorem, that every such game has an equilibrium point.

    View source →

Canonical Identity

Mixed-strategy equilibrium probabilities of a 2 x 2 game from the indifference conditions | HealthEconomics.wiki