4
$\begingroup$

Count the variance of n Bernoulli trials with each probability of success is p.

Let random variable $X_i$ be
$1$ if trial is success, or
$0$ if trial fails.

Then expected value $E(X_i) = 1 \times p + 0 \times (1 - p) = p$.
By linearity of expectation $E(X) = p_1 + p_2 + ... + p_n = np$.

To count the variance, I use this formula $V(X) = E(X^2) - E(X)^2$.

where $E(X_i^2) = 1^2 \times p + 0^2 \times (1 - p) = p$
then, $E(X^2) = p_1 + p_2 + ... + p_n = np$.

So, I got variance $V(X) = np - (np)^2 = np(1 - np)$.

But in wiki, it says that the correct variance is $np(1 - p)$.

Where did I do wrong?
Thanks a lot for the help.

$\endgroup$
3
  • 1
    $\begingroup$ math.stackexchange.com/questions/240070/… Does that help? $\endgroup$
    – Meow
    Aug 13, 2013 at 19:43
  • $\begingroup$ @Alyosha, thanks for the link. I'm still a bit confused, so, $E(X_i^2) \neq p$ ? $\endgroup$
    – user350954
    Aug 13, 2013 at 19:48
  • 1
    $\begingroup$ @user350954: your solution can't be correct since in most cases $1-np<0$, which makes the variance negative $\endgroup$
    – Alex
    Aug 13, 2013 at 19:51

2 Answers 2

6
$\begingroup$

The variance of $n$ independent things is the sum of their variances, so $$\text{Var}(X)=\sum_i\text{Var}(X_i)=\sum_iE(X_i^2)-E(X_i)^2$$ Note that your proposed equality $$\text{Var}(X)= E(X^2)-E(X)^2=\sum_iE(X_i^2)- \left(\sum_iE(X_i)\right)^2$$ does not satisfy this, as here the squaring is done after the summing, so two different terms $E(X_i)$ and $E(X_j)$ will multiply, so the independence is lost.

$\endgroup$
0
3
$\begingroup$

The problem with your proof is that the square of a sum is not equal to the sum of the squares, which is what you used to say $E(X^2)=np$.

$\endgroup$
1
  • 1
    $\begingroup$ Thanks, I guess this sums up the problem in general $\endgroup$
    – user350954
    Aug 13, 2013 at 20:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .