4
$\begingroup$

$\newcommand\E{\mathbb E}$Suppose we toss a coin $n$ times, and let the r.v. $X$ denote the number of heads we see. Moreover, let $X_{i} = 1$ if the $i$-th toss is a heads, otherwise $0$.

$$\mathrm{Var}(X) = \E(X^{2}) - (\E(X))^{2} = \sum_{i=1}^{n} \Pr(X_{i} = 1)(1^{2}) - \left(\frac{n}{2}\right)^{2} = \frac{n}{2} - \frac{n^{2}}{4}$$

Thus, if $n=100$, this would mean the variance is $50 - 2500 = -2450$...

What am I missing here?

$\endgroup$

1 Answer 1

10
$\begingroup$

$\DeclareMathOperator\E{\mathbb E}$This "equality": $$ \E(X^2)\ ``="\sum_{i=1}^n \Pr(X_i = 1) (1^2) $$ is not correct. That's saying $$ \left( \sum_{i=1}^n a_i \right)^2\ ``=" \sum_{i=1}^n a_i^2 ,$$ when it should actually be $$ \left( \sum_{i=1}^n a_i \right)^2 = \sum_{i=1}^n a_i^2 + \sum_{i \ne j} a_i a_j .$$

The correct version is then \begin{align} \E(X^2) &= \E \left( \sum_{i=1}^n X_i^2 + \sum_{i \ne j} X_i X_j \right) \\&= \sum_{i=1}^n \E\left[ X_i^2 \right] + \sum_{i \ne j} \E\left[ X_i X_j \right] \\&= \sum_{i=1}^n \left( \Pr\left(X_i = 0 \right) 0^2 + \Pr\left( X_i = 1 \right) 1^2 \right) + \sum_{i \ne j} \E\left[ X_i \right] \E\left[ X_j \right] \\&= \sum_{i=1}^n \frac12 + \sum_{i \ne j} \frac{1}{2} \frac{1}{2} \\&= \frac{n}{2} + \frac{1}{4} n (n-1) \\&= \frac14 n^2 + \frac14 n ,\end{align} so that $$ \mathrm{Var}(X) = \frac14 n^2 + \frac14 n - \frac14 n^2 = \frac{n}{4} .$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.