I have 4 unlabeled (identical) blue balls and 2 identical redz balls and 5 different (distinct) boxes. In how many ways all balls can be placed in these 5 boxes?


I will assume that you know how to count the number of ways to distribute $n$ identical candies among $r$ children. Compute this number for the blue balls, call it $B$. Compute this number for the red balls. Call it $R$. For every way of distributing the blue balls, there are $R$ ways to distribute the red balls, so our total is $BR$.

If you do not know how to solve the general $n$ candy $r$ child problem, I suggest you look at the Wikipedia article on Stars and Bars. The answer turns out to be $\binom{n+r-1}{r-1}$. The reasoning is well-described in the Wikipedia article, and in several MSE answers.

For our particular very small numbers, $B$ and $R$ can also be computed by making careful lists.

  • $\begingroup$ My problems is, does the formula hold for r>n? I applied it like that and the answer is B=70 and R=15. So If what I did is right they can be computed by making careful lists, but it is a bit of overkill $\endgroup$ – asd11 Jun 22 '19 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.