Code that defines a very simple function entitled "TwobyTwoNashEquilibria" and uses simple algebra to compute the equilibria for a 2 by 2 bi-matrix game.
|
File: /tmp/tmpXNMwn5/___code___.py Type: <type ‘function’> Definition: TwobyTwoNashEquilibria(A, B=0) Docstring: Computes the Equilibria for a general 2 by 2 bi matrix game defined by (A,B)\in\mathbb{R}^{2\times2}\times\mathbb{R}^{2\times 2}. If B is omitted from input, a zero sum game is assumed. File: /tmp/tmpXNMwn5/___code___.py Type: <type ‘function’> Definition: TwobyTwoNashEquilibria(A, B=0) Docstring: Computes the Equilibria for a general 2 by 2 bi matrix game defined by (A,B)\in\mathbb{R}^{2\times2}\times\mathbb{R}^{2\times 2}. If B is omitted from input, a zero sum game is assumed. |
Obtaining the equilibria strategies for: matching pennies
[(1/2, 1/2), (1/2, 1/2)] [(1/2, 1/2), (1/2, 1/2)] |
Obtaining the equilibria strategies for: prisoner's dilemma
[(0, 1), (0, 1)] [(0, 1), (0, 1)] |
Obtaining the equilibria strategies for the box kick game of this blog post.
[(5/17, 12/17), (2/17, 15/17)] [(5/17, 12/17), (2/17, 15/17)] |