2
$\begingroup$

Flip an unweighted coin $N$ times, where we denote $X_i = 1$ if flip $i$ resulted in heads, and $X_i = 0$ if flip $i$ resulted in tails. Now take the average result $\bar X = \frac{\sum_{i=1}^N X_i}{N}$.

Conduct the same experiment again, this time denoting the $N$ flips $Y_i$. What is the expected value of the square of the difference between the two averages? In other words, $$E \left[ (\bar X - \bar Y)^2 \right] = E \left[ \left( \frac{\sum_{i=1}^N X_i - \sum_{i=1}^N Y_i}{N} \right)^2 \right] = ?$$

I'm interested in all of the steps leading up to the answer, which I assume should end up being some function of $N$...

  • 0
    You ask: "What is the expected value of the difference between the two averages?" but then your formula is for the expected value of the square of the difference between the two averages.2012-04-23
  • 0
    @ThomasAndrews Thanks--I clarified it (I want square of differences).2012-04-23

1 Answers 1

3

first note that $E(\bar X) = E(\bar Y)$ as $\bar X$ and $\bar Y$ have the same distribution, also $E(\bar X^2) = E(\bar Y^2)$. As $\bar X$ and $\bar Y$ are independent, we have $E(\bar X \bar Y) = E(\bar X)E(\bar Y)$. So we have \begin{align*} E\bigl((\bar X - \bar Y)^2\bigr) &= E(\bar X^2 - 2\bar X \bar Y + \bar Y^2)\\\ &= E(\bar X^2) - 2E(\bar X)E(\bar Y) + E(\bar Y^2)\\\ &= 2\bigl(E(\bar X^2) - E(\bar X)^2\bigr)\\\ &= 2V(\bar X). \end{align*} Now as the $X_i$ are independent $V(\bar X) = \frac 1{N^2}\sum_{i=1}^N V(X_i)$. We have $E(X_i^2) = E(X_i) = \frac 12$, so $V(X_i) = \frac 12 - \frac 14 = \frac 14$ and so $V(\bar X) = N \cdot \frac 1{4N^2} = \frac 1{4N}$ and by the calculation above $E[(\bar X - \bar Y)^2] = \frac 1{2N}$.

  • 1
    No. The variance is homogeneous of order $2$, i. e. $V(\alpha X) = \alpha^2V(X)$. We can see this e. g. by using $V(X) = E(X^2) - E(X)^2$ and the linearity of expectation.2012-04-23
  • 0
    Thanks! I'm still having some trouble, though, since this seems to contradict my experimental results. Maybe you can help find something wrong with this? I start with $x = 0$, then do $x = x + 1$ (with $p = \frac{1}{2}$) or $x = x + 0$ (with $p = \frac{1}{2}$), $N$ times. I take $X = x / N$, then do the same simulation independently to get $Y = y / N$. My result is then $(X - Y)^2$. For some reason, when I average the results of this experiment over $10,000$ trials for $N = 100$, I keep getting the $0.005$, which is $\frac{1}{2N}$, not $\frac{1}{2N^2}$...2012-04-23
  • 1
    Your experiment is right. I forgot to multiply with $N$ ... we have $V(\bar X) = \frac 1{N^2} \sum_{i=1}^N V(X_i) = \frac 1{N^2} \sum_{i=1}^N \frac 14 = \frac 1{N^2} \cdot N \cdot \frac 14 = \frac 1{4N}$. ... I corrected it above.2012-04-23
  • 0
    Hallelujah! I was banging my head against the wall, rereading your answer, and I didn't catch it either. Thanks for your help!2012-04-23