I'm looking to find the probability of selecting a given number M given a set of N numbers in a bounded range (or potentially in several differently bounded ranges, but I'm starting simple). I'm trying to come up with the probability of a number of dice rolls, so as an example, given that I roll 3 six-sided die, what is the probability of a 10? Or, given five 20-sided die, what is the probability of a 64?
I know that in the case of the 3 six-sided die, the chance of an 18 or a 3 are both (1/6)^3, or 1/216, because only a single combination of values can produce either 3 or 18. But what about a number like 10? It has multiple combinations that can produce it, like 3+3+4, or 6+2+2. I know that there are 216 unique paths available given the three six-sided die, and that the end probability of rolling any number M will then be the number of unique paths that produce a number times 1/216, which should work even given a number outside the summable range (Since the number of unique paths that could equal that number would be 0).
So I guess my question really boils down to: how can I determine the number of unique paths or combinations that will sum to any given number?
Say you want $N$ dice with $s$ sides each to add up to $M$. This corresponds to distributing $M$ balls into $N$ non-empty bins with capacity $s$, or equivalently distributing $M-N$ balls into (possibly empty) bins with capacity $s-1$. The number of ways of doing this can be calculated using inclusion-exclusion, and the result is given at Balls In Bins With Limited Capacity (which also covers the case of different capacities that you're potentially interested in). For the above dice throw, the result is
$$ \sum_{t=0}^N(-1)^t\binom Nt\binom{M-st-1}{N-1}\;, $$
where, contrary to convention, the binomial coefficient is taken to be $0$ if the upper index is negative. This needs to be divided by $s^N$, the total number of possible throws.
In your first example, $N=3$, $s=6$ and $M=10$, which gives the probability
\begin{align} &\frac1{6^3}\sum_{t=0}^3(-1)^t\binom 3t\binom{10-6t-1}{3-1}\\ ={}&\frac{\binom92-3\binom32}{6^3}\\ ={}&\frac{36-9}{6^3}&\\ ={}&\frac18\;. \end{align}
In your second example, $N=5$, $s=20$ and $M=64$, which gives the probability
\begin{align} &\frac1{20^5}\sum_{t=0}^5(-1)^t\binom 5t\binom{64-20t-1}{5-1}\\ ={}&\frac{\binom{63}4-5\binom{43}4+10\binom{23}4}{20^5}\\ ={}&\frac{595665-617050+88550}{20^5}\\ ={}&\frac{67165}{20^5}\\ ={}&\frac{13433}{640000}\\ \approx{}&0.021\;. \end{align}