Combinatorics: stars and bars with conditions

combinatorics

How do you solve $x_1+x_2+x_3+x_4 \le 45$, where all the $x$'s are nonnegative with the added conditions that $x_1 \ge 0, x_2\ge 1, x_3 \ge 4,$ and $x_4 \le 5$? I know how to do the normal stars and bars argument, but the inequality and these conditions make it more complicated.

Best Answer

By using slack variables. Find the number of solutions of $x_1+x_2+x_3+x_4+x_5=45$, where each $x_i$ is a non-negative integer. That converts the last inequality into an equality.

For $x_2$ and $x_3$, just use the constraints as your starting point: $x_1+y_2+y_3+x_4+x_5 = 40$, where $y_2+1=x_2$ and $y_3+4=x_3.$

To handle the inequality on $x_4$, use the technique discussed above to ascertain the number of solutions of your original equation where $x_4 \geq 6: x_1+y_2+y_3+y_4+x_5=34,$ where $y_4+6=x_4$. Subtract this number from the number of solutions of your first equation.

Thus, your answer should be $\binom{44}{4}-\binom{38}{4}.$

Related Question