Sugs23 / PrisonersDilemma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prisoner's Dilemma

Python Code to rum simulations of Prisoner's Dilemma for different payoffs and calculate expected payoffs

Running The Code

Recommended number of simulations: 5000-8000
Approximate runtime for 5000 simulations: 1.89 seconds

Background

Prisoner's Dilemma is a game theory problem where two individuals have to make independent choice however the payoff for every individual is dependent on their collective choices
Their are two options, snitch or stay loyal The expcted value of payoff is difficult to calcute however it converges according to Law of Large Numbers

Code Description

This code simulates the choices for both prisoners and outputs resultant expected payouts for the strategies
It plots the expected value after every simulation to visualize the convergence

References

About the Problem: https://en.wikipedia.org/wiki/Prisoner%27s_dilemma

About

License:MIT License


Languages

Language:Python 100.0%