🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Backward Reasoning Game Solver

by @quochungto

Solve sequential-move strategic games using backward induction. Use this skill when a user faces a multi-stage decision or negotiation where players alternat...

⚑ When to Use
TriggerAction
The core principle: **Rule 1 β€” Look forward and reason backward.** Anticipate where your initial decisions will ultimately lead and use that information to calculate your best current choice. This rule applies whether the game lasts two moves or two hundred.
The key insight backward reasoning delivers: a future action that "lies in the future does not mean it is uncertain." If you can deduce what a rational opponent will choose at a later node β€” because you know their preferences β€” you can treat that future action as a known fact today when computing your own best move now.
**This skill applies when all of the following hold:**
- Players move in sequence (not simultaneously)
- Earlier moves are observable before the next player responds
- The game ends in a finite number of moves
- Preferences or payoffs at each terminal outcome are known or can be reasonably estimated
**This skill does NOT apply to:**
- Simultaneous-move games (rock-paper-scissors, sealed-bid auctions, price-setting)
- Games with hidden information or private cards
- Infinite-horizon repeated interactions where reputation effects dominate
- Situations with deep uncertainty about opponents' objectives (estimate preferences first, then apply)
---
πŸ’‘ Examples

Example 1: The 21-Flags Game (Survivor: Thailand)

Setup: 21 flags; players alternate; each turn take 1, 2, or 3; player who takes the last flag(s) wins.

Apply k+1 formula (k=3, so k+1=4):

  • Losing positions: 4, 8, 12, 16, 20
  • First player wins by taking 1, leaving opponent with 20
  • Full contingent strategy for first player: Take 1. Whatever opponent takes (n), take 4-n. After your turn the count is always a multiple of 4. Opponent is trapped.

    Why Sook Jai lost: They took 2 on the opening move, leaving 19 β€” not a multiple of 4. This handed the initiative to Chuay Gahn. The tribe needed to reason all the way back to the opening move; recognizing the 4-flag trap mid-game is too late.


    Example 2: The Fredo Investment Game

    Setup: Charlie considers investing $100K with Fredo. If Charlie invests, Fredo can honor the contract (Charlie nets $150K, Fredo nets $250K) or abscond (Charlie loses $100K, Fredo keeps $500K). If Charlie does not invest, both get $0.

    Game tree:

    Charlie
    β”œβ”€β”€ Invest β†’ Fredo
    β”‚             β”œβ”€β”€ Abscond β†’ [Charlie: -$100K, Fredo: +$500K]
    β”‚             └── Honor   β†’ [Charlie: +$150K, Fredo: +$250K]
    └── Don't  β†’ [Charlie: $0, Fredo: $0]
    

    Backward induction at Fredo's node: Fredo prefers $500K over $250K β†’ will Abscond.

    Fold back: If Charlie invests, realized outcome is [Charlie: -$100K]. Compare to Don't: [Charlie: $0]. Charlie prefers $0 β†’ Don't invest.

    Equilibrium: No investment; both get $0. The mutually beneficial outcome ($150K/$250K) is blocked by the inability to commit credibly.

    Caveat: This changes if the game is repeated or if Fredo has other US-dependent business interests β€” these create an ongoing game with reputation effects that can sustain cooperation.


    Example 3: The Orange Bowl Risk Sequencing

    Setup: Nebraska needs 2 extra points net across two touchdowns. Option A: two-point conversion attempt (~50% success). Option B: one-point kick (~95% success). Osborne's order: B then A. Alternative: A then B.

    Backward induction on Osborne's order (B first):

  • If B succeeds and A succeeds β†’ win (needed outcome)
  • If B succeeds and A fails β†’ lose (no recovery)
  • If B fails and A succeeds β†’ tie (acceptable)
  • If B fails and A fails β†’ lose
  • Backward induction on alternative order (A first):

  • If A succeeds and B succeeds β†’ win
  • If A succeeds and B fails β†’ still ahead; other outcomes now favorable
  • If A fails β†’ still score second touchdown; one-point kick gives tie (acceptable)
  • If A fails and score another: now need exactly 2 points β€” same situation as Osborne faced but with a remaining chance
  • Key insight: The only scenario where order matters is when exactly one attempt fails. If A fails first, the fallback (B on the second touchdown) still yields a tie. If B fails first (Osborne's plan), the second touchdown forces a must-make two-pointer with no margin. Attempt the risky action first.


    View on ClawHub
    TERMINAL
    clawhub install bookforge-backward-reasoning-game-solver

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’