# Distinguishable balls in distinguishable boxes

I wish to improve on my combinatorial reasoning skills and my step-father gave me this problem that has left me quite confused. It seems to me that because the balls are colored similar to the boxes, that you have to factor in the ball and box colors. I do not wish to have the answers just "given" I wish to develop the right thinking that could help me solve the problem. Thank you.

There are 3 boxes (red, green, blue) and 7 distinguishable balls (two red balls, three blue balls, and two green balls).

a. Find the number of ways to put the balls into the boxes with no restrictions.

For the first part, I believe the solution is just $3^7$ since we were told there are no restrictions. I take this to mean that we can treat all 7 balls as distinguishable, so we don't care that there are sub-groupings of ball colors. Is this valid?

b. Find the number of ways to put the balls into the boxes so that each ball is not in its color's box (seems similar to the idea of derangements)

1 red box and 5 non-red balls, 1 blue box and 4 non-blue balls 1 green box and 5 non-green balls

c. Find the number of ways to place the balls into the boxes so that each box is non-empty (definitely a Stirling number of the second kind problem)

d. Find the number of ways to place the balls so that all balls of the same color are together, each ball is not in its colors box , and each box is not empty. (combines answers)

• It's unclear what "7 distinguishable balls (two red, three blue, two green)" means. Are the two red balls distinguishable (i.e., do they maybe also have a number printed on them)? Or are only balls with different colors distinguishable? – fgp May 10 '13 at 22:49

For the second problem, an analysis might go as follows. The reds can be placed in $2^2$ different ways. For each such way, the blues can be placed in $2^3$ different ways. And for each way of placing reds and blues, the greens can be placed in $2^2$ different ways.
The fourth is rather simple, there are only $3$ abstract balls. This one is a derangements problem, but one so small that applying derangements machinery is unreasonable. But if we had boxes of $10$ different colours, and balls of these colours, derangements would give us the answer.