Are the boxes identical or distinct?
Suppose there are 10 identical red balls and 10 different blue balls. I am wondering if the following is correct. Suppose we want to put those balls into 4 boxes such that:
(a) there is a box containing exactly 2 red balls.
I assume this means that the box contains 2 red balls only and no other balls. So this means, (4 choose 1) to choose the special box. Then the rest of the red balls gets distributed as follows: (10 choose 8). Then the blue balls gets distributed like this: 3^10. So the total is:
4 x (10 choose 8) x (3^10)
(b) there is a box containing exactly 2 blue balls.
to distribute the red, we have 3 boxes. So we have (10 + 3 - 1 choose 10), or (12 choose 10). there are 10 x 9/2! ways of putting balls in the special box that gets 2 blue balls, and 4 ways of choosing the box. Then the rest of the blue balls can be distributed in 3^8 ways. So the total is:
(12 choose 10) x (10 choose 2) x (4) x (3^8) ways.
The reason I deleted the answer that I quickly gave is that it is an over-count.
Here is the difficulty. Once we pick the box to have the two red balls we do not want another box to have only two red balls. Because, it would be counted more than once.
So we count at least one has exactly two red balls.
So the logic would be:
Count for one box with 2 red balls - count for 2 boxes with 2 red balls + count for 3 boxes with 2 red balls - (count with 4 boxes with 2 red balls -- impossible, so count is 0)?
Does that mean that for the one with one box with 2 blue balls, we would also do: count for one box with 2 blue balls - count for 2 boxes with 2 blue balls + count for 3 boxes with 2 blue balls? So this would be
4 x (10 choose 2) x (3 ^ 8) - (4 choose 2) x (10 choose 2) x (8 choose 2) x (2 ^ 6) + (4 choose 3) x (10 choose 2) x (8 choose 2) x (6 choose 2) ?