All problems
Exploitability Lite
Problem
Compute the exploitability of a strategy profile in a two-player zero-sum game.
A is player 1's payoff matrix. br1 is the best pure response to q, and br2 is player 2's best response to p (minimizing player 1's payoff). Return (br1 - br2) / 2, which is zero at a Nash equilibrium.
Hint
Exploitability halves the gap between the two best-response values.
Test cases
case 1
in: [[[1,-1],[-1,1]],[0.5,0.5],[0.5,0.5]]
expected: 0
case 2
in: [[[3,0],[0,1]],[1,0],[1,0]]
expected: 1.5
case 3
in: [[[0,2],[1,0]],[0.5,0.5],[0.5,0.5]]
expected: 0.25
case 4
in: [[[1,0],[0,1]],[1,0],[0,1]]
expected: 0.5
Starter codePython
def exploitability_lite(A, p, q):
# Your code here
pass4 test cases · run your code against them in the editor