# Applications of LP Duality

In this lecture we will see some cool applications of LP duality in other areas of science.

## Game Theory: Two-Player Zero-Sum Games

### Two-Player Games

In a two-player game, we have two players, Alice and Bob, who each have a set of strategies $S_A$ and $S_B$, respectively. The payoff of the game is given by a map $f: S_A \times S_B \to \mathbb{R}^2$, where the first coordinate of the image is Alice’s payoff, and the second coordinate is Bob’s payoff. The goal of each player is to maximize their payoff. The game’s outcome can be given by a table, where the rows correspond to Alice’s strategies, the columns correspond to Bob’s strategies, and the entry in the $i$-th row and $j$-th column is the payoff of the game when Alice plays the $i$-th strategy and Bob plays the $j$-th strategy.

An example is the following game, known as the *battle of the sexes game*: Alice likes to go to the football game, while Bob likes to go to the opera. However, they both prefer to go to an event together than to go alone. The payoff table in this case is given by

Football | Opera | |
---|---|---|

Football | (2, 1) | (0, 0) |

Opera | (0, 0) | (1, 2) |

Where in each entry of the above table, the first number is Alice’s payoff, and the second number is Bob’s payoff.

Another example is the *prisoner’s dilemma*: two prisoners are arrested for a crime, and are being interrogated separately. If both prisoners remain silent, they will both be sentenced to 1 year in prison. If one prisoner confesses and the other remains silent, the prisoner who confesses will be set free, while the other will be sentenced to 10 years in prison. If both prisoners confess, they will both be sentenced to 5 years in prison. The payoff table in this case is given by

Silent | Snitch | |
---|---|---|

Silent | (-1, -1) | (-10, 0) |

Snitch | (0, -10) | (-5, -5) |

Where in each entry of the above table, the first number is the payoff of the first prisoner, and the second number is the payoff of the second prisoner.

Note that in the above two examples, certain strategies are special.
For instance, in the battle of sexes example, if Bob knows that Alice will go to football, then Bob will go to football as well, since he prefers to go to the football game with Alice than to go to the opera alone.
Similarly, if Alice knows that Bob will go to the football game, then Alice will go to the football game as well.
Such strategies are called *Nash equilibria*, which we now formally define.

**Definition (Best Response):** A strategy $s_A \in S_A$ is a *best response* to a strategy $s_B \in S_B$ if $f(s_A, s_B) \geq f(s_A’, s_B)$ for all $s_A’ \in S_A$.

**Definition (Nash Equilibrium):** A pair of strategies $(s_A, s_B)$ is a *Nash equilibrium* if $s_A$ is a best response to $s_B$ and $s_B$ is a best response to $s_A$.
In other words, we know that Alice’s strategy $s_A$ is an optimum strategy for Alice, *given that she knows* that Bob’s strategy is $s_B$, and Bob’s strategy $s_B$ is an optimum strategy for Bob, *given that he knows* that Alice’s strategy is $s_A$.

**Practice problem 1:** See that in the prisoner’s dilemma, the pair of strategies (Snitch, Snitch) is a Nash equilibrium.

Here it is important to notice three points:

- The Nash equilibrium is not necessarily the best outcome for the players. For instance, in the prisoner’s dilemma, the best outcome for the players is for both of them to remain silent, but this is not a Nash equilibrium.
- The Nash equilibrium is not necessarily unique. For instance, in the battle of sexes game, both (Football, Football) and (Opera, Opera) are Nash equilibria.
- Some games do not have a Nash equilibrium. For instance, consider the rock-paper-scissors game, where Alice and Bob each choose one of rock, paper, or scissors; and whoever wins gets a value of 1, and whoever loves gets a value of $-1$. The table of values for this game is given by:

Rock | Paper | Scissors | |
---|---|---|---|

Rock | (0, 0) | (-1, 1) | (1, -1) |

Paper | (1, -1) | (0, 0) | (-1, 1) |

Scissors | (-1, 1) | (1, -1) | (0, 0) |

In this case, there is no Nash equilibrium, since no matter what strategy Alice chooses, Bob can choose a strategy that gives him a better payoff (and vice-versa).

**Practice problem 2:** Show that in the rock-paper-scissors game, there is no Nash equilibrium.

### Mixed Strategies

In the above discussions, we have talked about **pure strategies**, where each player chooses a single strategy to play the game.
However, we can also consider **mixed strategies**, where each player chooses a probability distribution over the set of strategies.
Mixed strategies model the case where the players choose their strategies randomly, according to some distribution.