How to find $E(\bar X_n(1-\bar X_n))$ (Bernoulli random variables) I'm trying to solve this exercise:


Let $X_1,\ldots, X_n$ be i.i.d. Bernoulli random variables, with
unknown parameter $p\in (0, 1)$. The aim of this exercise is to
estimate the common variance of the Xi’s.

*

*Show that $var(X_i) = p(1 − p)$

*Let $\bar X_n$ be the sample average of the $X_i$’s. Prove that $\bar X_n(1 − \bar X_n)$ is a consistent estimator of $p(1 − p)$.

*Compute the bias of this estimator.

*Using the previous question, find an unbiased estimator of $p(1 − p)$.



I solved in this way:

*

*We have $E(X_i)=p$ and $E[X_i^2]=1^2\cdot p+ 0^2\cdot(1-p)=p$ by LOTUS. Then $var(X_i)=p - p^2=p(1-p)$.


*By WLLN we have $\bar X_n\xrightarrow{P} p$ and by the mapping theorem we have $\bar X_n(1-\bar X_n)\xrightarrow{P}p(1-p)$


*I don't know how to find $E(\bar X_n(1-\bar X_n))$. I Tried to expand $\bar X_n$ but it gives me ugly calculations.
I'm stuck in the question 3, I need help how to proceed.

$$E[\bar{X}_n(1-\bar{X}_n)]=E[\bar{X}_n]-E[\bar{X}^2_n]=E[\bar{X}_n]-\left[Var(\bar{X_n})+E[\bar{X}_n]^2\right]$$
