2. For an integer $n \geqslant 1$, we consider sequences of $2 n$ numbers, each of which is equal to $0, -1$, or $1$. The sum-product value of such a sequence is obtained by multiplying each pair of numbers in the sequence and then summing all the results.

For example, if $n=2$ and the sequence is $0,1,1,-1$, we get the multiplications $0 \cdot 1, \quad 0 \cdot 1, \quad 0 \cdot-1, \quad 1 \cdot 1, \quad 1 \cdot-1, \quad 1 \cdot-1$. Adding the six results gives the sum-product value of the sequence: $0+0+0+1+(-1)+(-1)=-1$. The sum-product value of this sequence is thus smaller than the sum-product value of the sequence $0,0,0,0$, which is equal to 0. Determine, for each integer $n \geqslant 1$, the smallest sum-product value that such a sequence of $2 n$ numbers can have.

Note: You must also prove that a smaller sum-product value is not possible.
2. Suppose we have a sequence with $x$ times a $1$, $y$ times a $-1$, and thus $2n - x - y$ times a $0$. We calculate the sum-product value of this sequence (expressed in $x$ and $y$).

In the sum-product value, six different types of terms appear: $1 \cdot 1$, $1 \cdot -1$, $-1 \cdot -1$, $1 \cdot 0$, $-1 \cdot 0$, and $0 \cdot 0$. Only the first three types of terms contribute to the sum, as the last three are equal to 0.

The number of terms $1 \cdot 1 = 1$ is the number of ways to choose two 1s from the $x$ ones. This number is equal to $\frac{x(x-1)}{2}$: there are $x$ possibilities for the first 1 and then $x-1$ possibilities for the second 1. Since it doesn't matter which of the two ones we choose first, each pair is counted twice.

Similarly, we find that the number of terms $-1 \cdot -1 = 1$ is equal to $\frac{y(y-1)}{2}$.

The number of terms $1 \cdot -1 = -1$ is equal to $xy$, because there are $x$ possibilities to choose the 1 and, independently, $y$ possibilities for the -1.

In total, we find the sum-product value to be

$$
S = \frac{x(x-1)}{2} \cdot 1 + \frac{y(y-1)}{2} \cdot 1 + xy \cdot -1 = \frac{x^2 - 2xy + y^2 - x - y}{2} = \frac{(x-y)^2 - (x+y)}{2}.
$$

Since $(x-y)^2 \geq 0$ (a square is non-negative) and $-(x+y) \geq -2n$ (the sequence has only $2n$ numbers), it is certainly true that $S \geq \frac{0 - 2n}{2} = -n$. The sum-product value cannot be smaller than $-n$. If we now choose $x = y = n$, then $(x-y)^2 = 0$ and $-x - y = -2n$, so we get a sum-product value of exactly $\frac{0 - 2n}{2} = -n$. The smallest possible sum-product value is thus $-n$.