2

Find the number of integer solutions to the following inequality:

z + w + s + t \leq 30$

so that

$0 \leq z \leq 2$

$4 \leq w \leq 5$

$1 \leq s \leq 5$ and

$2 \leq t \leq 6$

Any help is most appreciated!

  • There are infinite solutions in any case unless you demand the integers to be nonnegative. – drhab Mar 18 '14 at 14:22
  • I have restrictions on the range that each integers can be. – Questioning Student Mar 18 '14 at 14:26
  • I thought that you were asking 6 different questions with $6$ different restrictions. If I understand well now then all restrictions must be satisfied at the same time. I overlooked the word 'and'. – drhab Mar 18 '14 at 14:33
  • I believe you will need to use the principle of inclusion-exclusion to break this one. – Yiyuan Lee Mar 18 '14 at 16:12

1 Answers1

1

The sum of the upper limits is $29$. Let us calculate the number of bad cases.

all variables are maximum: $1$ case

one variable is one less than maximum: $6$ cases

one variable is two less than maximum: $5$ cases ($w$ can't be two less)

one variable is three less than maximum: $4$ cases

two variables are both one less than maximum: ${6 \choose 2} = 15$ cases

one variable is one less and another one two less than maximum: $5 + 5 \cdot 4 = 25$ cases

three variables are one less than maximum: ${6 \choose 3} = 20$ cases

In total we have $76$ bad cases, and all in all $2880$ cases, so there are $2880 - 76 = 2804$ solutions to the inequality.

J. J.
  • 9,432
  • @QuestioningStudent: There is no general formula, you have to tackle all of them individually. – J. J. Mar 18 '14 at 14:53
  • @QuestioningStudent: We are choosing two variables out of six, both of being one less. There is no problem with $w$. On line $7$ we first consider what happens if the one that is one less is $w$. Then we have $5$ cases for the one that is two less. If the one that is one less is not $w$ ($5$ such cases), then there are just $4$ possibilities left for the one that is two less, giving $5 \cdot 4$ cases in that situation. – J. J. Mar 18 '14 at 15:04