= Solution
Under the uniform prior, the posterior density after $X=x$ is proportional to $\theta^x(1-\theta)^{n-x}$. For $0<x<n$, differentiating posterior risk gives the unique stationary point
$$
a=
\frac{\mathbb E[(1-\theta)^{-1}\mid x]}
{\mathbb E[(\theta(1-\theta))^{-1}\mid x]}
=\frac{B(x+1,n-x)}{B(x,n-x)}=\frac xn.
$$
Strict convexity makes it the unique minimum. For $x=0$, every $a\ne0$ gives infinite posterior risk at zero and $a=0$ is optimal; symmetrically $a=1$ is optimal for $x=n$. Hence the unique Bayes rule is $\delta(x)=x/n$.
Back to article page