Example: One-shot games

A one-shot game (normal form game) is a stochastic game with only one state (\(\boldsymbol{\phi}=\boldsymbol{1}\)) and full discounting (\(\boldsymbol{\delta}=\boldsymbol{0}\)). Any one-shot game is fully specified by its payoff matrix \(\boldsymbol{u}\).

A famous example is the Prisoner’s Dilemma:

player1

cooperate

defect

player0

cooperate

2, 2

0, 3

defect

3, 0

1, 1

The game is fully defined by the following game table.

state

a_player0

a_player1

u_player0

u_player1

phi_state0

delta

0

0

state0

cooperate

cooperate

2

2

0

state0

cooperate

defect

0

3

0

state0

defect

cooperate

3

0

0

state0

defect

defect

1

1

0

The game table specifies for each state and action profile the corresponding payoffs and state transitions. Additionally, the first row specifies the discount factors for each player.

To import the game table, use the SGame.from_table() method.

import sgamesolver
game = sgamesolver.SGame.from_table('path/to/table.xlsx')