How many integer solutions of $x_1$ + $x_2$ + $x_3$ + $x_4$ = 28 are there with
(a) 0 ≤ $x_i$ ≤ 12?
(b) −10 ≤ $x_i$ ≤ 20?
(c) 0 ≤ $x_i$, $x_1$ ≤ 6, $x_2$ ≤ 10, $x_3$ ≤ 15, $x_4$ ≤ 21?
I have tried.
a) To count the compliment value, so (31 choose 3) - (15 choose 3)
b) Not quite sure where to begin
c) (31 choose 3)-(24 choose 3)-(18 choose 3)- (13 choose 3)- (9 choose 3)
Hint: Use principle of inclusion and exclusion. First you can find no of solutions corresponding to only the lower bound. Then you can subtract from this considering the lower bound to be one plus the upper bound.
That is, if you want $b\leq x_i\leq a$, solve independently for $b\leq x_i$ and subtract from this the cases when $a+1\leq x_i$
(You may also use generating functions but that might be tough since the upper limits are not same for all of the $x_i$).