由买买提看人间百态

topics

全部话题 - 话题: probw
(共0页)
a*****2
发帖数: 96
1
来自主题: JobHunting版 - twitter店面(攒点人品)
dp[0][j] = 0, j = 0,1,...,R
dp[i][0] = 1, i = 1,...,W
for i in 1:W+1
for j in 1:R+1
probW = i/(i+j)
probR = j/(i+j)
probRandomAndEat = probW * dp[i-1][j] + probR*[i][j-1]
dp[i][j] = probW * dp[i-1][j] + probR* probRandomAndEat
return dp[W][R]
(共0页)