TITLE: Variance of Binomial Distribution $E[X^2]$
QUESTION [6 upvotes]: so I'm trying to use the equation:
$Var(X) = E[X^2] - (E[x])^2$,
And for the $E[X^2]$ part, I'm trying to use the method of indicators...
However, when I do that, I get the same value as with $E[X]$...
Is it wrong to try to use the method of indicators for this case?
Basically, I end up with
$Var(X) = np(1-np)$, 
when it should be $Var(X) = np(1-p)$.

REPLY [14 votes]: The method of indicators works well here. Let $X_i=1$ if we have a success on the $i$-th trial, and $0$ otherwise. 
Then $X=X_1+X_2+\cdots+X_n$. Expand $(X_1+X_2+\cdots+X_n)^2$. We find that
$$X^2=\sum_1^n X_i^2+2\sum_{i\lt j}X_iX_j.$$
Calculate the expectation, using linearity.  Each $X_i^2$ has expectation $p$, since $X_i^2=X_i$. Thus $E(\sum_1^n X_i^2)=np$.
By independence, if $i\ne j$, $E(X_i X_j)=E(X_i)E(X_j)=p^2$.
Now count. The number of pairs $(i,j)$ with $i\lt j$ is $\binom{n}{2}$. So we get
$$E(X^2)=np +n(n-1)p^2.$$
But $(E(X))^2=n^2p^2$. Thus $E(X^2)-(E(X))^2=np-np^2$. This simplifies to $np(1-p)$.