In how many ways can 20 identical balls be distributed into 4 distinct boxes subject?
Solution 1:
Hint: a) You have to write 20 numbers $x_1, x_2 \ldots x_4$ that correspond to the numder of balls that will be placed in boxes 1, 2, 3 and 4 respectively. Since, they should add up to 20, you want to determine the number of solutions to the equation: $$x_1+x_2+x_3+x_4=20$$ subject to $0\le x_i$ (practially that means no constraints). According to here, you can do it in $$\dbinom{20+4-1}{4-1}=\dbinom{23}{3}=1771$$ ways.
b)Now place 2 balls in each box. So there remain 12 balls. Then as above you want to determine the number of solutions to the equation: $$x_1+x_2+x_3+x_4=12$$ subject to $0\le x_i$. Proceeding as in (a), you can do it in $$\dbinom{12+4-1}{4-1}=\dbinom{15}{3}=455$$ ways.
c)Place 1 ball in box 1 and close it. Place 1 ball in box 2. So there remain 18 balls and 3 boxes. Then as above you want to determine the number of solutions to the equation: $$x_2+x_3+x_4=18$$ subject to $0\le x_i$. Proceeding as above, you can do it in $$\dbinom{18+3-1}{3-1}=\dbinom{20}{2}=190$$ ways.
d)Put now the balls in pairs. So you have 10 pairs and you want to place them in the 4 boxes. That is exactly the problem stated in (a). Similarly you can do it in $\dbinom{10+4-1}{4-1}=\dbinom{13}{3}=286$ ways.
Solution 2:
a) We want to distribute $20$ identical candies between $4$ non-identical kids.
Take $24$ (yes, $24$) candies and place them like this, with a little gap between successive candies. $$c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad c\quad$$ There are $23$ intercandy gaps. Choose $3$ of these to put a separator into. Give all but one of the candies up to the first separator to the first kid, eating one yourself. Give all but one of the candies between the first two separators to the second kid, eating one yourself. And so on.
It is clear that every way of distributing $20$ candies corresponds to a placement of separators, and every placement of separators gives us a way to distribute the candies. Thus the number is $\binom{23}{3}$.
b) Give two candies to each kid. Then we need to split the remaining $12$ between the kids. By an argument just like the one above, there are $\binom{15}{3}$ ways to do this.
c) So only $3$ kids are in the game, and $19$ candies. Give a candy to the second kid. That leaves $18$ to be split between $3$ kids. There are $\binom{20}{2}$ ways to do this.
d) Glue pairs of candies together to make a Candy. We want to distribute $10$ Candies between $4$ kids. There are $\binom{13}{3}$ ways to do this.