Fun with Learning Technology
LearnCoursesQuestionsTracksToolsNewsExplorePractice
Fun with Learning Technology

A new problem, explained clearly, every day.

Subscribe
Learn
  • Lessons
  • Topics
  • News
  • Tools
  • Courses
  • Career tracks
  • Everything
Site
  • About
  • Contact
  • Support
  • Privacy
  • Terms
Get the daily one

One email per new problem. No spam.

Request a tutorial

Requests shape what gets made next.

© 2026 Fun with Learning TechnologyRSS
Home›Courses›Reasoning›Game Theory and Strategic Reasoning

Advanced Logical Systems

Game Theory and Strategic Reasoning

Game theory is the mathematical study of decision-making in competitive or cooperative scenarios where outcomes depend on the actions of multiple agents. It matters because it provides a rigorous framework to analyze strategic interactions, predict behavior, and optimize decisions in fields like economics, politics, and computer science. You reach for it when you need to model conflicts, negotiations, or resource allocation problems where rational actors influence each other's outcomes.

The Basics: Players, Strategies, and Payoffs

At the core of game theory are three fundamental concepts: players, strategies, and payoffs. Players are the decision-makers in the game, which could be individuals, companies, or even algorithms. Each player has a set of strategies—possible actions they can take. Payoffs represent the outcomes for each player based on the combination of strategies chosen by all players. For example, in a simple two-player game like Rock-Paper-Scissors, each player has three strategies, and the payoff is either a win, loss, or tie. The key insight here is that a player's optimal strategy depends not just on their own choices but on what others do. This interdependence is what makes game theory distinct from single-agent decision problems. By modeling these elements explicitly, you can analyze how rational players will behave and what outcomes are likely to emerge. The code below simulates a basic payoff matrix for a two-player game, where each player's strategy affects the other's outcome.

# Define a simple two-player payoff matrix for a game like Prisoner's Dilemma
# Rows: Player 1's strategies (Cooperate, Defect)
# Columns: Player 2's strategies (Cooperate, Defect)
# Payoffs are tuples: (Player 1's payoff, Player 2's payoff)
payoff_matrix = {
    ('Cooperate', 'Cooperate'): (3, 3),  # Both cooperate, moderate reward
    ('Cooperate', 'Defect'): (0, 5),     # Player 1 cooperates, Player 2 defects
    ('Defect', 'Cooperate'): (5, 0),     # Player 1 defects, Player 2 cooperates
    ('Defect', 'Defect'): (1, 1)         # Both defect, minimal reward
}

def get_payoff(player1_strategy, player2_strategy):
    """Return the payoff for both players given their strategies."""
    return payoff_matrix.get((player1_strategy, player2_strategy), (0, 0))

# Example: What happens if Player 1 cooperates and Player 2 defects?
player1_payoff, player2_payoff = get_payoff('Cooperate', 'Defect')
print(f"Player 1 payoff: {player1_payoff}, Player 2 payoff: {player2_payoff}")

Dominant Strategies and Rationality

A dominant strategy is one that yields the highest payoff for a player, regardless of what the other players do. Identifying dominant strategies simplifies analysis because rational players will always choose them. For example, in the Prisoner's Dilemma, defecting is a dominant strategy for both players, even though mutual cooperation would lead to a better collective outcome. This illustrates a key tension in game theory: individual rationality can lead to collectively suboptimal outcomes. The concept of dominance helps you predict behavior in one-shot games where players act simultaneously without communication. However, not all games have dominant strategies, and in such cases, you must consider more nuanced equilibrium concepts. The code below checks for dominant strategies by comparing payoffs across all possible opponent strategies.

# Check if a strategy is dominant for a player in a two-player game
def is_dominant_strategy(player, strategy, payoff_matrix):
    """Check if `strategy` is dominant for `player` (1 or 2)."""
    for opponent_strategy in ['Cooperate', 'Defect']:
        # Compare payoffs for all possible opponent strategies
        for other_strategy in ['Cooperate', 'Defect']:
            if strategy == other_strategy:
                continue
            # Get payoffs for current and alternative strategy
            if player == 1:
                current_payoff = payoff_matrix[(strategy, opponent_strategy)][0]
                other_payoff = payoff_matrix[(other_strategy, opponent_strategy)][0]
            else:
                current_payoff = payoff_matrix[(opponent_strategy, strategy)][1]
                other_payoff = payoff_matrix[(opponent_strategy, other_strategy)][1]
            
            if current_payoff < other_payoff:
                return False
    return True

# Example: Is 'Defect' a dominant strategy for Player 1?
is_dominant = is_dominant_strategy(1, 'Defect', payoff_matrix)
print(f"Is 'Defect' dominant for Player 1? {is_dominant}")

Nash Equilibrium: The Core Concept

A Nash Equilibrium is a set of strategies where no player can unilaterally improve their payoff by changing their strategy, assuming all other players' strategies remain fixed. This concept is central to game theory because it predicts stable outcomes in strategic interactions. For example, in the Prisoner's Dilemma, the Nash Equilibrium is (Defect, Defect), even though (Cooperate, Cooperate) would be better for both. The power of Nash Equilibrium lies in its generality: it applies to any finite game with rational players. To find a Nash Equilibrium, you check each possible strategy profile to see if any player has an incentive to deviate. The code below implements this check for a two-player game by iterating through all strategy combinations and verifying if any player can benefit from switching strategies.

# Find all Nash Equilibria in a two-player game
def find_nash_equilibria(payoff_matrix):
    """Return all strategy pairs where neither player can improve by deviating."""
    equilibria = []
    strategies = ['Cooperate', 'Defect']
    
    for p1_strategy in strategies:
        for p2_strategy in strategies:
            is_equilibrium = True
            # Check if Player 1 can improve by switching
            for alt_p1_strategy in strategies:
                if alt_p1_strategy == p1_strategy:
                    continue
                current_payoff = payoff_matrix[(p1_strategy, p2_strategy)][0]
                alt_payoff = payoff_matrix[(alt_p1_strategy, p2_strategy)][0]
                if alt_payoff > current_payoff:
                    is_equilibrium = False
                    break
            if not is_equilibrium:
                continue
            
            # Check if Player 2 can improve by switching
            for alt_p2_strategy in strategies:
                if alt_p2_strategy == p2_strategy:
                    continue
                current_payoff = payoff_matrix[(p1_strategy, p2_strategy)][1]
                alt_payoff = payoff_matrix[(p1_strategy, alt_p2_strategy)][1]
                if alt_payoff > current_payoff:
                    is_equilibrium = False
                    break
            
            if is_equilibrium:
                equilibria.append((p1_strategy, p2_strategy))
    
    return equilibria

# Example: Find Nash Equilibria in the Prisoner's Dilemma
nash_equilibria = find_nash_equilibria(payoff_matrix)
print(f"Nash Equilibria: {nash_equilibria}")

Repeated Games and Long-Term Strategies

In repeated games, players interact multiple times, allowing for strategies that consider past behavior. This changes the dynamics significantly because players can punish or reward each other over time, enabling cooperation even in scenarios where one-shot interactions would lead to defection. For example, the 'Tit-for-Tat' strategy—where a player starts by cooperating and then mirrors the opponent's last move—has been shown to perform well in repeated Prisoner's Dilemma games. The key insight is that repetition introduces reputation and future consequences, which can stabilize cooperative outcomes. However, the effectiveness of such strategies depends on the discount factor (how much players value future payoffs relative to immediate ones). The code below simulates a repeated game where players use Tit-for-Tat, demonstrating how cooperation can emerge over time.

# Simulate a repeated Prisoner's Dilemma with Tit-for-Tat strategy
def simulate_repeated_game(rounds, initial_strategy='Cooperate'):
    """Simulate a repeated game where both players use Tit-for-Tat."""
    p1_history = []
    p2_history = []
    p1_strategy = initial_strategy
    p2_strategy = initial_strategy
    
    for round_num in range(rounds):
        # Determine current strategies (Tit-for-Tat: mirror opponent's last move)
        if round_num > 0:
            p1_strategy = p2_history[-1]  # Player 1 mirrors Player 2's last move
            p2_strategy = p1_history[-1]  # Player 2 mirrors Player 1's last move
        
        # Record payoffs
        payoff = payoff_matrix[(p1_strategy, p2_strategy)]
        p1_history.append(p1_strategy)
        p2_history.append(p2_strategy)
        
        print(f"Round {round_num + 1}: P1={p1_strategy}, P2={p2_strategy}, Payoffs={payoff}")
    
    return p1_history, p2_history

# Example: Simulate 5 rounds of Tit-for-Tat
print("Simulating repeated Prisoner's Dilemma with Tit-for-Tat:")
simulate_repeated_game(5)

Mixed Strategies and Probabilistic Play

In some games, no pure strategy (a deterministic choice) yields a Nash Equilibrium, and players must randomize their actions. A mixed strategy assigns probabilities to each pure strategy, and the Nash Equilibrium in such cases involves players choosing probabilities that make their opponents indifferent between their own strategies. For example, in Rock-Paper-Scissors, the Nash Equilibrium is for each player to choose each option with equal probability (1/3). The rationale is that if one player deviates from this distribution, the other can exploit the bias. Mixed strategies are particularly useful in zero-sum games, where one player's gain is the other's loss. The code below calculates the Nash Equilibrium for a simplified zero-sum game by solving for the probabilities that make the opponent's expected payoff equal across all strategies.

# Calculate mixed-strategy Nash Equilibrium for a zero-sum game
import numpy as np

def solve_mixed_strategy(payoff_matrix_p1):
    """Solve for mixed-strategy Nash Equilibrium in a 2x2 zero-sum game.
    
    Args:
        payoff_matrix_p1: 2x2 matrix of Player 1's payoffs (Player 2's are negatives).
    
    Returns:
        Tuple of (p1_probabilities, p2_probabilities).
    """
    # Player 2's payoff matrix is the negative of Player 1's
    payoff_matrix_p2 = -np.array(payoff_matrix_p1)
    
    # Solve for Player 1's probabilities (p, 1-p) that make Player 2 indifferent
    # between their strategies
    a, b = payoff_matrix_p2[0, 0], payoff_matrix_p2[0, 1]
    c, d = payoff_matrix_p2[1, 0], payoff_matrix_p2[1, 1]
    p = (d - c) / (a - b - c + d)
    
    # Solve for Player 2's probabilities (q, 1-q) that make Player 1 indifferent
    e, f = payoff_matrix_p1[0, 0], payoff_matrix_p1[0, 1]
    g, h = payoff_matrix_p1[1, 0], payoff_matrix_p1[1, 1]
    q = (h - g) / (e - f - g + h)
    
    return (p, 1 - p), (q, 1 - q)

# Example: Rock-Paper-Scissors simplified to 2x2 (Rock vs. Paper)
payoff_matrix_p1 = [
    [0, -1],  # Player 1 plays Rock: tie (0) or lose (-1)
    [1, 0]     # Player 1 plays Paper: win (1) or tie (0)
]

p1_probs, p2_probs = solve_mixed_strategy(payoff_matrix_p1)
print(f"Player 1's mixed strategy: {p1_probs}")
print(f"Player 2's mixed strategy: {p2_probs}")

Key points

  • Game theory models strategic interactions where outcomes depend on the actions of multiple rational players.
  • A dominant strategy is optimal for a player regardless of what others do, simplifying analysis in some games.
  • Nash Equilibrium identifies stable outcomes where no player can benefit by unilaterally changing their strategy.
  • Repeated games introduce reputation and future consequences, enabling cooperation even in scenarios where one-shot interactions would fail.
  • Mixed strategies involve randomizing actions to make opponents indifferent, which is essential in games without pure-strategy equilibria.
  • Payoff matrices explicitly represent the outcomes of all possible strategy combinations, forming the foundation of game-theoretic analysis.
  • The Prisoner's Dilemma illustrates how individual rationality can lead to collectively suboptimal outcomes in one-shot games.
  • Understanding game theory helps you predict behavior and optimize decisions in competitive or cooperative environments.

Common mistakes

  • Mistake: Assuming all players are rational and will always act in their best interest. Why it's wrong: Real-world players may have bounded rationality, emotions, or incomplete information, leading to suboptimal decisions. Fix: Model players with varying levels of rationality and consider psychological factors in strategic interactions.
  • Mistake: Confusing Nash equilibrium with dominant strategy equilibrium. Why it's wrong: A Nash equilibrium requires that no player can unilaterally improve their payoff, while a dominant strategy equilibrium requires that each player's strategy is optimal regardless of others' choices. Fix: Recognize that dominant strategy equilibria are a subset of Nash equilibria, not all Nash equilibria involve dominant strategies.
  • Mistake: Ignoring the role of information in strategic reasoning. Why it's wrong: Information asymmetry or incomplete information can drastically alter outcomes in games. Fix: Explicitly model information structures (e.g., perfect vs. imperfect information) and how they influence player strategies.
  • Mistake: Overlooking the importance of sequential moves in extensive-form games. Why it's wrong: Treating sequential games as simultaneous can lead to incorrect equilibrium predictions. Fix: Use backward induction or subgame perfect equilibrium to analyze sequential interactions properly.
  • Mistake: Assuming zero-sum games are the only type of strategic interaction. Why it's wrong: Many real-world interactions involve mutual gains or losses (non-zero-sum). Fix: Identify whether the game is zero-sum or non-zero-sum and apply appropriate solution concepts (e.g., minimax for zero-sum, Nash bargaining for non-zero-sum).

Interview questions

What is Game Theory, and why is it important in strategic reasoning?

Game Theory is a mathematical framework used to analyze situations where multiple decision-makers, or 'players,' interact, and the outcome for each depends on the choices of all. It’s crucial in strategic reasoning because it provides tools to model conflicts and cooperation, predict behavior, and identify optimal strategies. For example, in a simple Prisoner’s Dilemma, Game Theory explains why two rational individuals might not cooperate, even if it’s in their best interest, due to the structure of incentives. This helps us understand real-world scenarios like negotiations, auctions, or even cybersecurity, where players must anticipate others' moves to make informed decisions.

Explain the concept of Nash Equilibrium and provide an example.

A Nash Equilibrium is a situation in a game where no player can benefit by unilaterally changing their strategy, assuming other players keep their strategies unchanged. It’s a fundamental concept because it identifies stable outcomes in strategic interactions. For example, consider the Prisoner’s Dilemma: two suspects can either cooperate (stay silent) or defect (betray). The Nash Equilibrium occurs when both defect, even though mutual cooperation would yield a better outcome. This happens because, regardless of what the other player does, defecting is the dominant strategy—it always provides a better payoff. The equilibrium reveals why rational players might end up in suboptimal outcomes.

How does backward induction work in sequential games, and why is it useful?

Backward induction is a method used to solve sequential games by working backward from the end of the game to determine the optimal strategy at each decision point. It’s useful because it helps players anticipate future consequences of their current actions, ensuring they make decisions that maximize their long-term payoff. For instance, in the Ultimatum Game, one player proposes a split of a sum of money, and the other can accept or reject it. If rejected, neither gets anything. Using backward induction, the proposer knows the responder will accept any positive offer, so they propose the smallest possible amount. This approach eliminates non-credible threats and focuses on rational, forward-looking behavior.

Compare and contrast dominant strategies and Nash Equilibrium in strategic reasoning.

Dominant strategies and Nash Equilibrium are both key concepts in Game Theory, but they serve different purposes. A dominant strategy is one that yields the highest payoff for a player, regardless of what others do. For example, in the Prisoner’s Dilemma, defecting is a dominant strategy because it’s always better than cooperating, no matter the other player’s choice. In contrast, a Nash Equilibrium is a state where no player can improve their outcome by changing their strategy unilaterally, even if no dominant strategies exist. While every dominant strategy equilibrium is a Nash Equilibrium, not all Nash Equilibria rely on dominant strategies. For instance, in the Battle of the Sexes game, there are two Nash Equilibria, but neither player has a dominant strategy. The key difference is that dominant strategies focus on individual optimality, while Nash Equilibrium emphasizes mutual consistency in strategies.

How would you model a real-world scenario like an auction using Game Theory? Walk through the steps.

Modeling an auction with Game Theory involves defining the players, their strategies, and the payoffs. First, identify the players—bidders and the auctioneer—and their possible actions, such as bidding or not bidding. Next, specify the rules of the auction, like whether it’s a first-price or second-price auction. For example, in a first-price auction, the highest bidder wins and pays their bid. The payoff for a bidder is the value of the item minus their bid if they win, or zero otherwise. To find the Nash Equilibrium, analyze how bidders adjust their bids based on others' strategies. In a first-price auction, bidders shade their bids below their true value to maximize expected payoff. The equilibrium occurs when no bidder can improve their outcome by changing their bid, given others' strategies. This model helps predict bidding behavior and design auctions that achieve desired outcomes, like maximizing revenue or efficiency.

Explain how mixed strategies work in Game Theory, and provide a real-world example where they might apply.

Mixed strategies involve players randomizing their choices according to specific probabilities to make their actions unpredictable. This is essential in games where no pure strategy Nash Equilibrium exists, such as in the Matching Pennies game, where two players simultaneously choose heads or tails. If one player always picks heads, the other can exploit this by always picking tails. The Nash Equilibrium here is for both players to randomize their choices with a 50% probability for each option, making it impossible for the opponent to gain an advantage. In real-world scenarios, mixed strategies apply to situations like penalty kicks in soccer, where the kicker and goalkeeper must randomize their actions to avoid being predictable. For instance, the kicker might aim left 60% of the time and right 40%, while the goalkeeper dives left 40% and right 60%. This randomization ensures neither player can exploit the other’s tendencies, leading to a stable equilibrium.

All Reasoning interview questions →

Check yourself

1. In the Prisoner's Dilemma, why do players often end up at the Nash equilibrium even though mutual cooperation would yield a better outcome?

  • A.Because the Nash equilibrium is the only outcome where both players receive the highest possible payoff.
  • B.Because each player has a dominant strategy to defect, leading to a suboptimal equilibrium.
  • C.Because the game is zero-sum, so cooperation is impossible.
  • D.Because the players are irrational and fail to recognize the benefits of cooperation.
Show answer

B. Because each player has a dominant strategy to defect, leading to a suboptimal equilibrium.
The correct answer is that each player has a dominant strategy to defect, leading to a suboptimal equilibrium. This is because defecting yields a better payoff regardless of the other player's choice, making it the rational choice. The other options are wrong: (0) is incorrect because the Nash equilibrium is suboptimal; (2) is wrong because the Prisoner's Dilemma is non-zero-sum; (3) is incorrect because the players are acting rationally given the structure of the game.

2. Consider a game where Player A can choose Left or Right, and Player B can choose Up or Down. The payoffs are: (Left, Up) = (3, 3), (Left, Down) = (1, 4), (Right, Up) = (4, 1), (Right, Down) = (2, 2). What is the Nash equilibrium of this game?

  • A.(Left, Up)
  • B.(Right, Down)
  • C.(Left, Down) and (Right, Up)
  • D.There is no Nash equilibrium.
Show answer

C. (Left, Down) and (Right, Up)
The correct answer is (Left, Down) and (Right, Up). These are Nash equilibria because neither player can unilaterally improve their payoff by changing their strategy. For example, in (Left, Down), Player A gets 1 (cannot improve by switching to Right), and Player B gets 4 (cannot improve by switching to Up). The other options are wrong: (0) is not an equilibrium because Player B can improve by switching to Down; (1) is not an equilibrium because both players can improve by switching; (3) is incorrect because equilibria exist.

3. In a sequential game where Player 1 moves first and Player 2 moves second, why might backward induction be used to solve the game?

  • A.Because backward induction ensures that Player 1 always gets the highest payoff.
  • B.Because it allows Player 2 to anticipate Player 1's move and respond optimally, leading to a subgame perfect equilibrium.
  • C.Because sequential games cannot be solved using Nash equilibrium.
  • D.Because backward induction simplifies the game into a simultaneous-move game.
Show answer

B. Because it allows Player 2 to anticipate Player 1's move and respond optimally, leading to a subgame perfect equilibrium.
The correct answer is that backward induction allows Player 2 to anticipate Player 1's move and respond optimally, leading to a subgame perfect equilibrium. This method ensures that the equilibrium is credible and rules out non-credible threats. The other options are wrong: (0) is incorrect because backward induction does not guarantee Player 1 the highest payoff; (2) is wrong because Nash equilibrium can be applied to sequential games (e.g., subgame perfect equilibrium); (3) is incorrect because backward induction preserves the sequential nature of the game.

4. In a game with incomplete information, how does the concept of a Bayesian Nash equilibrium differ from a standard Nash equilibrium?

  • A.Bayesian Nash equilibrium assumes all players have perfect information, while standard Nash equilibrium does not.
  • B.Bayesian Nash equilibrium incorporates players' beliefs about others' types, while standard Nash equilibrium assumes complete information.
  • C.Bayesian Nash equilibrium is only applicable to zero-sum games, while standard Nash equilibrium is not.
  • D.Bayesian Nash equilibrium requires that all players use dominant strategies, while standard Nash equilibrium does not.
Show answer

B. Bayesian Nash equilibrium incorporates players' beliefs about others' types, while standard Nash equilibrium assumes complete information.
The correct answer is that Bayesian Nash equilibrium incorporates players' beliefs about others' types, while standard Nash equilibrium assumes complete information. This allows for modeling strategic interactions where players have private information. The other options are wrong: (0) is incorrect because Bayesian Nash equilibrium deals with incomplete information; (2) is wrong because Bayesian Nash equilibrium applies to all types of games; (3) is incorrect because neither equilibrium concept requires dominant strategies.

5. Why might a player in a repeated game choose to cooperate even if defecting yields a higher immediate payoff?

  • A.Because the player is irrational and does not understand the game's payoffs.
  • B.Because the threat of future punishment (e.g., retaliation) can make cooperation a sustainable strategy.
  • C.Because repeated games always have a unique Nash equilibrium where players cooperate.
  • D.Because the player is forced to cooperate by external rules or regulations.
Show answer

B. Because the threat of future punishment (e.g., retaliation) can make cooperation a sustainable strategy.
The correct answer is that the threat of future punishment (e.g., retaliation) can make cooperation a sustainable strategy. In repeated interactions, players may forgo short-term gains to avoid long-term losses. The other options are wrong: (0) is incorrect because the player may be acting rationally; (2) is wrong because repeated games can have multiple equilibria, including non-cooperative ones; (3) is incorrect because the question assumes no external enforcement.

Take the full Reasoning quiz →

← PreviousMathematical Reasoning and ProofsNext →Causal Reasoning and Counterfactuals

Reasoning

36 lessons, free to read.

All lessons →

Track your progress

Sign in to mark lessons done, score quizzes and keep notes.

Open in the app