# Stars, ships, and bars: On the distribution of multiple types of items into distinct boxes

I recently came across this question in my textbook:

In how many ways can you distribute $$3 ~\text{blue},~ 4~ \text{white}$$ and $$2~ \text{red}$$ balls be distributed into $$4$$ distinct boxes?

My first thought (and in fact the suggested solution in my textbook) was to apply the principle of Stars and Bars to each of the Colorado and take their composite. The answer would evaluate to $$\binom 63\cdot\binom 73\cdot\binom 53 = 7000$$, an agreeable number.

However, I figured a more ‘organic’ method would be to derive a more general Stars and Bars for multiple types of objects. The way I went about this was to paraphrase this evaluation as an arrangement of $$n-1$$ bars and $$r_1$$ of some object, $$r_2$$ of another $$\dots$$, $$r_k$$ of a $$k^{th}$$ kind. The number of distinct arrangements of these elements would be $$(n-1+r_1+r_2\dots r_k)!\over (n-1)!r_1!r_2!\dots r_k!$$ or if we were to write the total number of objects $$r_i$$ as $$r$$ we have the more shorthand notation $$(n+r-1)!\over (n-1)!\displaystyle\prod_{i=1}^k r_i!$$

But, using this principle on this problem we have $$12!\over 3!3!4!2!$$ which at first glance looks extraordinarily large. In fact it evaluates to over $$277000$$ which is conceivably less agreeable than $$7000$$. (Please don’t question the language of “agreeable”).

What is wrong with this approach? (Or is it the earlier approach that is in fact incorrect?)

• Be careful. An arrangement where in the first box you have a red ball then a blue ball and then the rest of the balls distributed somehow among the remaining boxes should be considered the same as an arrangement where in the first box you have a blue ball then a red ball and the rest of the balls distributed in the same way. Order within a box should not matter, but according to your attempt you made it so that it did matter. – JMoravitz Nov 25 '19 at 15:49
• Whether or not you decide that order within a box matters will determine which of the answers you get. Order within a box not mattering giving you the earlier result. Order within a box mattering giving you the later result. Both are correct depending on what interpretation of the problem you are using, but again, it is far more common to use the first interpretation. – JMoravitz Nov 25 '19 at 15:52