# Thread: Inclusion - Exclusion Problem

1. ## Inclusion - Exclusion Problem

Hi.

I am having some difficulty with this inclusion-exclusion problem, and I would love some help.

************************************************** ******

Determine the number of integer solutions to X1 + X2 + X3 + X4 = 19, where -5 ≤ Xi ≤ 10, for all 1 ≤ i ≤ 4.

What I have done is create another equation to solve, since we already know how to solve non-negative integer solutions, C(n + r - 1, r), but I don't know whether I have done this step right.

Let Y1 + Y2 + Y3 + Y4 = 24, where Xi ≤ 15, Yi = Xi + 5 for all 1 ≤ i ≤ 4. IS THIS RIGHT?

If this is right, I am pretty sure I know how to go on from here, but I am unsure of this particular step.

2. Originally Posted by purakanui
Determine the number of integer solutions to X1 + X2 + X3 + X4 = 19, where -5 ≤ Xi ≤ 10, for all 1 ≤ i ≤ 4.
What I have done is create another equation to solve, since we already know how to solve non-negative integer solutions, C(n + r - 1, r), but I don't know whether I have done this step right.
Let Y1 + Y2 + Y3 + Y4 = 24, where Xi ≤ 15, Yi = Xi + 5 for all 1 ≤ i ≤ 4.
Your approach is correct. The difficulty is that upper limit of 10.
This is one case where generating functions are useful.
Expand the expression $\left( {\sum\limits_{k = 0}^{15} {x^k } } \right)^4$. The coefficient of $x^{24}$ is the answer.

But if you must use inclusion/exclusion then the answer is:
$\binom{24+4-1}{4-1}-\left( {\sum\limits_{k = 16}^{24} {4 \cdot \binom{26-k}{2}} } \right)$
We remove all solutions in which a variable is at least 16.

3. ## Thanks for your help

I have used an online expander (the coefficient is 2265, do you blame me!) which is the same answer I got from the other approach (the inclusion exclusion way).

The Y1 + Y2 + Y3 + Y4 = 24 was wrong because of Yi = Xi + 5, however there are 4 Values, so I should of added (5 x 4) = 20, so Y1 + ... + Y4 = 39.

Thanks for your help, we are just covering generating functions now, and it's good to see both sides.