Help calculating the expectation of the square of the average of random variables

47 Views Asked by At

I have $\bar{X_n} = \frac{1}{n}\sum_{i=1}^n X_i$, where the $X_i$ are iid Bernoulli with parameter $p$, and I want to find $\mathbb{E}[\bar{X_n}^2]$. When I do this by deriving it from the variance, I get $\mathbb{E}[\bar{X_n}^2] = p^2 + \frac{p(1-p)}{n}$, and I know this is correct.

But my problem is that I can't get my answer to match when I derive the expectation directly, using linearity of expectation. Can someone tell me where I'm going wrong in the following sequence of steps?

  1. $\mathbb{E}[\bar{X_n}^2] = \mathbb{E}[(\frac{1}{n}\sum_{i=1}^n X_i)(\frac{1}{n}\sum_{i=1}^n X_i)]$.
  2. I pull out the $\frac{1}{n}$'s: $\frac{1}{n^2} \mathbb{E}[(\sum_{i=1}^n X_i)(\sum_{i=1}^n X_i)]$
  3. Expanding the summations: $\frac{1}{n^2} \mathbb{E}[(X_1 + \cdots + X_n)(X_1 + \cdots + X_n)]$.
  4. There are $n^2$ of the $X_i^2$ terms (where $X_i*X_j$ is equivalent to $X_i^2$, because they're iid): $\frac{1}{n^2} \mathbb{E}[n^2 * X_i^2]$.
  5. Pulling out the $n^2$ and recalling that $\mathbb{E}[X_i^2] = \mathbb{E}[X_i]$ for Bernoulli random variables, gives the final result of $p$.
1

There are 1 best solutions below

1
On BEST ANSWER

$\mathbb{E}(X_iX_j)$ (for $i\neq j$) is not the same as $\mathbb{E}(X_i^2)$, because $X_i,X_j$ are independent but $X_i,X_i$ are not. There is a difference between iid and identical events.

Explicitly,

$$\begin{align}X_i^2&=\begin{cases}1 & \text{if}\ X_i=1\\ 0 & \text{if}\ X_i=0 \\ \end{cases} \\ &=\begin{cases}1 & \text{with probability}\ p\\ 0 & \text{with probability}\ 1-p \\ \end{cases}\end{align}$$

$$\begin{align}X_iX_j&=\begin{cases}1 & \text{if}\ X_i=1,X_j=1\\ 0 & \text{otherwise} \\ \end{cases} \\&=\begin{cases}1 & \text{with probability}\ p^2\\ 0 & \text{with probability}\ 1-p^2 \\ \end{cases}\end{align}$$

So, $\mathbb{E}(X_iX_j)=p^2$ if $i\neq j$ and $\mathbb{E}(X_i^2)=p$. Now, how many pairs $X_iX_j,i\neq j$ are there, and how many pairs $X_i^2$ are there? And how do you continue your expectation calculation from there?