# How to get standard deviation when having a weighted average

I need some help. I have the expected number of heads in one coin toss. This is:

$$0.4 \times 0 + 0.6 \times 1 = 0.6$$

Now, I need the standard deviation, but I just can't understand how I need to do this.

The question is:

Give the standard deviation of the variable number of heads in one coin toss' is approximately equal to 0.4

How do I start? What do I need? Can someone point me in the right direction?

Am I assuming it right when I am saying that expected value = expected mean = expected number = weighted average`? Or is this not a fair assumption?

Since this seem to be a homework question, let me give you a hint.

From your description, you are dealing with a random variable $X \in \{0,1\}$, where $p = \Pr(X = 1) = 0.6$ and $q = \Pr(X = 0) = 0.4$. Given this information you are to calculate standard deviation of this variable.

First, you are right that expected value of this random variable is

$$\operatorname{E}[X] = \Pr(X=1)\times 1 + \Pr(X=0)\times 0 = p \times 1 + q\times 0 = p$$

from the definition of expected value

$$\operatorname{E}[X] = x_1 \times \Pr(X=x_1) + \dots + x_k \times \Pr(X=x_k)$$

as about standard deviation, recall that from the definition variance is

$$\operatorname{Var}[X] = \operatorname{E}[X^2]-\operatorname{E}[X]^2$$

and standard deviation is just a square root of variance. You already know how to calculate $\operatorname{E}[X]$, so next you need to calculate $\operatorname{E}[X^2]$ (expected value of $X$ squared).

Notice that this has nothing to do with calculating weighted means and bothering with them, this is simply about applying the definitions of expected value and variance. We would be talking about weighted mean and sample variance, if you calculated them from the data, but in here you are talking about properties of random variable and it's expected value and variance.

• Thanks for your answer, Tim. It is a bit more clear to me now, but still struggling with it. Because... in my case, E[X] would be 0.6. When I'd have the square of that (0.36) I would need to deduct the square of it again... So we'd get 0.36 - 0.36. That would give us zero... how can you take the square root of that? What am I doing wrong? How should I calculate the variance? Cause clearly, I am doing something wrong. – Siyah Nov 16 '16 at 11:29
• @Siyah hint: you are not subtracting $E[X]^2 - E[X]^2$ but $E[X^2] - E[X]^2$ -- otherwise variance would be zero for literally anything... – Tim Nov 16 '16 at 11:32
• Still don't get it Tim.. Not your fault, that's my fault, but I don't see the difference, because E[X] = 0.6... so why is E[X]2 not 0.36? – Siyah Nov 16 '16 at 11:36
• @Siyah it is... It is all about $E[X^2]$ -- expected value of $X^2$. – Tim Nov 16 '16 at 11:38
• Expected value of X2... so you mean it's 0x0 and 1x1 because (X = 0) and (X=1)? And you'd get Var[X] = 0.6x1 - 0.4x0 = 0.2? – Siyah Nov 16 '16 at 11:40