<s>[INST] Fisher information of a Binomial distribution The Fisher information is defined as $\mathbb{E}\Bigg( \frac{d \log f(p,x)}{dp} \Bigg)^2$, where $f(p,x)={{n}\choose{x}} p^x (1-p)^{n-x}$ for a Binomial distribution. The derivative of the log-likelihood function is $L'(p,x) = \frac{x}{p} - \frac{n-x}{1-p}$. Now, to get the Fisher infomation we need to square it and take the expectation.
First, we know, that $\mathbb{E}X^2$ for $X \sim Bin(n,p)$ is $ n^2p^2 +np(1-p)$. Let's first focus on on the content of the paratheses.
$$
\begin{align}
\Bigg( \frac{x}{p} - \frac{n-x}{1-p} \Bigg)^2&=\frac{x^2-2nxp+n^2p^2}{p^2(1-p)^2}
\end{align}
$$
No mistake so far (I hope!).
\begin{align}
\mathbb{E}\Bigg( \frac{x}{p} - \frac{n-x}{1-p} \Bigg)^2 &= \sum_{x=0}^n \Bigg( \frac{x}{p} - \frac{n-x}{1-p} \Bigg)^2 {{n}\choose{x}} p^x (1-p)^{n-x} \\
&=\sum_{x=0}^n \Bigg( \frac{x^2-2nxp+n^2p^2}{p^2(1-p)^2} \Bigg) {{n}\choose{x}} p^x (1-p)^{n-x} \\
&= \frac{n^2p^2+np(1-p)-2n^2p^2+n^2p^2}{p^2(1-p)^2}\\
&=\frac{n}{p(1-p)}
\end{align}
The result should be $\frac{1}{p(1-p)} $ but I've been staring at this for a few hours incapable of getting a different answer. Please let me know whether I'm making any arithmetic mistakes.
 [/INST] Fisher information: $I_n(p) = nI(p)$, and $I(p)=-\mathbb{E_p}\Bigg( \frac{\partial^2 \log f(p,x)}{\partial p^2} \Bigg)$, where $f(p,x)={{1}\choose{x}} p^x (1-p)^{1-x}$ for a Binomial distribution. We start with $n=1$ as single trial to calculate $I(p)$, then get $I_n(p)$.
$\log f(p,x) = x \log p + (1-x) \log p$
$\frac {\partial \log f(p,X)}{\partial p} = \frac {X}{p} - \frac {1- X}{1 - p}$
$\frac {\partial^2 \log f(p,X)}{\partial p^2} = -\frac {X}{p^2} - \frac {1- X}{(1 - p)^2}$
$I(P) = -\mathbb{E_p}\Bigg( \frac{\partial^2 \log f(p,x)}{\partial p^2} \Bigg) = -\mathbb{E_p}\Bigg(-\frac {X}{p^2} - \frac {1- X}{(1 - p)^2}\Bigg) = \frac {p}{p^2} + \frac {1-p}{(1-p)^2} = \frac {1}{p} + \frac {1}{(1-p)} = \frac {1}{p(1-p)} $
As a result, $I_n(p) = n I(p) = \frac {n}{p(1-p)} $
</s>