# How many integer solutions of $x_1+x_2+x_3+x_4=28$ are there with $-10\leq x_i\leq20$? [duplicate]

How many integer solutions of $$x_1+x_2+x_3+x_4=28$$ are there with $$-10\leq x_i\leq20$$?

I know how to do this type of problem when all $$x_i$$ are positive, but I am struggling to understand how to complete this problem when the $$x_i$$ can be negative.

## 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 31 '18 at 12:34

• Try defining $y_i = x_i + 10$ – Sambo Oct 31 '18 at 3:30

Guide:

Let's see, you can manage the question, when all $$x_i$$ are positive.

let $$y_i = x_i + 11$$, then we have $$1 \le y_i \le 31$$.

and $$\sum_{i=1}^4x_i = 28$$

would become $$\sum_{i=1}^4y_i= 28 + 4(11)$$

$$1 \le y_i \le 31$$.

• Thanks! This was really helpful! I think I understand it now. – lmckal45 Oct 31 '18 at 3:34

This is a nice question. You know how to solve these problems with stars and bars, I gather. So we want to know how many ways there are to put $$28$$ indistinguishable balls in $$4$$ distinct buckets, with at least $$-10$$ and no more than $$20$$ balls in each bucket. Start out by putting $$-10$$ balls in each bucket -- difficult in the real world, but no trouble at all in math. Now we have $$-40$$ balls, so to get up to $$28$$ we need to add $$68$$ balls to the buckets. Since we aren't allowed to have more than $$20$$ balls in a bucket, we can't place any more than $$30$$ balls in a bucket.

So the question is transformed into, "In how many ways can $$68$$ indistinguishable balls be placed in $$4$$ distinct buckets, with no more than $$30$$ balls in a single bucket?"

Take it from here.

Find out how many integer solutions are for $$u_1+u_2+u_3+u_4=40+28$$ with $$0\leq u_i \leq 10+20$$. Then associate each $$u_i$$ with $$x_i=u_i-10$$.