Dynamic Programming21 sections · 916 units
Open in Course

Lessons from Game Theory DP

summary

Three patterns you've seen:

1.1. Score difference: Track dp[state]=dp[\text{state}] = my score - opponent's score. Opponent's gain is my loss (subtraction).

2.2. Extra parameters: Some games have changing rules (like MM in Stone Game II). Include them in the state.

3.3. Bitmask + game theory: When tracking used elements from a small set, combine bitmask DP with minimax thinking. The core stays the same: I win if I have any move that puts opponent in a losing state. I lose if all my moves put opponent in a winning state.