# Probability of getting less than N points given that you get at least K

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.

• If you stop if and only if you have accumulated $K$ points, then the sum of probabilities between $K$ and $K+W-1$ inclusive is $1$ Sep 19, 2021 at 1:44
• Yes this is what i am claiming but this is not what the solution on leetcode says. Sep 19, 2021 at 1:48
• i may be missing something here. Sum of probabilities from $K$ to $N$, divided or not divided by the sum of probabilities from $K$ to $K+W-1$ are the same because the later is $1$ right? Sep 19, 2021 at 1:51
• How can we prove this though? Sep 19, 2021 at 2:15
• As long as you are sure that all possible outcomes are in $[K,K+W-1]$ then the sum of probabilities there must be $1$ Sep 19, 2021 at 2:35