Variance calculation of mean of i.i.d. random Bernoulli variables

138 Views Asked by At

Define each i.i.d. indicator variable $X_i$ as Bernoulli with $p = \frac{\pi}{4}$. If we want to find the variance of $X$, which is defined as the mean of $n$ of these indicator variables, then we would use the formula $$Var(X) = \frac{Var(X_i)}{n} = \frac{\frac{\pi}{4}\left( 1-\frac{\pi}{4}\right)}{n}.$$ However, when I try to calculate the variance using $Var(X) = E(X^2) - E(X)^2,$ I run into the issue that $E(X)$ is simply $\frac{\pi}{4},$ with no $n$ term in the denominator. Thus, I get $$Var(X) = \frac{\pi}{4n} - \frac{\pi^2}{16}$$ which is different from the value calculated previously. What am I doing wrong in the second calculation?

2

There are 2 best solutions below

0
On

Your implicit $E\left(\bar X^2\right)= \frac1n E\left( X_i^2\right)=\frac{\pi}{4n}$ is not correct, though $\rm{Var}\left(\bar X\right)=\frac1n \rm{Var}(X_i)$ would be.

In fact $E\left(\bar X^2\right) = \frac{\pi}{4n}+\frac{\pi^2}{16}\left(1-\frac1n\right)$ here.

0
On

Indeed, $\mathsf E(X)=p$ , but your calculation of $\mathsf E(X^2)$ is wrong.

Begin here:

$\qquad\begin{align}\mathsf E(X^2)&=\mathsf E\left((\tfrac 1n\sum_i X_i)(\tfrac 1n\sum_j X_j)\right)\\[1ex]&=\tfrac 1{n^2}\left(\sum_i\mathsf E(X_i^2)+\sum_{i,j\,:\,i\neq j}\mathsf E(X_i\,X_j)\right)\\[1ex]&=\tfrac 1{n^2}\left(\sum_i\mathsf E(X_i^2)+\sum_{i,j\,:\,i\neq j}\mathsf E(X_i)\mathsf E(X_j)\right) \end{align}$