Let \(X_1,\ldots ,X_n\) be a random sample from a \(N(\theta ,1)\) distribution, and let the prior distribution of \(\theta \) be \(N(\mu _0,1)\), where \(\mu _0\) is known.
(a) Find the posterior distribution of \(\theta \).
(b) Find the Bayes estimator of \(\theta \) under squared error loss, and show that it is a weighted average of the prior mean \(\mu _0\) and the sample mean \(\bar X\).