Mathematical expectation P=Σ each state * the corresponding probability.
The conventional dp[x] may indicate how much the state has reached x, and the final answer is dp[n]. The mathematical expectation of dp[x] generally indicates how much worse the state of x is, and the final answer is dp[0].
And so on
https://blog.csdn.net/LLL_yx/article/details/81262564
The best learning probability dp article I have seen so far