Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How many solutions possible for the equation $x_1+x_2+x_3+x_4=1000$ if all $x_1,x_2,x_3,x_4$ are non-negative integer and $\left| {{x_i} - {x_j}} \right| \in \left\{ {0,1} \right\}\text{ }\forall 1 \le i \ne j \le 4$. Thanks!

share|cite|improve this question
How many can you come up with? Can there be others? Can you prove that? – AakashM Sep 26 '12 at 16:00
You said inequality, but wrote =. Which is correct? – Ross Millikan Sep 26 '12 at 16:00
Looks like an equality, you have $x_1+x_2+x_3+x_4=1000$. Too simple. – André Nicolas Sep 26 '12 at 16:01
up vote 3 down vote accepted

As Berci said, $x_1=x_2=x_3=x_4=250$ is a solution. Now let's prove there is no other solution satisfying the condition.

Suppose there is a different solution besides the above one, one of these four x's should be smaller than or larger than 250.

Without loss of generality, assume $x_1$ is smaller than 250. In order for their summation to be equal to 1000, at least one of the other three have to be bigger than 250. Therefore their absolute difference cannot be $\in \{0,1\}$ (one is smaller than 250, the other one is bigger than 250, their absolute difference is at least 2).

Now assume $x_1$ is bigger than 250, then at least one of the other three have to smaller than 250 in order for $\sum_{i=1}^{4} x_i = 1000$. And again their absolute difference is at least 2.

Conclusion, there can't be other solutions other than all x's being equal to 250.

share|cite|improve this answer

So, if the distance of different $x_i$'s is really so much restricted, then the solutions don't have too much space to vary.

Clearly, $x_1=x_2=x_3=x_4=250$ is good.

Try to prove that there is nothing else. You can use that by hypothesis, the average of them must be $250$.

share|cite|improve this answer
can you explain further? – Schwarz Sep 26 '12 at 17:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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