Game Theory & Strategies
In competitive games, the best outcome depends not only on your own decisions but also on the choices made by others. Strategic thinking helps you find optimal moves.
Game theory puzzles teach you to think ahead, anticipate your opponent's moves, and discover strategies that guarantee victory. Every game below has an optimal strategy—can you find it?
Game Theory & Strategies
In the realm of strategic games, your success depends on more than just your own choices—it hinges on understanding and anticipating the decisions of others. This is the essence of game theory: analyzing how players interact, compete, and cooperate when their outcomes are interconnected.
These puzzles teach you to think several moves ahead, identify winning and losing positions, and discover strategies that guarantee victory regardless of your opponent's actions.
What is a Strategy?
A strategy in game theory is a complete plan of action: a rule that tells you what move to make in every possible situation. The best strategies are often based on mathematical principles rather than intuition.
Example: The Clock Game
Two players take turns moving a clock hand forward by either 2 or 3 hours. Starting at 12, whoever lands on 6 wins.
Question: Who wins with perfect play?
The key insight is to work backwards from the goal (6) and identify cold squares—positions where the current player will lose if both play optimally.
Core Concepts
Winning and Losing Positions
- Winning position: The current player has a move that guarantees victory
- Losing position (cold): Every possible move leads to a winning position for the opponent
- Strategy: Always move to put your opponent in a losing position
Common Game Types
| Game Type | Description | Example |
|---|---|---|
| Nim-like | Remove objects from piles | Classic Nim, stone piles |
| Territory | Control squares or positions | Domino tiling, rook placement |
| Race to goal | First to reach a target wins | Rook race to h8, clock to 6 |
| Number games | Manipulate digits or values | Divisible by 9, digit subtraction |
Key Techniques
1. Backwards Analysis
Work from the winning state backwards to identify all losing positions:
- If the goal is to reach position X, what positions lead only to X?
- Mark those as "must avoid" (losing for the previous player)
2. Symmetry Strategy
In many games, the second player can win by mirroring the first player's moves:
- Non-attacking rooks: mirror across the diagonal
- Domino tiling: mirror placement strategy
- This works when the game board has natural symmetry
3. Invariants
Some quantity remains constant or follows a pattern:
- Total stones (in closed systems)
- Parity (odd/even) of remaining moves
- Sum modulo some number
4. State Space Search
Model the game as a graph where:
- Nodes = game states (board configurations)
- Edges = legal moves
- Terminal nodes = winning/losing positions
Working backwards from terminal states, you can label every position as W (winning) or L (losing).
Example: Nim with Equal Piles
Setup: Two piles with the same number of stones. Players take turns removing any number of stones from exactly one pile. Taking the last stone wins.
Strategy: The second player wins by mirroring—whenever you take k stones from one pile, they take k from the other pile, maintaining equality. Eventually, you'll be forced to take from the last pile, leaving them with the winning move.
Try It Yourself
Use the sandbox below to explore various game theory puzzles:
- Adjust initial configurations
- Play against an optimal bot
- Discover winning strategies through experimentation
Practice with the linked problems below, or create your own variants to challenge friends.
Mathematical Background
Game theory connects to:
- Combinatorial game theory: Analysis of sequential games with perfect information
- Graph theory: Modeling game states as directed graphs
- Number theory: Nim-values, XOR operations, and modular arithmetic
- Invariant principles: Quantities preserved under legal moves
These puzzles develop crucial skills in:
- Strategic thinking and planning ahead
- Pattern recognition in complex systems
- Logical deduction and proof
- Algorithmic reasoning
Whether you're playing to win or analyzing the mathematics behind optimal strategies, these games offer endless opportunities for discovery and learning.
Try different starting positions, play against optimal bots, and discover winning strategies for classic combinatorial games.
Open Sandbox