Are two sequences equal if the sums and sums of squares are equal?

Are two sequences $(x_i)_{i=1,\ldots,n}$ and $(y_i)_{i=1,\ldots,n}$ equal if $\sum_{i=1}^nx_i=\sum_{i=1}^ny_i$ and $\sum_{i=1}^nx_i^2=\sum_{i=1}^ny_i^2$?


Solution 1:

No.

$$ x = (1,1,1,-3) $$ $$ y = (-1,-1,-1,3) $$

$$\sum x_i = \sum y_i = 0$$ $$ \sum x_i^2 = \sum y_i^2 =12$$

Solution 2:

No! You need $n$ polynomial equations.

If I remember correctly, given a set of $n$ distinct real numbers $\mathcal Y :=\{y_1, y_2, \dots, y_n\}$, the following system of $n$ polynomial equations

$$\begin{array}{rl} x_1 + x_2 + \dots + x_n &= c_1\\ x_1^2 + x_2^2 + \dots + x_n^2 &= c_2\\ \vdots \\ x_1^n + x_2^n + \dots + x_n^n &= c_n\end{array}$$

where

$$c_k := y_1^k + y_2^k + \dots + y_n^k$$

has $n!$ solutions, namely, all $n!$ permutations of the $n$ distinct elements of $\mathcal Y$. One can use algebraic geometry to prove this. I vaguely recall this being related to moment problems.


Example

Let $\mathcal Y := \{1,3,6\}$. Intersecting the plane with the sphere,

$$\begin{array}{rl} x_1 + x_2 + x_3 &= 10\\ x_1^2 + x_2^2 + x_3^2 &= 46\end{array}$$

we obtain a circle on the plane, as depicted below

enter image description here

However, intersecting these two with the cubic surface,

$$\begin{array}{rl} x_1 + x_2 + x_3 &= 10\\ x_1^2 + x_2^2 + x_3^2 &= 46\\ x_1^3 + x_2^3 + x_3^3 &= 244\end{array}$$

we obtain the $3!=6$ permutations of the elements of $\mathcal Y$, which are colored in red

enter image description here

If we plot the quadratic and the cubic surfaces, but not the plane,

enter image description here

and, from another point of view, we have what looks like a stylish hat

enter image description here

enter image description here

Solution 3:

To consider an even more basic counterexample. What happens if you simply reorder your sequence? Take $x = (0,1)$ and $y = (1,0)$. (I assume you're talking about sequences, so above $x \neq y$; of course, as sets, $\{0,1\} = \{1,0\}$.)