# Bernoulli distribution: expectation problem with independent random variables

We have $X_1,...,X_n$ as $n$ independent random variables under the Bernoulli distribution i.e.:

$$P(X_i=1)=p$$ $$P(X_i=0)=1-p$$

where, $p$ is an unknown parameter. The distribution $Y=\sum_1^n X_i$ is the binomial distribution such that $Y\sim \mathrm{Binom}(n,p)$. I have found that $\bar X$ is an estimate of $Y/n$ but now it asks to find $E(\bar X(1-\bar X))$ as $(n-1)p(1-p)/n$

Any ideas how to calculate this the best way, would I expand or separate to $\mathrm{E}(\bar X)\mathrm{E}(1-\bar X)$? Would this involve manipulating the binomial formula?

-

Hint: $$E[\bar{X}(1-\bar{X})]=E[\bar{X}]-E[\bar{X}^2]=\frac{1}{n}E[Y]-\frac{1}{n^2}E[Y^2]$$