This is not a solution but some background to the question.

Define $$S(k,p,x) = \sum_{i=0}^k {k \choose i} p^i (1-p)^{k-i} (x_i-p)^2.$$
Define $$f(k) = \mathrm{argmin}_x \max(p,S(k,p,x)).$$
Then $f(k)$ is the minimax square-loss solution to trying to estimate the win rate of a random process by observing $k$ results (Wald wrote on this). The neat thing is: we can show if there is a real solution in $[0,1]^{k+1}$ to $S(,)$ then it is $f(k)$.  Meaning we avoided two nasty quantifiers.  See [this file][1] for some experimental examples.  Also change of variables $z = p/(1-p)$ makes collecting terms much easier.


  [1]: https://github.com/WinVector/Examples/blob/master/freq/python/freqMin.rst