Zero Sum Games¶
Motivating example: changing Rock Paper Scissors¶
If we modify the game of Rock Paper Scissora to add a single new strategy “Spock”:
Spock smashes Scissors and Rock.
Paper disproves Spock.
The other modification is that the game is no longer symmetric: only the row player can use Spock.
The mathematical representation of this game is given by:
Is there a way that the Row player can play that guarantees a particular expected proportion of wins?
Optimising worst case outcomes: the min-max and max-min strategies¶
Given a zero sum game defined by \(A\in\mathbb{R}^{m\times n}\) and a column player with strategy \(y\in\mathbb{R}^{n}\), the row player is aiming to find a best response strategy \(x\in\mathbb{R}^{m}\) which corresponds to:
This corresponds to finding the maximum row of \(Ay^T\):
The column player, through their choice of \(y\) will be able to define the upper bound \(v\) of \(\max_{i \leq m} (Ay^T)_i\). In fact, as the game is zero sum, there will be aiming to choose \(y\) such that the upper bound \(v\) is as low as possible.
Thus,
Thus, the min-max strategy \(y\) of the column player is a solution to the following linear program:
Subject to:
In this case, \(v\) is called the min-max value of the game.
The corresponding max-min strategy \(x\) of the row player is a solution to the following linear program:
Subject to:
In this case, \(v\) is called the max-min value of the game.
For the modified rock paper scissors game the max-min strategy \(x\) of the row player will be a solution to the following linear program:
Subject to:
Question
For the zero sum game Matching Pennies: with payoff matrix \(A = \begin{pmatrix} 1 & -1\\ -1 & 1 \end{pmatrix}\).
What linear program is the max-min strategy \(x\) a solution to?
What is the max-min strategy?
Answer
The max-min strategy is a solution to the following linear program:
Subject to:
Given that \(x_1+x_2=1\) this linear program corresponds to:
Subject to:
These contraints can be rewritten as:
This implies that \(\frac{u + 1}{2}\leq x_1\leq \frac{1 - u}{2}\) which implies \(u \leq -u\) which is only true when \(u=0\). When \(u=0\) the constraints become: \(\frac{1}{2} \leq x_1\leq \frac{1}{2}\) giving: \(x_1=1/2\).
The max-min strategy is thus: \(x=(1/2, 1/2)\).
Re formulation of the linear program¶
In a Zero Sum Game, given a row player payoff matrix \(A\) with \(m\) rows and \(n\) columns, the following linear program will give the max-min strategy and value:
Subject to:
Where the coefficients of the linear program are defined by:
This reformulation is in fact how the linear program is written in Nashpy’s source code.
For the modified rock paper scissors game the coefficients of the linear system are given by:
Question
Obtain the coefficients of the reformulated linear system for the zero sum game Matching Pennies: with payoff matrix \(A = \begin{pmatrix} 1 & -1\\ -1 & 1 \end{pmatrix}\).
Answer
Here are the coefficients of the reformulated linear system:
The minimax theorem¶
The minimax theorem [vonNeumann1928] states that if there exists optimal values of the:
max-min value \(u\) and the max-min strategy \(x\).
min-max value \(v\) and the min-max strategy \(y\).
then \(u=v\).
This can be proved using the Linear Program Duality Theorem.
Note that this answers the question posed at the end of Motivating example: changing Rock Paper Scissors: through a choice of strategy the row player can ensure they obtain the value of the game which is equal to the max-min value and the min-max value.
Exercises¶
Obtain the coefficients of the reformulated linear system for the zero sum games with the following payoff matrices:
\(A = \begin{pmatrix} 3 & -1\\ -1 & 2 \end{pmatrix}\).
\(A = \begin{pmatrix} -1 & -1\\ -1 & 3 \end{pmatrix}\).
\(A = \begin{pmatrix} 2 & 1 & -3\\ -3 & -1 & 3 \end{pmatrix}\).
\(A = \begin{pmatrix} 3 & -2 & 0\\ -3 & 0 & 3 \\ 0 & 2 & -5 \end{pmatrix}\).
Using Nashpy¶
See Use the minimax theorem for guidance of how to use Nashpy to find the Nash equilibria of Zero sum games using the mini max theorem.