I am a middle school student, so it would be super helpful if anyone could explain this problem with simple words. I was able to do (a) and (b), but I got stuck on (c) and onwards.
For (c), I think there are three general cases, 3-0-0-0, 2-1-0-0, and 1-1-1-0. For 3-0-0-0, I know there would be 4 ways, because the 3 candies could go into any of the 4 boxes. I don't know how to tackle the other two cases, though.
I have 3 pieces of candy to place in 4 lunch boxes. In how many ways can I do this if:
(a) The candies are all different and the lunch boxes are all different?
(b) The candies are all the same and the lunch boxes are all the same?
(c) The candies are all the same and the lunch boxes are all different?
(d) The candies are all different and the lunch boxes are all the same?
(e) Exactly two of the candies are the same (but the third is different) and all of the lunch boxes are different?
Method 1: You have correctly identified the possible cases:
Hence, there are a total of $4 + 12 + 4 = 20$ such distributions.
Method 2: Let $x_k$ be the number of candies placed in the $k$th box. Then $$x_1 + x_2 + x_3 + x_4 = 3 \tag{1}$$ Equation 1 is an equation in the nonnegative integers. A particular solution of equation 1 corresponds to the placement of three addition signs in a row of three ones. For instance, $$1 + + 1 1 +$$ corresponds to the solution $x_1 = 1$, $x_2 = 0$, $x_3 = 2$, $x_4 = 0$. The number of such solutions is $$\binom{3 + 3}{3} = \binom{6}{3} = 20$$ since we must choose which three of the six positions required for three ones and three addition signs will be filled with addition signs.