Dynamic Programming21 sections · 916 units
Open in Course

Pattern - When to Use Probability DP

Recognizing the pattern

Use probability DP when: you need probability of an outcome after a sequence of random events. Signals: "probability of", "expected value", "random choice", "uniform distribution", "Monte Carlo" (but DP is exact).

State: typically (step,current_position)(step, current\_position) or (step,accumulated_value)(step, accumulated\_value). Transitions: weighted by probabilities. The difference from counting DP: transitions multiply by probability instead of adding counts. But linearity of expectation often lets us sum contributions.