Solution (source code)

= Solution

By the <bias-variance decomposition of mean squared error>,
$$
\operatorname{MSE}(k\bar X)=\theta^2\left[(k-1)^2+\frac{k^2}{n}\right].
$$
For $\theta\ne0$, comparison with the unbiased estimator reduces to
$$
(n+1)k^2-2nk+n-1<0.
$$
Its roots are $(n-1)/(n+1)$ and $1$, so
$$
\boxed{\frac{n-1}{n+1}<k<1.}
$$
Equality at either endpoint gives the same risk as $\bar X$. At $\theta=0$, every risk is zero, so no strict improvement is possible. This illustrates <shrinking a sample mean with variance proportional to mean squared>: allowing a small <bias> can reduce <variance> enough to improve total risk. The best constant is $k=n/(n+1)$, whose <mean squared error> is $\theta^2/(n+1)$.