I'm trying to solve the following problem:
Balls of the colors red, orange, yellow, green, blue, indigo, violet (7 colors, 1 ball per color) are placed into 4 different boxes A,B,C,D so that no box is empty. In how many ways can that be done?
I tried to solve this, and I can't figure out why my solution is wrong. My question is, why is my solution wrong?
What I did was the following:
$\binom{7}{1}\binom{4}{1}+\binom{6}{1}\binom{3}{1}+\binom{5}{1}\binom{2}{1}+\binom{4}{1}$
First picking one ball out of 7, combining the choice with 1 out of 4 possible boxes, then adding the number of ways to pick the next ball, 1 out of 6 remaining balls, to place in 1 out of 3 allowed boxes and so on..
Then I combined these choices with the placements of the remaining 3 balls (3 balls that can all have 4 different positions gives $4^3$ choices) and got:
$\left(\binom{7}{1}\binom{4}{1}+\binom{6}{1}\binom{3}{1}+\binom{5}{1}\binom{2}{1}+\binom{4}{1}\right)\times 4^3=60\times 64=3840$
According to the book, the right answer is 8400. Why is my solution wrong? Thanks!
As the commenters have pointed out, your approach is incorrect in a couple of ways; for starters, you should be multiplying rather than adding, but then you are drastically overcounting.
You are trying to partition the seven balls into four nonempty boxes. The number of ways to partition $7$ things into $4$ nonempty sets is given by the Stirling number of the second kind, $\left\lbrace{7\atop 4}\right\rbrace = 350$. Here, however, the order of the sets is important (they are distinct), so you must multiply by $4!$; $350\cdot 4! = 8400$.