CoCalc Public Filesgame_theory.sagewsOpen with one click!
Author: Vince Knight
Views : 51
Compute Environment: Ubuntu 18.04 (Deprecated)
A = matrix([[3, 0], [5, 4]]) # Creating the payoff matrix for player 1 B = matrix([[3, 5], [0, 4]]) # Creating the payoff matrix for player 2 g = NormalFormGame([A, B]) # Creating the game
g.obtain_nash() # Finding the Nash equilibria
[[(0, 1), (0, 1)]]
g.is_degenerate()
False
g = game_theory.normal_form_games.PrisonersDilemma() g.payoff_matrices()
([-2 -5] [ 0 -4], [-2 0] [-5 -4])