# How many integer solutions with negative numbers?

If a question asked: How many integer solutions of $$x_1+x_2+x_3+x_4=30$$ with $$-9 \leq x_i \leq 21$$? How would this be solved?

I understand how to solve if the inequality was $$0 \leq x_i \leq 21$$?, but how to solve between a negative and positive inequality?

$$N = \binom{30 + 4-1}{30}$$

$$N(A_i) = \binom{(30 - ?) +4-1}{30 - ?}$$

...

• It is the coefficient of $x^{30}$ in $$\frac{x^{-36}(1-x^{30})^4}{(1-x)^4}$$ – Matt Samuel Dec 10 '18 at 20:44
• @MattSamuel Could you explain this? We have to use sets (finished generating functions chapter). – Violet Jung Dec 10 '18 at 20:46
• The formula for $N$ you give is the unrestricted value. That is, it would be the answer if the question was how many solutions are there to $x_1+x_2+x_3+x_4=30$ with $x_i≥0$. More work is needed to handle a cap, as in $0≤x_i≤21$. – lulu Dec 10 '18 at 20:58
• "set theory" has nothing to do with your question. – Jean Marie Dec 10 '18 at 21:47
• @JeanMarie Ah, sorry, I assumed so because that's our current chapter. – Violet Jung Dec 10 '18 at 22:34

Let $$y_i=x_i+9$$. Then $$y_1+y_2+y_3+y_4=66\\ 0\leq y_i\leq 30$$ Now find the number of solutions the way you say you know.