Here's the formula you'll use in every probability DP problem: In words: the value at dp[pos] equals the sum over all possible next states of (probability of going there) times (value from there).
This is just expected value applied to DP. For probability problems, is the probability of some event. For expected value problems, is the expected outcome. The formula stays the same.