TITLE: Variance of summation of Bernoulli variables
QUESTION [6 upvotes]: Let $X_1,\ldots,X_n$ be independent Bernoulli variables, with probability of success $p_i$ and let $Y_n =\frac1n\sum\limits^n_{i=1} (X_i - p_i )$
a) find the mean and variance of $Y_n$
b) show that for every $a>0, \lim\limits_{n\to\infty} P(Y_n<a)=1$

Now for the mean, it was quite straightforward: $E[Y_n]=0$, however the variance not so much. they said $Var(Y_N)= \dfrac{\sum_{i=1}^n p_i(1-p_i)}{n^2}$
why did they not take out the summation as I have to do almost every time? is the same as $\dfrac{Var(X_i)}{n^2}$ ?

REPLY [5 votes]: $$ \begin{align} \mathbb{E}[Y_n] &=\dfrac{\sum^n_{i=1} (\mathbb{E}[X_i] - p_i )}{n}\\
& =0\\\end{align} $$ 
$$ \begin{align} Var[Y_n]&=\mathbb{E}[Y_n^2]-\mathbb{E}^2[Y_n]\\ 
& =\mathbb{E}[Y_n^2]=\mathbb{E}[(\dfrac{\sum^n_{i=1} (X_i - p_i )}n)^2]\\
&=\frac1{n^2}\mathbb{E}[\sum^n_{i=1}\sum^n_{j=1}(X_i-p_i)(X_j-p_j)]\\
&=\frac1{n^2}\sum^n_{i=1}\sum^n_{j=1}\mathbb{E}[(X_i-p_i)(X_j-p_j)]\\
&=\frac1{n^2}(\underbrace{\sum^n_{i=1}\sum^n_{j \ne i,j=1}\mathbb{E}[(X_i-p_i)]\mathbb{E}[(X_j-p_j)]}_{=0 (i \ne j \Rightarrow X_i \bot X_j)}+\sum^n_{i=1}\mathbb{E}[(X_i-p_i)^2]\\
&=\frac1{n^2}\sum^n_{i=1}p_i(1-p_i)
\end{align}
$$
note that $\mathbb{E}[.]$ is a linear operator