HOME

Matrix Games

Table of Contents

Now we’ll discuss some game theory. This is a broad topic and we’ll only cover a small portion of it that has a close connection to linear programming. We’ll talk about a particular kind of game we’ll call a matrix game. These are two player games that proceed in a series of identical rounds, in each round the two players make a move and depending on the moves either a tie is declared or one player is declared the loser and has to pay the winner a certain amount (that can depend on the moves chosen). To analyze these games mathematically, we can ignore the nature of the moves: all we need is to know for each pair of moves for the two players, who wins and how much. This is recorded in the payoff matrix, a matrix \(A = (a_{ij})\) where \(a_{ij}\) records the payoff in a round where player one makes move #\(i\) and player two makes move #\(j\); this number \(a_{ij}\) will be:

If we think of winning a negative amount as meaning you actually lost and you pay the absolute value of that negative amount to the other player, then we can just think of \(a_{ij}\) as the winnings for player one in around where player one makes move #\(i\) and player two makes move #\(j\).

Take rock, paper, scissors for example. In each round each player picks one of those 3 objects and the rules are that rock beats scissors, scissors beats paper and, somewhat counter-intuitively, paper beats rock. Say that we just want to keep track of how many more times player one won than player two. We can say the winner of each round gets a dollar from the loser, then the net winnings will be simply \(\# wins - \# loses\). The payoff matrix is:

  rock paper scissors
rock 0 -1 1
paper 1 0 -1
scissors -1 1 0

These matrix games are examples of what are called zero-sum games in game theory: if you add the winnings (with loses counting as “negative winnings”) of all the players the net result is zero! Indeed, for our games, in every round the amount one player wins is exactly the amount the other player loses!

Notice that we’ve made the choice to record the payoff for player one, i.e., we decided positive numbers mean player one wins and negative numbers mean player two wins. We’ll describe this by saying the payoff matrix is “from the point of view of player one”. What’s the payoff matrix “from the point of view of player two”? Well, its \((i,j)\)-th entry should be the payoff for player two when player two makes move #\(i\) and player one makes move #\(j\); that’s \(-a_{ji}\), so the payoff matrix for player two is \(-A^{\top}\).

When the rules of the game treat both players exactly the same, the game is called symmetric, which may be a little confusing because it corresponds to the payoff matrix being anti-symmetric, which simply means \(A = -A^{\top}\), i.e., the payoff matrix from the point of view of player two is the same as the one from the point of view of player one. Rock, paper, scissors is a symmetric game. Below we’ll see some examples of games that aren’t symmetric.

Mixed strategies

We want to figure out how to maximize your winnings when playing a matrix game (or at least minimize your losses if the game is stacked against you!). That sounds like a maximization problem, but what are we maximizing over? We want to pick the best strategy so we’ll need a mathematical model of a playing strategy.

One strategy you could follow is to always pick the same move in every round. We’ll call these pure strategies and there is one for every choice of move. These are typically poor strategies: for example, if you use the strategy always play rock in rock, paper, scissors, your opponent will soon catch on and start using the paper 4ever strategy.

You can do much better by mixing it up unpredictably! In rock, paper, scissors playing each move one third of the time chosen randomly1 will protect you against any possible strategy of player two: you will on average win a third of the rounds, tie a third of the rounds and lose a third of the rounds. That’s the best you can hope for, since if player two uses that same uniformly random strategy you won’t win more than a third of the time on average.

In rock, paper, scissors all the moves are basically equivalent: each move beats one of your opponents moves, ties with one and loses against one. So in a random strategy it makes sense to pick them all with the same probability. In general matrix games this need not be true, so we should consider playing randomly, but where each move is assigned a possibly different probability of being chosen.

This is what we will call a mixed strategy: a strategy described by assigning each move a certain probability and then playing randomly according to those probabilities. If player one has \(n\) possible moves, a mixed strategy for player one is given by choosing probabilities \(x_1, x_2, \ldots, x_n\). The vector of probabilities \(\begin{pmatrix} x_1 & x_2 & \ldots & x_n \end{pmatrix}^\top\) is called a stochastic vector, meaning a vector whose entries are non-negative and satisfy \(x_1 + x_2 + \cdots + x_n =1\).

Notice that pure strategies are a special case of a mixed strategy: they are the case where one of the \(x_i=1\) and all the other are \(0\). So maybe a better name would be “potentially mixed” strategies, but of course, that’s just too long! In fact we’ll mostly just say “strategies” instead of “mixed strategies”.

How do we measure how good a mixed strategy is? As a first step, let’s see how to measure how good a mixed strategy when played against a specific mixed strategy for the other player. For example, say in rock, paper, scissors the two players decided to use the following strategies:

Player Rock Paper Scissors
One 1/2   1/2
Two 1/2 1/3 1/6

How do those strategies fare against each other? If the game goes on for \(N\) rounds, we’d expect it to go approximately like this (where Pi means player #i):

# of rounds P1 P2 P1’s Payoff
\(N / 4\) rock rock 0
\(N / 6\) rock paper -1
\(N / 12\) rock scissors 1
\(N / 4\) scissors rock -1
\(N / 6\) scissors paper 1
\(N / 12\) scissors scissors 0

So the net winnings for player one over the course of those \(N\) rounds will be \(- N/6 + N/12 - N/4 + N/6 = -N/6\), for an average of \(-1/6\) per round. Notice that the \(N\) just “comes along for the ride” and cancels in the end. We could find the average winnings just thinking about probabilities: for example, with probability \((1/2)(1/3) = 1/6\), player one picks rock and player two picks paper, and since with those moves player one loses 1, this contributes a \(-1/6\) to the average winnings.

In general, assuming player one will follow the mixed strategy \(\mathbf{x}\) and that player two will follow the mixed strategy \(\mathbf{y}\), we can compute the expected2 winnings for player one as follows: with probability \(x_i y_j\) player one will make move #\(i\) and player two will make move #\(j\); that combination results in player one winning \(a_{ij}\), so in total the expected winnings of player one are \(\sum_{i,j} a_{ij} x_i y_j = \mathbf{x}^{\top} A \mathbf{y}\).

The value of a game

Now that we know how to evaluate any pair of mixed strategies against each other, let’s think about how to find optimal strategies. Let’s think from the point of view of player one. Player one has no control over what strategy player two will use, so to play it safe, player one should pick one that maximizes her winnings assuming player two responds as well as possible against the strategy. If player one use strategy \(\mathbf{x}\), the best player two can do against that would be to pick a strategy \(\mathbf{y}\) that minimizes \(\mathbf{x}^{\top} A \mathbf{y}\) —remember that that expression computes the expected winnings for player one, so player two wants to minimize it! So if player one uses strategy \(\mathbf{x}\), she can’t guarantee she’ll win more than \(\min_{\text{stoch. } \mathbf{y}} \mathbf{x}^{\top} A \mathbf{y}\) (where the minimum is taken over all stochastic vectors \(\mathbf{y}\)) on average per round. To be prepared for player two playing as smart as possible, player one should choose the strategy \(\mathbf{x}\) that maximizes that number, i.e., player one should compute: \[v(A) = \max_{\text{stoch. }\mathbf{x}} \left(\min_{\text{stoch. }\mathbf{y}} \mathbf{x}^{\top} A \mathbf{y}\right).\]

We’ll call that number the value of the game. It is the largest number \(v\) so that player one has a mixed strategy that guarantees an expected winnings per round of at least \(v\). To compute \(v(A)\) we will phrase the maximization as a linear program, which can then solved via the Simplex Method.

The key step is that the inner minimization is actually very simple! For a fixed stochastic vector \(\mathbf{x}\) we want to find the minimum value of \(\mathbf{x}^{\top}A\mathbf{y}\) where \(y\) varies over all stochastic vectors (of the appropriate size). We can think of this in terms of the game: player one is committed to using strategy \(\mathbf{x}\), player two knows this and is trying to figure out how to best respond. In that situation, player two could simply figure out which pure strategy is best against \(\mathbf{x}\) and just use that! For example, if in rock, paper, scissors player one proclaims: “I shall play rock 70% of the time, paper 20% and scissors 10%!”, player two should respond by always playing paper!

In more algebraic terms, what we are saying is that \[\min_{\text{stoch. } \mathbf{y}} \mathbf{x}^{\top} A \mathbf{y} = \min\text{entry of } \mathbf{x}^{\top}A.\] This is not hard to prove formally: if \(\mathbf{x}^{\top}A = (s_1, s_2, \ldots, s_m)\) and \(s_j\) is the smallest of those entries, we have for any stochastic vector \(\mathbf{y}\): \[\begin{aligned} \mathbf{x}^{\top}A\mathbf{y} & = s_1 y_1 + s_2 y_2 + \cdots + s_m y_m \\ & \ge s_j y_1 + s_j y_2 + \cdots s_j y_m = s_j (y_1 + \cdots + y_m) = s_j.\end{aligned}\] Since when we take \(y\) to be the pure strategy for move #\(j\) equality is attained, we can conclude that \(\min_{\text{stoch. } \mathbf{y}} \mathbf{x}^{\top} A \mathbf{y} = s_j\).

Using this we can easily turn the computation of the value of the game into a linear program. We’ll add a variable \(z\) to stand for the minimum entry of \(\mathbf{x}^{\top} A\). Of course, we can’t simply put “\(z = \min\text{entry of } \mathbf{x}^{\top}A\)” as a constraint in the linear program. But if we put in constraints that say “\(z \le j\text{th entry of } \mathbf{x}^{\top} A\)” for each \(j\), then those already tells us \(z\) is at most the minimum entry. Since \(z\) is exactly what we wish to maximize, in any optimal solution \(z\) will be equal to that minimum entry. Putting it all together this is the LP we get:

Maximize \(z\)

subject to \[\begin{aligned} \begin{pmatrix} z & z & \ldots & z \end{pmatrix} & \le \mathbf{x}^\top A \\ x_1 + x_2 + \cdots + x_n & = 1 \\ x_1, x_2, \ldots, x_n & \ge 0 \end{aligned}\]

The optimal value of this LP is \(v(A)\), the value of the game with matrix \(A\). Notice that this LP always has an optimal value:

  • It is feasible because we can get a feasible solution by taking \(\mathbf{x}\) to be any stochastic vector and \(z\) to be the minimum entry of \(\mathbf{x}^{\top} A\).
  • It is bounded because as \(\mathbf{x}\) varies over all stochastic vectors, the entries of \(\mathbf{x}^{\top} A\) are bounded (by \(\sum_{i,j} |a_{ij}|\), for example), and thus so is the objective function \(z\).

The minimax theorem

The analysis above is written from the point of view of player one. Player two could also carry out similar reasoning and reach the conclusion that the smallest number \(v\) such that player two has strategy that guarantees that player one can’t find a strategy against it with more than \(v\) expected winnings is equal to \[\min_{\text{stoch. } \mathbf{y}} \left(\max_{\text{stoch.} \mathbf{x}} \mathbf{x}^{\top} A \mathbf{y} \right).\]

We can also repeat the argument in the last section: first, to show that \[\max_{\text{stoch. } \mathbf{x}} \mathbf{x}^{\top} A \mathbf{y} = \max\text{entry of } A \mathbf{y},\] and second, to find an LP whose optimal value is that minimum that player two wants:

Minimize \(w\)

subject to \[\begin{aligned} \begin{pmatrix} w & w & \ldots & w \end{pmatrix}^\top & \ge A \mathbf{y} \\ y_1 + y_2 + \cdots + y_m & = 1 \\ y_1, y_2, \ldots, y_m & \ge 0 \end{aligned}\]

If you look at this LP carefully you’ll notice something wonderful: it’s the dual of the LP for player one!3 Let’s figure out what duality theory for these LP’s means in terms of the games. For that, notice that there is a strong connection between feasible solutions and mixed strategies. Take the LP for player one, for instance. Its variables are the \(x_i\) and an extra variable \(z\). A feasible solution is precisely a stochastic vector \(\mathbf{x}\) together with a number \(z\) that is at most the minimum entry of the vector \(\mathbf{x}^{\top}A\). Given any stochastic vector \(\mathbf{x}\) we can get a corresponding feasible solution simply by setting \(z := \min \text{entry of } \mathbf{x}^{\top} A\); and this value of \(z\) is the maximum we can take for a feasible solution that includes \(\mathbf{x}\).

Using that correspondenc we can translate results from duality theory for LPs to results about matrix games.

Strong duality tells us the optimal values of primal and dual must agree (when those LPs have optimal solutions, which as we saw above, is guaranteed in this case). This translates to:

(Minimax) For any matrix \(A\) the value of the game with payoff matrix \(A\) can be computed in the folowing two equivalent ways: \[ v(A) = \max_{\text{stoch. }\mathbf{x}} \left(\min_{\text{stoch. }\mathbf{y}} \mathbf{x}^{\top} A \mathbf{y}\right) = \min_{\text{stoch. } \mathbf{y}} \left(\max_{\text{stoch.} \mathbf{x}} \mathbf{x}^{\top} A \mathbf{y} \right).\]

We can also use duality theory to get a very convenient way to check whether or not strategies are optimal. The fact that given feasible primal and dual solutions they are optimal if and only if their objective functions agree translates to:

Let \(A\) be the payoff matrix of a game. Then two stochastic vectors \(\mathbf{x}^{*}\) and \(\mathbf{y}^{*}\) are optimal strategies for players one and two if and only if \[ \min\text{entry of }{\mathbf{x}^{*}}^{\top} A = \max\text{entry of } A \mathbf{y},\] in which case the common value of those expressions is the value of the game.

If you have a good guess as to what optimal strategies for players one and two are then the above theorem is certainly the best way to prove your guess is correct. But even if you only have a guess for player one it might be that the easiest way to show you’re right is to make a guess for an optimal strategy for player two and check using this theorem.

Symmetric games are fair

A game is called fair is its value is zero. This means that on average the wins and loses for each player balance out. Remember that a game is symmetric if “its rules are the same for player one and player two”, or mor formally, if its payoff matrix is antisymmetric: \(A = -A^{\top}\). It seems obvious that a symmetric game is fair: if the rules are the same for both player, neither player should have an advantage! Let’s show that.

For any payoff matrix \(A\), \(v(A) = -v(-A^{\top})\).

Notice that this is for an arbitrary matrix, we are not assuming that \(A = -A^{\top}\).

We can argue directly in terms of games: remember that \(-A^{\top}\) is the payoff matrix from the point of view of player two, so \(v(-A^{\top})\) is the value of the game from the point of view of player two. This of course is just \(-v(A)\).

Alternatively, we can compute from the formula for the value:

\[\begin{aligned} v(-A^{\top}) & = \max_{\text{stoch. }\mathbf{x}} \left(\min_{\text{stoch. }\mathbf{y}} \mathbf{x}^{\top} (-A^{\top}) \mathbf{y}\right) \\ & =^{\scriptscriptstyle (1)} \max_{\text{stoch. }\mathbf{x}} \left(\min_{\text{stoch. }\mathbf{y}} -\mathbf{y}^{\top} A \mathbf{x}\right) \\ & =^{\scriptscriptstyle (2)} \max_{\text{stoch. }\mathbf{x}} \left(-\max_{\text{stoch. }\mathbf{y}} \mathbf{y}^{\top} A \mathbf{x}\right) \\ & =^{\scriptscriptstyle (2)} -\min_{\text{stoch. }\mathbf{x}} \left(\max_{\text{stoch. }\mathbf{y}} \mathbf{y}^{\top} A \mathbf{x}\right) \\ & =^{\scriptscriptstyle (3)} -\min_{\text{stoch. }\mathbf{y}} \left(\max_{\text{stoch. }\mathbf{x}} \mathbf{x}^{\top} A \mathbf{y}\right) = -v(A). \end{aligned}\]

Where the equalities are true for the following reasons:

  1. Since \(\mathbf{x}^{\top}A^{\top}\mathbf{y}\) is a \(1 \times 1\) matrix it is automatically equal to its tranpose \(\mathbf{x}^{\top}A^{\top}\mathbf{y} = \left(\mathbf{x}^{\top}A^{\top}\mathbf{y}\right) = \mathbf{y}^{\top}A\mathbf{x}\)
  2. The minimum of minus something is equal to minus the maximum of that something.
  3. The names of the variables are irrelevant, we can rename \(\mathbf{x}\) to \(\mathbf{y}\) and viceversa.

Now if the game is symmetric, that is, if \(A = -A^{\top}\), the lemma tells us that \(v(A) = -v(-A^{\top}) = -v(A)\), from which we conclude that \(v(A)=0\).

Dominated moves can be removed

Certain moves are never a good idea. If player one has two moves, say #\(k\) and #\(i\) such that against every move of player two the payoff using move #\(k\) is at least as much as it is for move #\(i\), then player one can simply decide to never use move #\(i\) and doesn’t miss out any potential payoff. We’ll say that move #\(k\) dominates move #\(i\).

We can state that dominated moves are irrelevant as follows:

If a payoff matrix \(A\) satisfies that \(\mathrm{row}_{k}(A) \ge \mathrm{row}_{i}(A)\), then there exists an optimal strategy \(\mathbf{x}^{*}\) for player one in which \(x_i^{*} = 0\).

Before we prove this, a couple of remarks:

  • Notice that we can’t claim that in every optimal strategy for player one we have \(x^{*}_i = 0\), i.e., that move #\(i\) is never used in an optimal: for one thing rows \(k\) and \(i\) could be equal, but even if they are not, they could differ only in entries occurring in columns that an optimal strategy for player two doesn’t need to use, in which case the difference is not relevant. The best we can say is that it is possible to avoid using move #\(i\) in an optimal strategy.
  • By symmetry there is an analogous proposition for player two: if \(\mathrm{col}_k(A) \ge \mathrm{col}_i(A)\), then there is an optimal strategy \(\mathbf{y}^{*}\) for player two in which \(y^{*}_k = 0\). Notice that with that inequality, move #\(k\) is the one that player two can avoid: it always give a payoff for player one that is at least as large as the one from move #\(i\).

We’ll argue that given any optimal strategy \(\mathbf{x}^{*}\) for player one, if we shift all the probability from move #\(i\) to move \(k\) (to get a new strategy that gives move #\(i\) a probability of 0), the new strategy is also optimal.

Let \(\mathbf{e}_i\) be the stochastic vector that has a 1 in spot \(i\) and 0s everywhere else. Then the strategy obtained from \(\mathbf{x}^{*}\) by shifting all the weight from move #\(i\) to move #\(k\) is \(\mathbf{x}^{\circ} := \mathbf{x}^{*} - x^{*}_i \mathbf{e}_i + x^{*}_i \mathbf{e}_k\). To check this new mixed strategy is still optimal, we just need to show that for the corresponding feasible solution of the player one LP the objective function is at least as large as it was for \(\mathbf{x}^{*}\). Since \(\mathbf{x}^{*}\) achieved the maximum, that would imply the objective functions are actually equal and the strategy \(\mathbf{x}^{\circ}\) is optimal too.

So we need to show that \(\min \text{entry of } {\mathbf{x}^{\circ}}^{\top} A \ge \min \text{entry of } {\mathbf{x}^{*}}^{\top}\). This follows from: \[\begin{aligned} {\mathbf{x}^{\circ}}^{\top} A & = \left(\mathbf{x}^{*} + x^{*}_{i}(\mathbf{e}_{k} - \mathbf{e}_{i})\right)^{\top} A \\ & = {\mathbf{x}^{*}}^{\top} A + x^{*}_i (\mathbf{e}_k^{\top} A - \mathbf{e}_i^{\top} A) \\ & = {\mathbf{x}^{*}}^{\top} A + x^{*}_i (\mathrm{row}_k(A) - \mathrm{row}_i(A)) \\ & \ge {\mathbf{x}^{*}}^{\top} A. \end{aligned}\]

Once we know that a move can be avoided, we can just remove that row or column from the matrix and get a smaller game with the same value! And sometimes after removing a move there appears a new dominated move that can be removed in turn and so on. For example, consider the game with payoff matrix: \[ A = \begin{pmatrix} 3 & 4 & 1 & -5 & -2 \\ 1 & -3 & 10 & -1 & 2 \\ 7 & -1 & 8 & 5 & 6 \\ 8 & -2 & 9 & 4 & 3 \\ \end{pmatrix}.\]

Columns 1 and 3 are both dominated by column 4, so we can reduce to: \[ A' = \begin{pmatrix} 4 & -5 & -2 \\ -3 & -1 & 2 \\ -1 & 5 & 6 \\ -2 & 4 & 3 \\ \end{pmatrix}.\]

Now rows 2 and 4 are dominated by row 3 (and this wasn’t true in \(A\)!), so we can reduce to: \[ A'' = \begin{pmatrix} 4 & -5 & -2 \\ -1 & 5 & 6 \\ \end{pmatrix}.\]

Finally, column 3 is dominated by column 2, so we can reduce to: \[ A''' = \begin{pmatrix} 4 & -5 \\ -1 & 5 \\ \end{pmatrix}.\]

At this point no move dominates another move so if we want to compute \(v(A''')\), we need to do something else. We could of course just use the Simplex Method on the LP for player one:

Maximize \(z\)

subject to \[\begin{aligned} z & \le 4x_1 - x_2\\ z & \le -5x_1+5x_2\\ & x_1 + x_2 = 1 \\ & x_1, x_2 \ge 0 \end{aligned}\]

But maybe for such a small problem it’s not worth it to bust out the Simplex Method. Just let \(t=x_1\) so \(x_2=1-t\). The LP becomes:

Maximize \(z\)

subject to \[\begin{aligned} z & \le 5t-1\\ z & \le 5-10t\\ 0 & \le t \le 1 \end{aligned}\]

Now, \(5t-1 \le 5-10t\) when \(t \le 2/5\). So for \(0 \le t \le 2/5\) we have \(z \le 5t-1\) and the maximum is for \(t=2/5, z=1\). For \(2/5 \le t \le 1\) we have \(z \le 5-10t\) and the maximum is again \(t=2/5, z=1\).

So we get that \(v(A''')=1\) and that an optimal strategy is given by \(\begin{pmatrix} 2/5 & 3/5 \end{pmatrix}^\top\). This in turn means that \(v(A)=1\) with optimal strategy \(\begin{pmatrix} 0 & 2/5 & 0 & 3/5 & 0 \end{pmatrix}^\top\).

Example games

Battleship

Let’s look at an overly simplified version of the game of Battleship. In Battleship each player hides some rectangular ships on a board and then the two players take turns picking locations on the board to shoot, try to sink the other player’s ships. Our simplified version pares this down a lot:

There is a rectangular board of size \(m \times n\). Player one moves by placing a ship of length \(\ell\) somewhere on the board (either horizontally as an \(\ell \times 1\) rectangle, or vertically as a \(1 \times \ell\) rectangle). Player two picks one of the \(mn\) squares on the board to shoot at. Player two wins the round if he hits the ship that player one hid, otherwise player one wins the round. The payoff is 1 to the winner of the round.

Let analyze the example of a board of size 2 × 3 with player one placing a ship of length 2.

LINDO LP generator

Ship length:
Rows:
Columns:

Morra

The game of Morra is played as follows. In each round each player hides either one or two francs and also guesses how many francs the other player hid (they guess in secret and reveal their guesses simultaneously). If either both players guess incorrectly or both players guess correctly the round is a tie and no money changes hands. But if exactly one player guesses correctly, then that player gets to keep the francs hidden by both players!

So the moves can be described by a pair of numbers: how many francs you hide and how many francs you guess the other player hid. We’ll use, for instance, H1G2 to indicate you hide 1 and guess the other player hid 2. The payoff matrix is then:

  H1G1 H1G2 H2G1 H2G2
H1G1 0 2 -3 0
H1G2 -2 0 0 3
H2G1 3 0 0 -4
H2G2 0 -3 4 0

This matrix is anti-symmetric, of course: the game’s rules as the same for both players. So the value of the game is zero. You can confirm this in LINDO and find a pair of optimal strategies with the following LP:

max z
subject to
  z+2x2-3x3 < 0
  z-2x1+3x4 < 0
  z+3x1-4x4 < 0
  z-3x2+4x3 < 0
  x1+x2+x3+x4 = 1
end
free z

The LINDO output is:

LP OPTIMUM FOUND AT STEP      4

       OBJECTIVE FUNCTION VALUE

       1)     0.0000000E+00

 VARIABLE        VALUE          REDUCED COST
        Z         0.000000          0.000000
       X2         0.600000          0.000000
       X3         0.400000          0.000000
       X1         0.000000          0.142857
       X4         0.000000          0.000000


      ROW   SLACK OR SURPLUS     DUAL PRICES
       2)         0.000000          0.000000
       3)         0.000000          0.571429
       4)         0.000000          0.428571
       5)         0.200000          0.000000
       6)         0.000000          0.000000

NO. ITERATIONS=       4

This tells us that the following are optimal strategies:

  • For player one: 60% of the time hide 1, guess 2; 40% of the time hide 2, guess 1.
  • For player two: 57.1429% = 4/7 of the time hide 1, guess 2; 42.8571% = 3/7 of the time hide 2, guess 1.

Of course, there are other optimal strategies, the Simplex Method is content with finding one.

Now imagine that after a while of playing player two gets bored and cocky and proposes a variant to player one: both players hide 1 or 2 francs as before, then player two make a guess and reveals it, then player one guesses (player one is allowed to change her guess based on player two’s guess, but not to change the number of francs she hides). Player two figures that this won’t make a difference: she’s not revealing the number of francs she hid, only the guess, and player one can’t change the number of francs she hid after hearing player two’s guess, only guess differently than she would have. It seems to player two that this will mess with player one’s mind without actually conferring any advantage, i.e., the value of the game will still be 0. Is she right?

Let’s see! Player one now has four guessing options: as before she can guess 1 or guess 2, but now she also has the option of guessing the same as player two (we’ll denote this by “S” for same), or guessing differently than player one. The new payoff matrix is:

  H1G1 H1G2 H2G1 H2G2
H1G1 0 2 -3 0
H1G2 -2 0 0 3
H2G1 3 0 0 -4
H2G2 0 -3 4 0
H1GS 0 0 -3 3
H1GD -2 2 0 0
H2GS 3 -3 0 0
H2GD 0 0 4 -4

Let’s put this new game into LINDO:

max z
subject to
  z+2x2-3x3+2x6-3x7 < 0
  z-2x1+3x4-2x6+3x7 < 0
  z+3x1-4x4+3x5-4x8 < 0
  z-3x2+4x3-3x5+4x8 < 0
  x1+x2+x3+x4+x5+x6+x7+x8=1
end
free z

The result may be a little surprising:

LP OPTIMUM FOUND AT STEP      7

        OBJECTIVE FUNCTION VALUE

        1)     0.4040404E-01

  VARIABLE        VALUE          REDUCED COST
         Z         0.040404          0.000000
        X2         0.565657          0.000000
        X3         0.404040          0.000000
        X6         0.020202          0.000000
        X7         0.000000          0.101010
        X1         0.000000          0.070707
        X4         0.000000          0.101010
        X5         0.000000          0.070707
        X8         0.010101          0.000000


       ROW   SLACK OR SURPLUS     DUAL PRICES
        2)         0.000000          0.282828
        3)         0.000000          0.303030
        4)         0.000000          0.212121
        5)         0.000000          0.202020
        6)         0.000000          0.040404

 NO. ITERATIONS=       7

The value of the game is 4/99! So player two was wrong: revealing her guess first does confer a slight advantage to player one!


1

For example, you could roll a die and pick rock if it lands 1 or 2, paper for 3 or 4, and scissors for 5 or 6

2

“Expected” is a term from probability theory, you can think of these expected winnings as the average winnings per round of player one if both players used those strategies over the course of many, many rounds.

3

Exercise: carefully check this!

Omar Antolín Camarena