Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

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 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)

share|cite|improve this question
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
up vote 3 down vote accepted

We assume the balls are distinguishable, that is, have distinct labels.

Your calculation for the first problem, and the reasoning that led to it, are correct.

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 third problem, is, as you point out, straight Stirling, or, I would prefer to say, Inclusion/Exclusion.

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.

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.