coin flip variance

7k Views Asked by At

Suppose that a coin is tossed twice and the random variable is the number of heads, how do you calculate the variance? I already did the calculation for expected value and got 1.

3

There are 3 best solutions below

1
On

Hint:

Compute $E[X^2]$ and use $$Var(X)=E[X^2]-E[X]^2$$

0
On

You did: $\quad \mathsf E(X) \\= \sum_{x=0}^2 x\,\mathsf P(X=x) \\ = 0\cdot \tfrac 14+1\cdot\tfrac 12 + 2\cdot\tfrac 14 \\=1$

Now do: $\quad \mathsf {Var}(X) \\ =\mathsf E((X-\mathsf E(X))^2) \\= \mathsf E((X-1)^2) \\ = \sum_{x=0}^2 (x-1)^2\, \mathsf P(X=x) \\ ~\vdots $


Edit: or use $\mathsf{Var}(X)=\mathsf E(X^2)-\mathsf E(X)^2$ if you prefer.

0
On

Two ways for variance: either use "deviations:"

$$ V(X) = \frac{1}{n} \sum_{x \in X} (X - \mu)^2 $$

or the best thing ever, the shortcut:

$$ V(X) = \mu_{X^2} - \mu_{X}^2 $$

that is, mean of square minus square of mean.