My solution: First, put one ball at each box and then distribute the remaining 3 balls in 7 boxes.
$p=1-\frac{\binom{9} {3} }{\binom{16}{10}}$
Is this correct?
Or?
$p=1-\frac{\binom{10} {7} 7!7^3}{7^{10} }$
My solution: First, put one ball at each box and then distribute the remaining 3 balls in 7 boxes.
$p=1-\frac{\binom{9} {3} }{\binom{16}{10}}$
Is this correct?
Or?
$p=1-\frac{\binom{10} {7} 7!7^3}{7^{10} }$
Your first approach uses stars and bars method and you should not be using for computing probability as the events are not uniformly distributed.
So your second approach is what you need to take (considering each ball distinct) -
Say the event of distributing $10$ balls in $7$ boxes without restriction is $A$.
Say the event of distributing $10$ balls in $7$ boxes such that no boxes are empty is $B$.
Number of ways for $A = 7^{10}$
Number of ways for $B = 7! \times {10 \brace 7} = 29635200$ where ${n \brace k}$ is the Stirling Number of the second kind. It places $n$ distinguishable objects into $k$ indistinguishable heaps.
So desired probability where at least one box is empty $= 1 - \frac{29635200}{7^{10}} \approx 0.895 $
Instead of using Stirling Number of the second kind, you could also use principle of inclusion exclusion.
Number of ways for $B = \sum \limits_{i = 0}^{7} (-1)^i {7 \choose i} (7-i)^{10} = 29635200$
Let's have a look at your two attempts and then discuss a third option.
In the first one you use the formula for combinations with repetition. Let $x_i\in \mathbb{Z}_{\geq 0}$ be the number of balls that end up in the $i$-th box. Indeed there are $\displaystyle\left(\!\!\binom{7}{10}\!\!\right) = \binom{16}{10}$ possible assignments of values to $x_1,x_2,\ldots,x_7$ such that $x_1+x_2+\ldots+x_7 = 10$. But these assignments are not equally probable. For example, there is only one way to get the assignment $x_1=10, x_2=\ldots=x_7=0$. Namely, every ball has to go into the first box. That happens with probability $7^{-10}$. On the other hand, there are many ways to get the assignment $x_1=4, x_2=\ldots=x_7=1$, $\binom{10}{4} \cdot 6!$ to be exact. Each of these ways is equally probable; it happens with probability $7^{-10}$. With this in mind, you could classify the assignments that result in no box being empty. Such an assignment...
4
and six 1
s. There $7 \cdot \binom{10}{4}\cdot 6!$ ways to get such an assignment.3
, one 2
and five 1
s. $\#\text{ways} = 7\cdot \binom{10}{3} \cdot 6 \cdot \binom{10-3}{2} \cdot 5!$2
s and four 1
s. $\#\text{ways} = \binom{7}{3}\cdot \binom{10}{2} \cdot \binom{10-2}{2} \cdot \binom{10-2-2}{2} \cdot 4!$.Dividing the sum of the above by $7^{10}$ gives you the probability that no box ends up empty.
$ $
Let's now have a look at your second attempt. You calculated the number of ways that no box ends up empty to be $\binom{10}{7}\cdot 7! \cdot 7^3$. So you choose seven of your balls, you put them in a different box each, and then you are left with three balls which you can put anywhere. This is on the right track but has one problem. Consider the scenario where four balls end up in one box. Which of the four was included in your initial choice of seven balls? It could be any one of them! So you have counted this scenario $4$ times - one for each of those four balls. Similarly, if you end up with a box with three balls and another with two, you have counted that scenario $3\cdot 2 = 6$ times. And if you end up with three boxes with two balls each, you have counted that scenario $2^3=8$ times. So, once again, you start by choosing seven balls, putting each into a different box, and you are left with three balls. You have to consider what scenario will result in each way you put those three into boxes, and divide by the number found above. This way you'll avoid double-counting. $$\displaystyle\binom{10}{7}\cdot 7! \cdot \left(\frac 74 + \frac{7 \cdot \binom{3}{2} \cdot 6}{6} + \frac{\binom{7}{3}\cdot 3!}{8}\right)$$ Dividing this by $7^{10}$ you will get the same result as before.
$ $
Another way to attack the problem is to use the inclusion-exclusion principle. Let $p_i$ be the probability that $i$ given boxes end up empty. Then $p_i = \dfrac{(7-i)^{10}}{7^{10}}$. The probability that at least one of the boxes does end up empty is $$\sum_{i=1}^7(-1)^{i+1}\binom{7}{i}p_i.$$