CoCalc Shared Filesgame_theory.sagews
Author: Vince Knight
Views : 9
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])