If I select 9 random numbers from 1 to 10, what is the probability that their sum is less than 20?
Is there someway to figure this out without manually figuring out each possible scenario in which the 9 digits don't sum to 20?
If I select 9 random numbers from 1 to 10, what is the probability that their sum is less than 20?
Is there someway to figure this out without manually figuring out each possible scenario in which the 9 digits don't sum to 20?
A generating function approach yields the result without too much computation.
If we choose 9 integers from 1 to 10, there are $10^9$ possible outcomes, all of which we assume are equally likely. We want to count the outcomes in which the total is less than or equal to 19, i.e. the number of solutions in integers to $$x_1 + x_2 + x_3 + \dots +x_9 \le 19$$ subject to $1 \le x_i \le 10$ for $i = 1,2,3, \dots ,9$.
An equivalent problem is to count the number of solutions to $$x_1 + x_2 + x_3 + \dots +x_9 + y = 19$$ subject to $1 \le x_i \le 10$ for $i = 1,2,3, \dots ,9$ and $0 \le y$. The generating function for the number of solutions to $$x_1 + x_2 + x_3 + \dots +x_9 + y = r$$ subject to the above constraints is $$\begin{align} f(z) &= (z + z^2 + z^3 + \dots + z^{10})^9 \; (1 + z + z^2 + \dots) \\ &= z^9 \; \left( \frac{1-z^{10}}{1-z} \right)^9 \frac{1}{1-z}\\ &= z^9 \; (1-z^{10})^9 \; (1-z)^{-10} \\ &= z^9 \cdot \sum_{i=0}^9 (-1)^i \binom{9}{i}z^{10 i} \cdot \sum_{j=0}^{\infty} \binom{10+j-1}{j} z^j \end{align}$$
From the last equation we can easily find the coefficient of $z^{19}$, which is $$[z^{19}] f(z) = 1 \cdot \binom{19}{10} - \binom{9}{1} \cdot 1 = 92,369$$
So the probability of getting a sum less than or equal to 19 is $$\frac{92,369}{10^9} = 9.2369 \times 10^{-5}$$
To compute this probability, you need to know two things:
The probability of drawing numbers that sum to 20 is then the ratio of these two, so the probability that you want is 1 minus this ratio. The second question is pretty straightforward: you have 10 choices for the first number, 10 choices for the second number, etc. Thus there are a total of $10^9$ ways of choosing 9 numbers.
The first question is a little harder, but not impossible if you think about it the right way. I would suggest that the "right way" to think about it is a Stars and Bars diagram. To get 9 numbers that add to 20, you can draw 20 stars, then put 8 bars between them (dividing 20 into 9 pieces---count the number of stars in each piece). There are a total of 19 places in which you could put bars, of which you need to choose 8. Hence there are $$ \binom{19}{8} = \frac{19!}{8!(19-8)!} = \frac{19!}{8!11!} $$ different ways of choosing 9 numbers that sum to 20. Note that this overcounts a bit---we would need to eliminate the choices that include the selection of 11 or 12. But this should be doable by hand (there aren't very many ways of including 11, and only one way (modulo permutation) that I can see of including 12).
Let $f(n, k)$ be the number of solutions to $x_1 + x_2 + \cdots + x_n = k$ with each $x_i$ in $\{1 , 2, \ldots, 10\}$. You're looking for
$${f(9, 9) + f(9, 10) + \cdots + f(9, 19) \over 10^9}$$
(where I've started with $k = 9$ in the numerator because your nine numbers obviously can't sum to less than 9.
You can set up the recurrence: $$f(1, 1) = f(1, 2) = \ldots = f(1, 10) = 1$$ and $$f(n, k) = f(n-1, k-1) + f(n-1, k-2) + \cdots + f(n-1, k-10)$$ for $n \ge 2$ (where we'll say $f(n, k) = 0$ if $k$ is non-positive).
Then it's just some annoying arithmetic to get the number you want.
So you are looking for $$ \eqalign{ & {\rm No}{\rm .}\,{\rm of}\,{\rm solutions}\,{\rm to}\;\left\{ \matrix{ {\rm 1} \le {\rm integer}\;x_{\,j} \le 10 \hfill \cr x_{\,1} + x_{\,2} + \; \cdots \; + x_{\,9} < 20 \hfill \cr} \right. = \cr & = {\rm No}{\rm .}\,{\rm of}\,{\rm solutions}\,{\rm to}\;\left\{ \matrix{ {\rm 0} \le {\rm integer}\;y_{\,j} \le 9 \hfill \cr y_{\,1} + y_{\,2} + \; \cdots \; + y_{\,9} < 11 \hfill \cr} \right. \cr} $$
In this post it is extensively explained that $$N_{\,b} (s,r,m) = \text{No}\text{. of solutions to}\;\left\{ \begin{gathered} 0 \leqslant \text{integer }x_{\,j} \leqslant r \hfill \\ x_{\,1} + x_{\,2} + \cdots + x_{\,m} = s \hfill \\ \end{gathered} \right.$$ is given by $$ \bbox[lightyellow] { N_b (s,r,m)\quad \left| {\;0 \leqslant \text{integers }s,m,r} \right.\quad = \sum\limits_{\left( {0\, \leqslant } \right)\,\,k\,\,\left( { \leqslant \,\frac{s} {r}\, \leqslant \,m} \right)} {\left( { - 1} \right)^k \left( \begin{gathered} m \hfill \\ k \hfill \\ \end{gathered} \right)\left( \begin{gathered} s + m - 1 - k\left( {r + 1} \right) \\ s - k\left( {r + 1} \right) \\ \end{gathered} \right)} } \tag{1}$$
Since $$ \eqalign{ & \sum\limits_{0\, \le \,\,k\,\, \le \,t} {\left( \matrix{ k + a \cr k - b \cr} \right)} \quad \left| {\;0 \le {\rm integer }b} \right.\quad = \cr & = \sum\limits_{\left( {0\, \le } \right)\,\,k\,\, \le \,t} {\left( \matrix{ t - k \cr t - k \cr} \right)\left( \matrix{ k + a \cr k - b \cr} \right)} = \left( \matrix{ t + a + 1 \cr t - b \cr} \right) \cr} $$ It is easy to get that the sum of $N_b$ for $s$ from $0$ to $t$ is $$ \bbox[lightyellow] { \eqalign{ & M_b (t,r,m)\quad \left| {\;0 \le {\rm integer }t,r,m} \right.\quad = \cr & = \sum\limits_{0\, \le \,\,s\,\, \le \,t} {N_b (s,r,m)} = \cr & = \sum\limits_{\left( {0\, \le } \right)\,\,j\,\,\left( { \le \,{t \over r}\, \le \,m} \right)} {\left( { - 1} \right)^j \left( \matrix{ m \hfill \cr j \hfill \cr} \right)\left( \matrix{ t + m - j\left( {r + 1} \right) \cr t - j\left( {r + 1} \right) \cr} \right)} \cr} } \tag{2}$$
Thus in your case we have $$ \bbox[lightyellow] { \eqalign{ & M_b (10,9,9) = \sum\limits_{\left( {0\, \le } \right)\,\,j\,\,\left( { \le \,{{10} \over 9}\,} \right)} {\left( { - 1} \right)^j \left( \matrix{ 9 \hfill \cr j \hfill \cr} \right)\left( \matrix{ 10 + 9 - j10 \cr 10 - j10 \cr} \right)} = \cr & = \sum\limits_{\left( {0\, \le } \right)\,\,j\,\,\left( { \le \,1\,} \right)} {\left( { - 1} \right)^j \left( \matrix{ 9 \hfill \cr j \hfill \cr} \right)\left( \matrix{ 19 - j10 \cr 10 - j10 \cr} \right)} = \left( \matrix{ 19 \cr 10 \cr} \right) - 9\left( \matrix{ 9 \cr 0 \cr} \right) = \cr & = 92369 \cr} } \tag{3}$$
To counter check it, and provide another method as well (which in this particular case is workable), note that the number of weak compositions of $ s $ into 9 parts is equal to $$ \left( \matrix{ s + 9 - 1 \cr 9 - 1 \cr} \right) = \left( \matrix{ s + 8 \cr 8 \cr} \right) = \left( \matrix{ s + 8 \cr s \cr} \right) $$ the sum of them for $s$ from $0$ to $10$ is $$ \sum\limits_{0\, \le \,\,s\,\, \le \,10} {\left( \matrix{ s + 8 \cr 8 \cr} \right)} = \left( \matrix{ 19 \cr 10 \cr} \right) $$ but when $s=10$ the weak compositions also include the case $(0, 0, \cdots,10)$ in its $9$ permutations, so you get the above minus nine.
A simple computational approach is with a spreadsheet. Make a column with the numbers 1-20 to represent sums and have ten blank lines above. Each column to the right will have the number of ways to get the sums with one more number chosen. When you have just one number, there is one way to get the sums $1-10$ and no ways to get any other, so put those numbers in a column. In the next column, which gives the number of ways to get each sum with two numbers, each cell gets the sum of the ten lines above in the column one to the left. Write that formula once and copy right and down. The number of ways to get a sum of exactly $20$ is $75501$, so the chance you will get a sum of something other than $20$ is $\frac {10^9-75501}{10^9}$. If you want a sum less than $20$, I find $92369$ ways to get a sum of $9-19$, for a probability of $\frac {92369}{10^{9}}$