pure_nash

Methods for computing pure Nash equilibria of a normal form game. (For now, only brute force method is supported)

quantecon.game_theory.pure_nash.pure_nash_brute(g, tol=None)[source]

Find all pure Nash equilibria of a normal form game by brute force.

Parameters:
gNormalFormGame
tolscalar(float), optional(default=None)

Tolerance level used in determining best responses. If None, default to the value of the tol attribute of g.

Returns:
NEslist(tuple(int))

List of tuples of Nash equilibrium pure actions. If no pure Nash equilibrium is found, return empty list.

Examples

Consider the “Prisoners’ Dilemma” game:

>>> PD_bimatrix = [[(1, 1), (-2, 3)],
...                [(3, -2), (0, 0)]]
>>> g_PD = NormalFormGame(PD_bimatrix)
>>> pure_nash_brute(g_PD)
[(1, 1)]

If we consider the “Matching Pennies” game, which has no pure nash equilibrium:

>>> MP_bimatrix = [[(1, -1), (-1, 1)],
...                [(-1, 1), (1, -1)]]
>>> g_MP = NormalFormGame(MP_bimatrix)
>>> pure_nash_brute(g_MP)
[]
quantecon.game_theory.pure_nash.pure_nash_brute_gen(g, tol=None)[source]

Generator version of pure_nash_brute.

Parameters:
gNormalFormGame
tolscalar(float), optional(default=None)

Tolerance level used in determining best responses. If None, default to the value of the tol attribute of g.

Yields:
outtuple(int)

Tuple of Nash equilibrium pure actions.