0

I need to find the number of nonnegative solutions for the equation $$x_1+ x_2+ x_3+ x_4+ x_5=9$$ when $x_1 \geq 1, x_5 \leq 5$.

I know I need to use $\binom{n+k-1}{k-1}$ and Inclusion–exclusion, but I'm not sure how to use it properly with the conditions.

It will be great if someone will explain to me how to choose the $n,k$.

N. F. Taussig
  • 76,571
G. Ticher
  • 135
  • 5

3 Answers3

1

In general with stars and bars we find that there are $\binom{n+k-1}{k-1}$ solutions for:$$y_1+\cdots+y_n=k$$where the $y_i$ are nonnegative integers.

In your case we can at first hand go for $n=5$, $y_1=x_1-1$, $y_i=x_i$ for $i=2,3,4,5$ and $k=9-1=8$.

Then however we overlooked the constraint $y_5=x_5\leq5$.

This can be repaired by subtracting the number of solutions that satisfy $y_5\in\{6,7,8\}$ or equivalently: $$y_1+y_2+y_3+y_4\in\{0,1,2\}$$

Again using stars and bars (3 times) we can find these numbers.

drhab
  • 151,093
1

The number of non negative solutions is equal to the coefficient by $z^9$ in the series $$ \frac{z(1+z+z^2+z^3+z^4+z^5)}{(1-z)^4}=z+5\,{z}^{2}+15\,{z}^{3}+35\,{z}^{4}+70\,{z}^{5}+126\,{z}^{6}+209\,{z}^{7}+325\,{z}^{8}+480\,{z}^{9}+\cdots $$

Thus the aswer is $480.$

Leox
  • 8,120
0

Find the number of nonnegative integer solutions of the equation $$x_1 + x_2 + x_3 + x_4 + x_4 + x_5 = 9$$ satisfy the restrictions $x_1 \geq 1$ and $x_5 \leq 5$.

If $x_1 \geq 1$, $x_1' = x_1 - 1$ is a nonnegative integer. Substituting $x_1' + 1$ for $x_1$ in the equation $$x_1 + x_2 + x_3 + x_4 + x_4 + x_5 = 9 \tag{1}$$ yields \begin{align*} x_1' + 1 + x_2 + x_3 + x_4 + x_5 & = 9\\ x_1' + x_2 + x_3 + x_4 + x_5 & = 8 \tag{2} \end{align*} Equation 2 is an equation in the nonnegative integers with $$\binom{8 + 5 - 1}{5 - 1} = \binom{12}{4}$$ solutions, each of which is a solution of equation 1 that satisfies the requirement that $x_1 \geq 1$.

However, they include solutions of equation 1 in which $x_5 > 5$. Since the variables represent integers, if $x_5 > 5$, then $x_5 \geq 6$. Hence, we can eliminate those solutions which violate the restriction that $x_5 > 5$ by subtracting those solutions of equation 2 in which $x_5 \geq 6$.

Suppose $x_5 \geq 6$. Let $x_5' = x_5 - 6$. Then $x_5'$ is a nonnegative integer. Substituting $x_5' + 6$ for $x_5$ in equation 2 yields \begin{align*} x_1' + x_2 + x_3 + x_4 + x_5' + 6 & = 8\\ x_1' + x_2 + x_3 + x_5 + x_5' & = 2 \tag{3} \end{align*} Equation 3 is an equation in the nonnegative integers with $$\binom{2 + 5 - 1}{5 - 1} = \binom{6}{4}$$ solutions.

Hence, the number of solutions of equation 1 which satisfy the restrictions $x_1 \geq 1$ and $x_5 \leq 5$ is $$\binom{12}{4} - \binom{6}{4}$$

N. F. Taussig
  • 76,571