I can't solve this combinatorics problem.

How many ways can you distribute 23 blue numbered balls and 7 green indistinguishable balls in 12 numbered boxes so that there is at most 1 green ball in each box and the first box is not empty.

Thank you very much!


1 Answer 1


Split the problem in two cases, one when the first box contains a green ball and the second one when it doesn't

If the first box contains a green ball then first choose the boxes containing the green balls, as they are indistinguishable there are $\binom{11}{6}$ choices, as the first ball already has a ball. Now each of the 23 blue balls can be put in any of the boxes, so there are $\binom{11}{6} \cdot 12^{23}$ configurations.

Now if the first box doesn't contain a green ball similarly there are $\binom{11}{7}$ ways to choose the boxes containin the green balls and $12^{23}$ ways to distribute the blue balls. But note it's possible for the first boxes to be empty, so we have to subtract the "bad" configurations. There are exactly $\binom{11}{7} \cdot 11^{23}$ such configurations and finally the wanted number is:

$$\binom{11}{6} \cdot 12^{23} + \binom{11}{7} \cdot 12^{23} - \binom{11}{7} \cdot 11^{23}$$

  • 1
    $\begingroup$ Thank you for the quick response. Why is it 11^23 for the bad configurations? $\endgroup$ Dec 3, 2017 at 21:38
  • $\begingroup$ @JuanGulbis That's because we have 11 options for each ball. Remember we're trying to keep the first box empty, so we don't out any ball there $\endgroup$
    – Stefan4024
    Dec 4, 2017 at 4:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .