I don’t understand the variance of the binomial

I feel really dumb even asking such a basic question but here goes:

If I have a random variable X that can take values 0 and 1, with P(X=1)=p and P(X=0)=1p, then if I draw n samples out of it, I’ll get a binomial distribution.

The mean of the distribution is

μ=np=E(X)

The variance of the distribution is

σ2=np(1p)

Here is where my trouble begins:

Variance is defined by σ2=E(X2)E(X)2. Because the square of the two possible X outcomes don’t change anything (02=0 and 12=1), that means E(X2)=E(X), so that means

σ2=E(X2)E(X)2=E(X)E(X)2=npn2p2=np(1np)np(1p)

Where does the extra n go? As you can probably tell I am not very good at stats so please don’t use complicated terminology :s

Answer

A random variable X taking values 0 and 1 with probabilities P(X=1)=p and P(X=0)=1p is called a Bernoulli random variable with parameter p. This random variable has
E(X)=0(1p)+1p=pE(X2)=02(1p)+12p=pVar(X)=E(X2)(E(X))2=pp2=p(1p)
Suppose you have a random sample X1,X2,,Xn of size n from Bernoulli(p), and define a new random variable Y=X1+X2++Xn, then the distribution of Y is called Binomial, whose parameters are n and p.
The mean and variance of the Binomial random variable Y is given by
E(Y)=E(X1+X2++Xn)=p+p++pn=npVar(Y)=Var(X1+X2++Xn)=Var(X1)+Var(X2)++Var(Xn) (as Xi‘s are independent)=p(1p)+p(1p)++p(1p)n (as Xi‘s are identically distributed)=np(1p)

Attribution
Source : Link , Question Author : dain , Answer Author : L.V.Rao

Leave a Comment