Roll a fair m-sided die repeatedly until a roll comes out strictly greater than k. Return the expected sum of every roll, the stopping one included.
m
k
Split it in two:
Input
m = 6 k = 4
Output
10.5
This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.
solve(...)