Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|cite|improve this question
up vote 5 down vote accepted

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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