Dynamic Programming21 sections · 916 units
Open in Course

Lessons from Soup Servings

summary

1.1. Scale down to reduce state space. Dividing by 2525 turned 10910^9 states into 200200.

2.2. Use mathematical observation to shortcut. For large nn, one outcome dominates, so return early.

3.3. Multiple stopping conditions need careful base cases. Both empty vs A empty vs B empty. This problem shows that probability DP often needs problem-specific tricks. Understanding the math helps. Apply these patterns when you encounter similar problems.