# How to find the solution to this system of integer variables?

Let $x_i$ be nonnegative integer variables in $\mathbb{N}$. The system is to find $x_i$ in

$$\sum_{i=1}^nx_i=3n,\\\quad \quad \quad \quad \;\;\,x_i\leqslant3,\,\forall\, i\in\{1,\ldots,n\}.$$

I find the solution to be $x_i=3$ for all $i$ but I cannot prove that it is the unique solution.

• If there was a different soluion, some of the $x_i$ would be smaller and some of them larger than $3$, but the second condition says they can't be larger. – Henrik Dec 14 '16 at 16:01

Suppose that some $x_j <3$. Wlog we can assume $j=1$. Then $$\sum_{i=1}^{n} x_i = x_1 + \sum_{i=2}^{n}x_i \le 2 + 3(n-1) < 3n.$$ So we have a contradiction.

$$\sum_{i=1}^nx_i \leq \sum_{i=1}^n3=3n$$ and the equality holds only when $x_i=x_j$ for all $i,j$.

So the only solution is $x_i=3$ for all $i$

Suppose at least $1 \ x_i$ is less than $3$. Then there must be at least one $x_j$ strictly greater than $3$ to make up for $3n$ . Hence a contradiction

Assume there is an other solution $(y_i)_{i=1,2...n}$ . then

$$S=\sum_{i=1}^n|3-y_i|=0 \implies$$

$$\forall i\in\{1,2,...n\}\;\;S\geq |3-y_i|\geq 0$$

$$\implies \forall i\in\{1,2,...n\}\;\;y_i=3$$