# Combinatorics, distributing balls in boxes

We've got the following problem:

Given $$10$$ boxes and $$30$$ balls such that $$10$$ balls are red, $$10$$ are blue and $$10$$ are green (balls of the same color are indistinguishable), how many ways are there to put the $$30$$ balls in the $$10$$ boxes knowing that some boxes may remain empty?

My attempt: First, I noticed that the problem doesn't specify if the boxes are distinguishable or not so I will try to answer for both cases, consider first the case when the boxes are distinguishable, I tried to break down the problem into 3 distribution problems, I did as follows:

We choose one of the three colors, say red, we have $${19 \choose 9}$$ ways to put the $$10$$ balls in the $$10$$ boxes.

The same is true no matter what color we choose, now, if I take one configuration of the red balls, I have $${19 \choose 9}$$ ways to add the blue balls to the "red filled" boxes, thus, to place red and blue in the boxes I would have: $${19 \choose 9}^2$$

By similar arguement when I add the green balls I would end up with $${19 \choose 9}^3$$ possibilities.

Now the second case, if the boxes are indistinguishable every time we count how to distribute a certain color we overcount by a factor of $$10!$$ so to fix that we should have $$\frac{{19 \choose 9}^3}{10!^3}$$

I may have done some silly mistake but I'm not sure since my textbook doesn't provide the solution to this problem.

EDIT: As pointed out in the comments, the indistinguishable case is not correct since we're not actually overcounting by 10!

• Seems fine to me, at least the distinguishable boxes case is definitely correct. – Shirish Kulhari Jan 31 at 18:43
• The indistinguishable case is not correct, even for a single color. The case where you put one red ball in each of ten urns is not equivalent to any other cases, for instance. – lulu Jan 31 at 18:45
• @lulu oh! that's right, I messed up, any idea how I could fix that? – Spasoje Durovic Jan 31 at 19:07
• It's messy. Already for one color you have a partition function, see e.g. this (that one assumes every box gets a ball. If you want to drop that, then you get a sum of partition functions). – lulu Jan 31 at 19:11
• @lulu I mean, this exercise was on the "easy" section of the book so I assume that the problem was about distinguishable boxes, but I'm gonna give the harder case a go nonetheless – Spasoje Durovic Jan 31 at 19:16