For n= 5, p = 0.5
If I calculate the variance using np(1-p) I get 1.25
If I calculate using the sum of the squared differences divided by n As explained here I get 3.5
What am I missing?
For n= 5, p = 0.5
If I calculate the variance using np(1-p) I get 1.25
If I calculate using the sum of the squared differences divided by n As explained here I get 3.5
What am I missing?
Hint: The formula for the variance is
$$Var(X)=\sum_{k=0}^5 (x_k-\mu)^2\cdot f_X(k),$$
where $f_X(k)$ is the pmf of the binomial distribution which can be interpreted as a weight. See the table.