Dynamic Programming21 sections · 916 units
Open in Course

Lessons from Out of Boundary

summary

1.1. Counting paths uses the same structure as probability. Sum over transitions instead of weighted sum.

2.2. What counts as "success" changes the base case. Here, leaving the grid returns 11.

3.3. Modular arithmetic is needed when counting. Probabilities stay between 00 and 11, but counts explode. Notice how similar the code is to Knight Probability? State and transition structure are identical. Only the base cases and arithmetic differ.