SlideShare ist ein Scribd-Unternehmen logo
1 von 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?

Weitere ähnliche Inhalte

Ähnlich wie 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.docxSHIVA101531
 
Designing balance (takeaway version)
Designing balance (takeaway version)Designing balance (takeaway version)
Designing balance (takeaway version)Kacper Szymczak
 
Game Balance 3: Interesting Strategies
Game Balance 3: Interesting StrategiesGame Balance 3: Interesting Strategies
Game Balance 3: Interesting StrategiesMarc Miquel
 
Game theory application
Game theory applicationGame theory application
Game theory applicationshakebaumar
 
1532 0545-2001-02-01-0050
1532 0545-2001-02-01-00501532 0545-2001-02-01-0050
1532 0545-2001-02-01-0050Rana Ahmad
 
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 AccessabilityDavid Mullich
 
Game theory
Game theoryGame theory
Game theorygtush24
 
GameTheory_popular.ppt
GameTheory_popular.pptGameTheory_popular.ppt
GameTheory_popular.pptAMRITRANJAN30
 
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 reearchssuser96912f1
 
Phantom Doctrine: a Design Post-Mortem
Phantom Doctrine: a Design Post-MortemPhantom Doctrine: a Design Post-Mortem
Phantom Doctrine: a Design Post-MortemKacper Szymczak
 
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 211Miami University
 
Superhuman AI for multiplayer poker
Superhuman AI for multiplayer pokerSuperhuman AI for multiplayer poker
Superhuman AI for multiplayer pokerPeerasak C.
 
Game Theory_1.pptx
Game Theory_1.pptxGame Theory_1.pptx
Game Theory_1.pptxssuser8c2631
 

Ähnlich wie 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
 

Kürzlich hochgeladen

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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...Orbitshub
 
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.pdfOrbitshub
 
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, ...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
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 AmsterdamUiPathCommunity
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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.pdfsudhanshuwaghmare1
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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 Takeoffsammart93
 
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 Ontologyjohnbeverley2021
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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...
 
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
 
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, ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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