2
$\begingroup$

I am trying to show E$\big[\frac{\bar{X}(1-\bar{X})}{n}\big] = \frac{(n-1)p((1-p)}{n^2}$, for $X_1, X_2,\ldots, X_n\sim\operatorname{b}(1,p)$.

I can get to E$\big[\frac{\bar{X}(1-\bar{X})}{n}\big]$ = $\frac{1}{n^2}(np) - (\frac{1}{n}E\big[\bar{X}^2\big])$,which I'm pretty sure is correct, but I'm having trouble simplifying E$\big[\bar{X}^2\big]$.

I have: \begin{align} \frac{1}{n} E\big[\bar{X}^2\big] &= \frac{1}{n^3} E\big[\sum_{i=1}^n X_i^2\big]\\ &= \frac{1}{n^3} E\big[(\sum_{i=1}^n X_i)(\sum_{i=1}^{n}X_i)\big]\\ &= \frac{1}{n^3} \Big(\sum_{i=1}^n\big(E(X_i)E(X_i)\Big)\\ &= \frac{1}{n^3} \Big(\sum_{i=1}^n(np)^2\Big)\\ &= \frac{1}{n^3} (n^3p^2)\\ &= p^2 \end{align} If I use $p^2$, however, then I get $(\frac{1}{n^2})np - p^2 = \frac{p(1-np)}{n}$, which is incorrect. If someone could explain where I've gone wrong I'd greatly appreciate the help. Thank you very much.

  • 0
    $\text{Var}(X)=E(X^2)-E^2(X)$, then $E(X^2)=\text{Var}(X)+E^2(X)$2017-02-05
  • 0
    Your mistake is to believe that $$E\big[\sum_{i=1}^{n}X_i\cdot\sum_{i=1}^{n}X_i\big]= \sum_{i=1}^nE(X_i)E(X_i)$$ while you should use $$E\big[\sum_{i=1}^{n}X_i\cdot\sum_{i=1}^{n}X_i\big]= \sum_{i=1}^n\sum_{j=1}^nE(X_iX_j)$$ involving $n^2$ terms instead of $n$, and the variances and the expectations instead of simply the expectations. By the way, after this faulty step, using $$E(X_i)=np$$ is frankly bizarre.2017-02-05
  • 0
    @Did Thank you very much for your explanation.2017-02-05

1 Answers 1

2

If you know that $$n\bar X \sim \operatorname{Binomial}(n,p),$$ so that $$\operatorname{E}[n \bar X] = np, \quad \operatorname{Var}[n \bar X] = np(1-p),$$ then the calculation is straightforward: $$\begin{align*} \operatorname{E}\left[\frac{\bar X (1-\bar X)}{n}\right] &= \operatorname{E}\left[\frac{n \bar X}{n^2} - \frac{(n \bar X)^2}{n^3}\right] \\ &= \frac{1}{n^2} \operatorname{E}[n \bar X] - \frac{1}{n^3}\operatorname{E}[(n \bar X)^2] \\ &= \frac{np}{n^2} - \frac{1}{n^3} \left( \operatorname{Var}[n \bar X] + \operatorname{E}[n \bar X]^2 \right) \\ &= \frac{p}{n} - \frac{np(1-p) + (np)^2}{n^3} \\ &= \frac{np - p(1-p) - n p^2}{n^2} \\ &= \frac{(n-1)p(1-p)}{n^2}. \end{align*}$$ If we do not assume the formulas for mean and variance of a binomial distribution are known, then we observe that $$\operatorname{E}[n \bar X] = \operatorname{E}\left[\sum_{i=1}^n X_i\right] = \sum_{i=1}^n \operatorname{E}[X_i] = \sum_{i=1}^n p = np.$$ Similarly $$\begin{align*}\operatorname{E}[(n \bar X)^2] &= \operatorname{E}\left[\biggl(\sum_{i=1}^n X_i\biggr)^2\right] \\ &= \operatorname{E}\left[\sum_{i=1}^n \sum_{j=1}^n X_i X_j \right] \\ &= \sum_{i=1}^n \sum_{j=1}^n \operatorname{E}[X_i X_j].\end{align*} $$ We then note that if $i \ne j$, $X_i$ and $X_j$ are independent, thus $$\operatorname{E}[X_i X_j] \overset{\text{ind}}{=} \operatorname{E}[X_i] \operatorname{E}[X_j] = p^2.$$ When $i = j$, then $X_i = X_j = X_i^2$, and because $X_i \sim \operatorname{Bernoulli}(p)$, $X_i^2 = X_i$ (i.e. $X_i = 1$ if and only if $X_i^2 = 1$, and $X_i = 0$ otherwise) and $\operatorname{E}[X_i^2] = p$. Thus our second moment is $$\operatorname{E}[(n \bar X)^2] = np + n(n-1)p^2 = np(1-p) + np^2,$$ since there are exactly $n$ cases where $i = j$, and $n(n-1)$ cases where $i \ne j$.

  • 0
    Thank you very much for your detailed answer. I had not seen E$\big[n\bar{X}\big] = np$ before, only E$\big[X\big] = np$. Similarly, I was not familiar with Var$\big[n\bar{X}\big] = np(1-p)$, only Var$\big[X\big] = np(1-p)$. Is E$\big[n\bar{X}\big] =$ E$\big[X\big]$ and Var$\big[n\bar{X}\big] =$ Var$\big[X\big]$ true for any distribution?2017-02-06
  • 0
    @BenL126 When $X_1, X_2, \ldots, X_n$ are iid $\operatorname{Bernoulli}(p)$ variables, their sum is $$\sum_{i=1}^n X_i = n\bar X \sim \operatorname{Binomial}(n,p).$$ I am only using $n \bar X$ as a convenient name for the sum.2017-02-06