Learning path · 5 labs

Combinatorial Games

Which move guarantees a win?

Study games in which players take turns changing a visible position. Begin with a single pile, build up to Nim and graph games, then use those ideas to analyze sums and rooted structures.

A suggested learning path

Follow the sequence, or jump directly to the question that interests you. Each lab opens in Guided Learning; switch to Sandbox at any time to experiment freely.

  1. Step 1

    Take-Away

    Learn winning and losing positions by working backward from the end.

    Learning outcome: Classify positions as winning or losing by working backward, then pick a winning move.

    Level
    Introductory
    Time
    About 15 min
    Concepts
    P-positions · N-positions · Backward induction
    A row of five tokens from which a player removes one or two, leaving a smaller pile.
  2. Step 2

    Nim

    Extend the idea to several piles and understand binary XOR.

    Learning outcome: Use the binary nim-sum to decide who wins a Nim position and find a winning move.

    Level
    Introductory
    Time
    About 20 min
    Concepts
    Nim-sum (XOR) · Bouton's theorem · Misère play
    Three piles of tokens, with two tokens being removed from the tallest pile.
  3. Step 3

    Graph Games

    Describe legal moves with arrows and calculate Sprague–Grundy values.

    Learning outcome: Compute Sprague–Grundy values on a directed graph with the minimum-excluded rule.

    Level
    Intermediate
    Time
    About 20 min
    Concepts
    Sprague–Grundy value · mex · Followers
    A directed graph of five vertices with a token on the start vertex and one highlighted move.
  4. Step 4

    Sum of Games

    Combine independent games using their values.

    Learning outcome: Combine the Grundy values of independent games with XOR to play their sum.

    Level
    Intermediate
    Time
    About 20 min
    Concepts
    Game sums · Sprague–Grundy theorem · Nim-sum
    Three piles of one, two and three tokens combined as 1 XOR 2 XOR 3 equals 0.
  5. Step 5

    Hackenbush

    Apply the ideas to cuts, connectivity and supported structures.

    Learning outcome: Replace rooted Green Hackenbush branches by equivalent Nim heaps and choose a winning cut.

    Level
    Intermediate
    Time
    About 25 min
    Concepts
    Green Hackenbush · Colon principle · Equivalent Nim heap
    A rooted Hackenbush tree standing on the ground, with blue and red edges and yellow vertices.