# Lecture 10 Hashing - Duke University Lecture 20 Linear Program Duality Outline Duality for two player games Solving two player games using LP Duality for LP Duality Two-Player Zero-sum Games Game played with two competing players, when one player wins, the other player loses. Goal: Find the best strategy in the game Game as a matrix Can represent the game using a 2-d array

R P S R 0 -1 1 P 1

0 -1 S -1 1 0 A[i, j] = if row player uses strategy i, column player uses strategy j, the payoff for the row player Recall: payoff for the column player is - A[i, j] Pure Strategy vs. Mixed Strategy

Pure strategy: use a single strategy (correspond to a single row/column of the matrix) Obviously not a good idea for Rock-Paper-Scissors. R P S R 0 -1 1 P

1 0 -1 S -1 1 0 Mixed strategy: Play Rock with probability p1 Payoff of the game.

Let Srow be a mixed strategy for the row player, Scol be a mixed strategy for the column player. Payoff for the row player: 1 0 0 0.25 0 -1 1 0.25

1 0 -1 0.5 -1 1 0 Solving two player games by LP A

B C A 3 1 -1 B -2 3

2 C 1 -2 4 Try to use LP to find a good strategy for Duke. What is a good strategy for Duke? A B C

A 3 A with1 probability -1 Strategy: Make play x1, B with probabilityBx2, C with x23. -2 probability 3 Good strategy: no 1matter what the4 opponent does, C -2 we get a good payoff. Let the payoff be x4. Solution: (9,6,4,19)/19.

Duality: what would UNC do? A B C A 3 A with1 probability -1 Strategy: Make play y1, B with probabilityBy2, C with y23. -2 probability 3 UNC wantsC to make 1 sure no

-2 matter 4 what we do, the payoff is always low (say lower than y4) Solution: (1,1,1,3)/3. Comparing the Solution to two LPs Solution to 1st LP: no matter what UNC does, Duke can always get x4 points (in expectation). Solution to 2nd LP: no matter what Duke does, UNC can always make sure Duke dont get more than y4 points (in expectation). Relationship between x4 and y4? Claim (Weak Duality): Min-Max Theorem Theorem [Von Neumann] For any two-player, zero-sum

game, there is always a pair of optimal strategies and a single value V. If the row player plays its optimal strategy, then it can guarantee a payoff of at least V. If the column player plays its optimal strategy, then it can guarantee a payoff of at most V. Corollary: The solution to the two LP must be equal. (x4=y4) Duality for Linear Programs Consider the following LP: Question: How can I prove to you that optimal solution is at most -1? Answer: You can check (4, 3, 0) Question: How to prove the optimal is at least -1? Dual LP

Primal Constraints Variables Feasible solution gives an upper bound. Dual Variables Constraints Feasible solution gives a lowerbound. Strong Duality: The two LP has the same optimal value.