Solution (source code)

= Solution

For $n\geq1$, the binomial <log-likelihood> is $X\log\theta+(n-X)\log(1-\theta)$ plus a constant. Its maximizer, including endpoints, is \b[$\widehat\theta_{\rm MLE}=X/n$]. For $0<\theta<1$, the <Fisher information> is
$$
\boxed{I(\theta)=\frac{n}{\theta(1-\theta)}.}
$$
This follows either from the expected negative second derivative or the <variance> of $(X-n\theta)/(\theta(1-\theta))$. At $0,1$ the usual regular score formula does not apply; the interior information diverges as an endpoint is approached.

For a symmetric <Beta distribution> prior $\operatorname{Beta}(s,s)$, conjugacy gives $\theta\mid X\sim\operatorname{Beta}(X+s,n-X+s)$, with <posterior mean> $(X+s)/(n+2s)$. All three priors below are instances of this calculation.