<s>[INST] How many non-negative integer solutions of $x_1 + x_2 + x_3 + x_4 = 28$ are there with $x_{1} \leq 6, x_{2} \leq 10, x_{3} \leq 15, x_{4} \leq21$? How many non-negative integer solutions of $x_1 + x_2 + x_3 + x_4 = 28$ are there with $x_{1} \leq 6, x_{2} \leq 10, x_{3} \leq 15, x_{4} \leq21$?
Attempt:
$x_{1} \geq 7$
$x_{2} \geq 11$
$x_{3} \geq 16$
$x_{4} \geq 22$
$N(U)$ = ${28 + 4 - 1 \choose 4-1}$
$N(x_1)$ = ${28-7 + 4 - 1 \choose 4-1}$
$N(x_2)$ = ${28-11 + 4 - 1 \choose 4-1}$
$N(x_3)$ = ${28-16 + 4 - 1 \choose 4-1}$
$N(x_4)$ = ${28-22 + 4 - 1 \choose 4-1}$
$N(x_1\cap x_2)$ = ${28-7-11 + 4 - 1 \choose 4-1}$
$N(x_1\cap x_3)$ = ${28-7-16 + 4 - 1 \choose 4-1}$
$N(x_1\cap x_4)$ = ${28-7-22 + 4 - 1 \choose 4-1}$
$N(x_2\cap x_3)$ = ${28-11-16 + 4 - 1 \choose 4-1}$
$N(x_2\cap x_4)$ = ${28-11-22 + 4 - 1 \choose 4-1}$
$N(x_3\cap x_4)$ = ${28-11-22 + 4 - 1 \choose 4-1}$
Answer = $N(U) - N(x_1) - N(x_2) -N(x_3) -N(x_4)+  N(x_1\cap x_2)+  N(x_1\cap x_3)+  N(x_1\cap x_4)+  N(x_2\cap x_3)+  N(x_2\cap x_4)+  N(x_3\cap x_4)$
 [/INST] HINT
Use generating functions. For $x_1$ you get
$$
1 +x + \ldots x^6 = \frac{x^7-1}{x-1}
$$
and for the rest of the variables similarly, and then you need to find the coefficient of $x^{28}$ in the product of these 4 generating functions...
</s>