SlideShare a Scribd company logo
1 of 23
Game Theory and Simulation in Ruby Presenter: Matt Pattison Based on Masters thesis:  ‘ An Investigation of Retaliation and Reconciliation Conventions in the Repeated Prisoner’s Dilemma’
I will talk tonight about the Ruby simulation code I wrote as part of my Masters thesis ,[object Object],[object Object],[object Object]
But first, you need to understand some  Game Theory ,[object Object],[object Object]
Game theory is not just about ‘games’, but ‘games’ are a good place to start Gonzales is playing  Federer, who has come in to the net, and hit the ball to Gonzalez’s forehand. Should Gonzalez return the ball down the line with his powerful forehand, whip the ball cross-court or risk a lob.  Federer vs. Gonzalez
How often should Gonzalez go cross court (CC), down the line (DL), or lob (Lob)? First we need to look at the probabilites of success for Gonzalez:
Then we can determine the correct proportions from a best response graph
Game theory is not just about ‘games’, but…
Game theory is not just about ‘games’, but… Player balance in Starcraft: It is important that no strategies are dominant or dominated. Therefore available strategies for different players usually have payoffs that resemble Rock-Scissors-Paper
Archers-Cavalry-Pikemen Rock-Paper-Scissors equivalent game-balancing Actual dominance relationships from ‘Age of Kings’
The battle of the local pizza joints Should each pizza joint price High, Medium, or Low?
The battle of the pizza joints cont... Pricing Low is a dominated strategy What we are left with is…
The Prisoner’s dilemma Using Greed (G) and Fear (F) factors  * Greed factor represents benefit from exploiting opponent.  * Fear factor represents disbenefit from cooperating and being    exploited
Zero sum vs non-zero sum ,[object Object],[object Object]
Nash equilibrium Strategies that are best responses to each other
Win-win or no deal ,[object Object],[object Object]
Grid-based prisoner’s dilemma simulation ,[object Object]
The repeated prisoner’s dilemma See the example…
Mistakes ,[object Object]
Strategy state machines See the code… Example of DSL
R1P2
Finite Markov Chain strategy pairs
R1P2 vs R1P2
Questions?

More Related Content

Similar to Game theory and simulation in Ruby

Lecture OverviewSolving the prisoner’s dilemmaInstrumental r.docx
Lecture OverviewSolving the prisoner’s dilemmaInstrumental r.docxLecture OverviewSolving the prisoner’s dilemmaInstrumental r.docx
Lecture OverviewSolving the prisoner’s dilemmaInstrumental r.docx
SHIVA101531
 
Game theory application
Game theory applicationGame theory application
Game theory application
shakebaumar
 
Feb 26th RPG PowerPoint for IMS 211
Feb 26th RPG PowerPoint for IMS 211Feb 26th RPG PowerPoint for IMS 211
Feb 26th RPG PowerPoint for IMS 211
Miami University
 

Similar to Game theory and simulation in Ruby (20)

Game balance part 2
Game balance part 2Game balance part 2
Game balance part 2
 
Game theory
Game theoryGame theory
Game theory
 
Lecture OverviewSolving the prisoner’s dilemmaInstrumental r.docx
Lecture OverviewSolving the prisoner’s dilemmaInstrumental r.docxLecture OverviewSolving the prisoner’s dilemmaInstrumental r.docx
Lecture OverviewSolving the prisoner’s dilemmaInstrumental r.docx
 
Designing balance (takeaway version)
Designing balance (takeaway version)Designing balance (takeaway version)
Designing balance (takeaway version)
 
Fatal
FatalFatal
Fatal
 
Game Balance 3: Interesting Strategies
Game Balance 3: Interesting StrategiesGame Balance 3: Interesting Strategies
Game Balance 3: Interesting Strategies
 
Game theory application
Game theory applicationGame theory application
Game theory application
 
1532 0545-2001-02-01-0050
1532 0545-2001-02-01-00501532 0545-2001-02-01-0050
1532 0545-2001-02-01-0050
 
gt_2007
gt_2007gt_2007
gt_2007
 
LAFS Game Design 10 - Fun and Accessability
LAFS Game Design 10 - Fun and AccessabilityLAFS Game Design 10 - Fun and Accessability
LAFS Game Design 10 - Fun and Accessability
 
Game theory
Game theoryGame theory
Game theory
 
GameTheory_popular.ppt
GameTheory_popular.pptGameTheory_popular.ppt
GameTheory_popular.ppt
 
GameTheory_popular.ppt in the operations reearch
GameTheory_popular.ppt in the operations reearchGameTheory_popular.ppt in the operations reearch
GameTheory_popular.ppt in the operations reearch
 
Phantom Doctrine: a Design Post-Mortem
Phantom Doctrine: a Design Post-MortemPhantom Doctrine: a Design Post-Mortem
Phantom Doctrine: a Design Post-Mortem
 
Game Theory Economics
Game Theory EconomicsGame Theory Economics
Game Theory Economics
 
Feb 26th RPG PowerPoint for IMS 211
Feb 26th RPG PowerPoint for IMS 211Feb 26th RPG PowerPoint for IMS 211
Feb 26th RPG PowerPoint for IMS 211
 
Task 2 research
Task 2 researchTask 2 research
Task 2 research
 
Learning Through Gaming
Learning Through GamingLearning Through Gaming
Learning Through Gaming
 
Superhuman AI for multiplayer poker
Superhuman AI for multiplayer pokerSuperhuman AI for multiplayer poker
Superhuman AI for multiplayer poker
 
Game Theory_1.pptx
Game Theory_1.pptxGame Theory_1.pptx
Game Theory_1.pptx
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Game theory and simulation in Ruby

  • 1. Game Theory and Simulation in Ruby Presenter: Matt Pattison Based on Masters thesis: ‘ An Investigation of Retaliation and Reconciliation Conventions in the Repeated Prisoner’s Dilemma’
  • 2.
  • 3.
  • 4. Game theory is not just about ‘games’, but ‘games’ are a good place to start Gonzales is playing Federer, who has come in to the net, and hit the ball to Gonzalez’s forehand. Should Gonzalez return the ball down the line with his powerful forehand, whip the ball cross-court or risk a lob. Federer vs. Gonzalez
  • 5. How often should Gonzalez go cross court (CC), down the line (DL), or lob (Lob)? First we need to look at the probabilites of success for Gonzalez:
  • 6. Then we can determine the correct proportions from a best response graph
  • 7. Game theory is not just about ‘games’, but…
  • 8. Game theory is not just about ‘games’, but… Player balance in Starcraft: It is important that no strategies are dominant or dominated. Therefore available strategies for different players usually have payoffs that resemble Rock-Scissors-Paper
  • 9. Archers-Cavalry-Pikemen Rock-Paper-Scissors equivalent game-balancing Actual dominance relationships from ‘Age of Kings’
  • 10. The battle of the local pizza joints Should each pizza joint price High, Medium, or Low?
  • 11. The battle of the pizza joints cont... Pricing Low is a dominated strategy What we are left with is…
  • 12. The Prisoner’s dilemma Using Greed (G) and Fear (F) factors * Greed factor represents benefit from exploiting opponent. * Fear factor represents disbenefit from cooperating and being exploited
  • 13.
  • 14. Nash equilibrium Strategies that are best responses to each other
  • 15.
  • 16.
  • 17. The repeated prisoner’s dilemma See the example…
  • 18.
  • 19. Strategy state machines See the code… Example of DSL
  • 20. R1P2
  • 21. Finite Markov Chain strategy pairs