Here is a more specific question:
Find the number of ways of giving $10$ identical gift boxes to 6 people : $A$, $B$, $C$, $D$, $E$, $F$ in such a way that total number of boxes given to $A$ and $B$ together does not exceed $4$.
I am currently learning about problems which are related to Combinations with Repetitions, for the most part of it I am able to solve the basic questions, but this one stumped me.
Can you suggest how to approach this problem?
Let $x_A$, $x_B$, $x_C$, $x_D$, $x_E$, and $x_F$ represent the number of gift boxes given to persons $A$, $B$, $C$, $D$, $E$, and $F$, respectively. Since a total of ten boxes are distributed to these six people, $$x_A + x_B + x_C + x_D + x_E + x_F = 10 \tag{1}$$ Since $A$ and $B$ together receive at most four of these gifts, we must solve equation 1 in the nonnegative integers subject to the restriction that $x_A + x_B \leq 4$.
This can be solved by casework. If $$x_A + x_B = k \tag{2}$$ then for equation 1 to be satisfied, we must have $$x_C + x_D + x_E + x_F = 10 - k \tag{3}$$ for $0 \leq k \leq 4$.
A particular solution of the equation $$x_1 + x_2 + \cdots + x_n = m \tag{4}$$ in the nonnegative integers corresponds to the placement of $n - 1$ addition signs in a row of $m$ ones. For instance, if $m = 10$ and $n = 5$, $$1 + + 1 1 1 + 1 1 + 1 1 1 1$$ corresponds to the solution $x_1 = 1$, $x_2 = 0$, $x_3 = 3$, $x_4 = 2$, $x_5 = 4$. Consequently, the number of solutions of equation 4 in the nonnegative integers is $$\binom{m + n - 1}{n - 1}$$ since we must choose which $n - 1$ of the $m + n - 1$ positions required for $m$ ones and $n - 1$ addition signs will be filled with addition signs.
Thus, equation 2 has $$\binom{k + 2 - 1}{2 - 1} = \binom{k + 1}{1} = k + 1$$ solutions and equation 3 has $$\binom{10 - k + 4 - 1}{4 - 1} = \binom{13 - k}{3}$$ solutions in the nonnegative integers. Thus, when $x_A + x_B = k$ and $x_C + x_D + x_E + x_F = 10 - k$, the number of solutions of equation 1 is $$(k + 1)\binom{13 - k}{3}$$
Since $0 \leq k \leq 4$, the number of ways of distributing ten gifts to persons $A$, $B$, $C$, $D$, $E$, and $F$ so that $A$ and $B$ together receive at most $4$ of those gifts is $$\sum_{k = 0}^{4} (k + 1)\binom{13 - k}{3} = \binom{13}{3} + 2\binom{12}{3} + 3\binom{11}{3} + 4\binom{10}{3} + 5\binom{9}{3}$$