4

I want to solve for:

Number of integers solutions to the equation $x_1+x_2+x_3=15$ with $x_1,x_2\leq 5$ and $x_3\leq 7$ for non negative integers $x_1,x_2,x_3$

How can this be done using the principle of inclusion/exclusion?

3 Answers3

5

If $N$ denotes the total number of ways $x_1+x_2+x_3 =15$ without any restrictions (of course, non-negative integers) and $M$ is the number of ways with desired constraints, then $$ M = N - \left(N_{x_1>5} + N_{x_2>5} + N_{x_3>7}\right) + \left(N_{x_1>5\ and\ x_2>5} + N_{x_1>5\ and\ x_3>7} + N_{x_2>5\ and\ x_3>7}\right) - N_{x_1>5\ and\ x_2>5\ and\ x_3>7} $$ where the $N$ with a subscript denotes the number of ways with the constraints in the subscript.

We have $$N_{x_1>5} = N_{x_2>5} = {11\choose 2},\ N_{x_3>7} = {9\choose2},$$ $$N_{x_1>5\ and\ x_2>5} = {5\choose 2},\ N_{x_1>5\ and\ x_3>7} = N_{x_2>5\ and\ x_3>7} = {3\choose 2},$$ and $$N_{x_1>5\ and\ x_2>5\ and\ x_3>7} = 0.$$

And the total number of ways without any constraint is ${17\choose 2}$. So, $$ M = {17\choose 2} - \left( 2{11\choose 2} + {9\choose2}\right) + \left({5\choose 2} + 2{3\choose 2}\right) = 6. $$

Shash
  • 826
4

Let $y_1=5-x_1$, $y_2=5-x_2$, $y_3=7-x_3$, then you want non-negative $y_i$ which sum to 2.

Empy2
  • 50,853
  • For the completeness of your proof, I think the answer is: $S(n,k) = S(3,2) = C(3+2-1, 2) = C(4, 2) = 6$ – Aharon Sep 18 '14 at 14:17
1

${17\choose2}-\left(2{11\choose2}+{9\choose2}-2{3\choose2}-{5\choose2}\right)$