Fix $k \in \mathbb{N}$, $k \geq 1$. Let $p \in [0,1]$ and $x = (x\_0, \ldots, x\_k)$ be a $(k+1)$-dimensional *real* vector, and define
$$S(p,x) = -x\_0^2 + \sum\_{i=0}^k {k \choose i} p^i (1 - p)^{k - i} \cdot (x\_i - p)^2.$$
Experiments show that for small values of $k$
$$\exists x \in \mathbb{R}^{k+1} \,.\, \forall p \in [0,1] \,.\, S(p,x) = 0.$$
In other words, there are $x\_i$'s such that $S(x,p)$ is identically zero as a polynomial in $p$.


For a given $k$ we can expand $S(x,p)$ as a polynomial in $p$ and equate the coefficients to $0$. For $k = 2$ we get
\begin{align\*}
 0&=0 \\
 -x\_0^2-2 x\_0+x\_1^2&=0 \\
 2 x\_0-2 x\_1+1&=0 \\
\end{align\*}
and this has two solutions:
$$x = (\frac{1}{2} (-1-\sqrt{2}),\frac{1}{2},\frac{1}{2} (3+\sqrt{2}))$$
and
$$x = (\frac{1}{2} (-1+\sqrt{2}),\frac{1}{2},\frac{1}{2} (3-\sqrt{2})).$$
For $k = 1, 2, 3, 4, 5, 6, 7$ there are $1, 2, 4, 8, 14, 28, 48$ solutions respectively, according to Mathematica. [According to OEIS](https://oeis.org/search?q=1%2C%202%2C%204%2C%208%2C%2014%2C%2028%2C%2048) this is [A068912](https://oeis.org/A068912), "the number of $n$ step walks (each step $\pm 1$ starting from $0$) which are never more than $3$ or less than $-3$." This is kind of interesting because the problem arises in statistics, see [John Mount's blog post](http://www.win-vector.com/blog/2014/07/frequenstist-inference-only-seems-easy/) for background.


**Question:** Is there a solution for every $k$?


**Addendum:** John says he wants soltions in $[0,1]^{k+1}$...




---


Here is the relevant Mathematica code:



```
s[k_, p_, x_] := Sum[Binomial[k, i] * p^i* (1 - p)^(k - i)* (Subscript[x, i] - p)^2, {i, 0, k}]  Subscript[x, 0]^2
xs[k_] := Table[Subscript[x, i], {i, 0, k}]
system[k_, p_, x_] := Thread[CoefficientList[s[k, p, x], p] == 0]
solutions[k_] := Solve[system[k, p, x], xs[k], Reals]

```

To see the system of equations for $k = 4$, type



```
system[4, p, x] // ColumnForm

```

To see the solutions for $k = 4$, type



```
solutions[4]

```

To make a table of counts of solutions up to $k = 7$, type



```
Table[{k, Length@solutions[k]}, {k, 1, 7}] // ColumnForm

```


Existence of solutions of a polynomial system
The solutions described via the link <http://winvector.github.io/freq/explicitSolution.html> (posted in one of the earlier answers) can be given by the following formula:
 $$
x\_i=\frac{(k-2i)\sqrt{k}+(2i-1)k}{2k(k-1)}=\frac{1}{2(1+\sqrt{k})}+\frac{i}{\sqrt{k}(1+\sqrt{k})}.
 $$
Note that (when $k$ is fixed):


* $x\_i$ is an increasing function of $i$, and we have $$
x\_0=\frac{1}{2(1+\sqrt{k})}, \quad x\_k=\frac{1+2\sqrt{k}}{2+2\sqrt{k}},
 $$  

so all these numbers are between 0 and 1.
* Moreover, we have $x\_i=a+bi$, so $S(p,x)$ can be represented as 
$$
-x\_0^2+\sum\_{i=0}^k\binom{k}{i}p^i(1-p)^{k-i}(U+Vi+Wi^2),
 $$
where $U$, $V$ and $W$ depend on $k$ and $p$ but not on $i$. It remains to use formulas 
\begin{gather}
\sum\_{i=0}^k\binom{k}{i}p^i(1-p)^{k-i}=1,\\
\sum\_{i=0}^k i\binom{k}{i}p^i(1-p)^{k-i}=kp,\\
\sum\_{i=0}^k i(i-1)\binom{k}{i}p^i(1-p)^{k-i}=k(k-1)p^2
\end{gather}
(which are obvious) to check directly that the formulas for $x\_i$ as above give a solution.


This solution also simplifies to $x\_i = (\frac{1}{2}\sqrt{k} + i)/(\sqrt{k}+k)$ which is exactly the smoothed estimate of the win-rate of a coin flipped $k$ times showing $i$ wins with $\sqrt{k}$ "pseudo-observations" (half wins, half losses) added first (or Bayesian inference starting with $\beta(\sqrt{k}/2,\sqrt{k}/2)$ priors, $\beta(1/2,1/2)$ being Jeffreys priors, and $\beta(1,1)$ being standard Laplace smoothing).


