Game Theory in Action: Interactive Strategies & Nash Equilibrium
Game Theory in Action
Interactive exploration of game theory - the mathematics of strategic decision-making. Play, experiment, and see the results live.
The Prisoner's Dilemma
Two prisoners interrogated separately. Each can cooperate (stay silent) or defect (betray). The payoffs create a fascinating paradox.
3D Payoff Matrix
Prisoner's Dilemma - 3D View
💡 How to Use
- • Click and drag to rotate the 3D visualization
- • Use zoom buttons to get closer or further away
- • Each bar represents a player's payoff for a specific outcome
- • C/C = Both Cooperate, C/D = Player 1 Cooperates, Player 2 Defects, etc.
- • Green/Cyan bars = Cooperation, Red/Magenta bars = Defection
- • Height of the bar = payoff value (higher is better)
Interactive Play
> Prisoner's Dilemma
Two players must simultaneously choose to cooperate or defect. The payoff matrix:
P2 Cooperate | P2 Defect | |
---|---|---|
P1 Cooperate | 3, 3 | 0, 5 |
P1 Defect | 5, 0 | 1, 1 |
Real-world examples:
- Nuclear deterrence (arm vs. disarm)
- Business competition (pricing strategies)
- Open source vs. proprietary software
- Climate change negotiations
- Cryptocurrency mining (honest vs. attack)
Repeated Games & Strategies
When playing multiple rounds, different strategies emerge:
> Strategy Simulator
Watch different strategies compete in an iterated Prisoner's Dilemma
Cooperates first, then copies opponent's last move
Always defects, no matter what
Strategy Tournament
15 strategies compete in round-robin format. Watch the live action!
Strategy Tournament
15 strategies compete in round-robin format (105 total matches)
Click "Start" to run the tournament with 15 different strategies
Live view shows match progress in real-time
Nash Equilibrium
A Nash Equilibrium is a state where no player can improve their outcome by changing their strategy alone.
> Nash Equilibrium Explorer
Find Nash equilibria in classic game theory scenarios
Battle of the Sexes
Couple wants to go out together, but prefers different venues
P2: Opera | P2: Football | |
---|---|---|
P1: Opera | 3, 2 ⚡ Nash Eq. | 0, 0 |
P1: Football | 0, 0 | 2, 3 ⚡ Nash Eq. |
💡 Nash Equilibrium:
A Nash equilibrium is a strategy profile where no player can improve their payoff by unilaterally changing their strategy. In other words, given what others are doing, you're doing the best you can.
✓ Cells marked with ⚡ are Nash equilibria
Key insights:
- In Prisoner's Dilemma: (Defect, Defect) is Nash Equilibrium - even though (Cooperate, Cooperate) gives better payoffs
- In Battle of the Sexes: Two Nash Equilibria exist
- In Matching Pennies: No pure strategy equilibrium - only mixed strategies
Build Your Own Strategy
Create and test your own game theory strategy in JavaScript:
Custom Strategy Builder
Write your own game theory strategy in JavaScript and test it against different opponents
💡 Tips
- • Your function must return either 'cooperate' or 'defect'
- • Use gameState.opponentHistory to analyze past moves
- • Remember: both cooperating gives 3 points each, both defecting gives 1 point each
- • Try implementing famous strategies like Grudger, Pavlov, or Generous Tit-for-Tat
- • Test against different opponents to see how your strategy performs
Key Takeaways
- Cooperation Can Win: Cooperative strategies often dominate in repeated games
- Context Matters: One-shot vs. repeated games have different optimal strategies
- Reputation is Valuable: Trust pays off in repeated interactions
- Simplicity Works: Tit-for-Tat's success shows simple strategies can beat complex ones
- No Universal Best: Optimal strategy depends on what others are playing
The Matrix Connection
Game theory is everywhere in The Matrix:
- Neo's choice: Red pill (defect) vs. blue pill (cooperate with system)
- Agent Smith: Always defect → leads to his downfall
- The Architect: Tries to create stable Nash Equilibrium
- Morpheus: Tit-for-Tat - cooperates with believers, fights the system
Humans and machines are locked in an iterated Prisoner's Dilemma. Only by changing the game itself can they break the cycle.
Further Reading:
- "The Evolution of Cooperation" by Robert Axelrod
- "Thinking Strategically" by Avinash Dixit & Barry Nalebuff
- "A Beautiful Mind" by Sylvia Nasar