56. a) Each of the numbers $x_{1}, x_{2}, \ldots, x_{n}$ can independently take the value 1, 0, or -1. What is the smallest value that the sum of all possible pairwise products of these $n$ numbers can have?

b) What is the smallest value that the sum of all possible pairwise products of $n$ numbers $x_{1}, x_{2}, \ldots, x_{n}$, each of which in absolute value does not exceed one, can take?
56. Answer: the minimum value $s_{\mathrm{min}}$ is $-[n / 2]$, i.e., $-n / 2$ if $n$ is even, and $-(n-1) / 2$ if $n$ is odd.

a) The sum $s$ of all possible pairwise products of numbers $x_{1}, x_{2}, \ldots, x_{n}$ can be written as:

$$
s=\frac{1}{2}\left(\left(x_{1}+x_{2}+\ldots+x_{n}\right)^{2}-x_{1}^{2}-x_{2}^{2}-\ldots-x_{n}^{2}\right)
$$

From this, it is clear that $s \geqslant -n / 2$.

If $n$ is even, then by setting half of the $x_{k}$ to 1 and the other half to -1, we get $s = -n / 2$. If $n$ is odd, then (since $s$ is an integer) $s \geqslant -(n-1) / 2$; the minimum value of $s$ is achieved if among the $x_{k}$ there are $(n+1) / 2$ ones and $(n-1) / 2$ minus ones.
b) This reduces to problem a): each of the $x_{k}$ can be sequentially replaced by 1 or -1 such that the value of the sum of all possible pairwise products does not increase (replacement rule: replace $x_{k}$ with -1 if the sum of the remaining numbers is non-negative, and with 1 if it is negative). Therefore, the answer here is the same as in problem a).