# How many integer solutions of $x_1$ + $x_2$ + $x_3$ + $x_4$ = 28 are there with [duplicate]

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)

## marked as duplicate by N. F. Taussig combinatorics StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 29 '18 at 20:20

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$$).