2
$\begingroup$

How many solutions are there for the inequation: $7 \le x_1 + x_2 + x_3 + x_4 \le 12$?

So I thought about counting solutions for $x_1 + x_2 + x_3 + x_4\le 12$ then, count solutions for $x_1 + x_2 + x_3 + x_4\le 7$ and then subtract.

I read somewhere that $x_1 + x_2 + x_3 + x_4 \le 12$ can be written as $x_1 + x_2 + x_3 + x_4 + x_5 = 12$ so number of solutions is ${12 + 4 \choose 4} = 1820$

Number of solutions for $x_1 + x_2 + x_3 + x_4 + x_5 = 7$ would be ${7 + 4 \choose 4} = 330$

Final answer: $1820 - 330 = 1490$

Is this correct?

$\endgroup$
  • $\begingroup$ Are the variables supposed to be nonnegative integers? $\endgroup$ – N. F. Taussig Apr 14 '18 at 21:26
3
$\begingroup$

You should always make clear the types of your variables, as well as any restrictions. Readers shouldn't have to guess the intended meaning.

Assuming nonnegative integer variables, your approach is correct, but you have a minor error.

You want to subtract the solutions to $x_1+x_2+x_3+x_4 \le 6$, so you get $$ {\small{\binom{12+5-1}{5-1}}}-{\small{\binom{6+5-1}{5-1}}} = {\small{\binom{16}{4}}}-{\small{\binom{10}{4}}} =1820-210 =1610 $$ If the variables were specified as positive integers, you would get $$ {\small{\binom{13-1}{5-1}}}-{\small{\binom{7-1}{5-1}}} = {\small{\binom{12}{4}}}-{\small{\binom{6}{4}}} =495-15 =480 $$

$\endgroup$
  • $\begingroup$ Oh yea, messed up there, thanks. :) $\endgroup$ – Nemanja Zunic Apr 14 '18 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.