The question can be described as follows. You have a die that rolls between 1 and W max points. You stop rolling when you hit K points. What is the probability you get N points or less? This is actually this leetcode question here: https://leetcode.com/problems/new-21-game/.
I am really confused by the posted solution so I thought I would ask on math.stackexchange. In the solution, people calculate the probability of getting i points where i is any number between 1 and K + W - 1. This is because you stop rolling when you hit K points.
Then, the final solution is given as the sum of the probabilities you found between K and N. This seems incorrect to me. Shouldn't it be a conditional probability? Shouldn't it be the sum of the probabilities from K to N divided by the sum of the probabilities from K and K + W - 1.
If anyone could enlighten me here, that would be appreciated.