3

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?

WebbH
  • 141
  • 1
    There are not too many cases. What have you tried? –  Aug 04 '17 at 20:20
  • If you don't mind using technology., consider the generating function $\frac{1}{10^9}(x+x^2+x^3+\dots+x^{10})^9(1+x+x^2+\dots+x^{20})$ – JMoravitz Aug 04 '17 at 20:20
  • @Jack "not too many cases"... $10^9$ isn't too many cases? The question where all nine of the numbers must be distinct is boring and trivial, giving an immediate answer of a probability of zero, and the question where the numbers can repeat makes quite a few cases, too many in my opinion to do by hand – JMoravitz Aug 04 '17 at 20:23
  • 3
    @JMoravitz: Let $X_1+\cdots+X_9=k$. Then one needs only to consider $k=9, 10,\cdots,19$. I don't say this is easy. But obviously you are thinking about the word "case" in a very different way. –  Aug 04 '17 at 20:32
  • 1
    Is don't sum to $20$ not summing to exactly $20$ or summing to something less than $20$? The title and the body disagree. The answer you accepted takes it as not summing to exactly $20$. awkward's and my answers took it as summing to something less. I will update mine. – Ross Millikan Aug 05 '17 at 02:25

5 Answers5

3

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}$$

awkward
  • 14,736
1

To compute this probability, you need to know two things:

  1. How many different ways are there of drawing 9 numbers that add to 20?
  2. How many different ways are there of choosing 9 numbers?

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).

0

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.

Michael Lugo
  • 22,354
0

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.

G Cab
  • 35,272
0

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}}$

Ross Millikan
  • 374,822