At the moment I am doing some combinatorics exercises. The following one seemed interesting and I would like to know if my solution is correct.
How many possible non-negative integer solutions to the equation $x_1+x_2+x_3=11$ are there if we insist that $x_2 \leq 4$. Hint:Use Inclusion-Exclusion
Approach: I am considering that the non-negative integers are defined as $\{0,1,2,3,...\}$.
"How many non-negative integer solutions to $x_1+x_2+x_3=11$ are there?"
This seems like a typical application of "stars and bars", thus, there are $\binom{11+3-1}{3-1}$ non-negative integer solutions.
By the hint, I need to calculate and exclude all solutions such that $x_2 \geq 5$.
For that I defined $x'_2:=x_2-5$, substituting it into the equation we get $x_1+(x_2'+5)+x_3=11$, or $x_1+x_2'+x_3=6$. This equation has $\binom{6+3-1}{3-1}$ non negative integer solutions. Now $\binom{6+3-1}{3-1}$ is the number of solutions that do not statisfy the condition.
Thus the answer to the original questions is $\binom{11+3-1}{3-1}-\binom{6+3-1}{3-1}$.