By definition, probability generating function is
ψ(r)=ErX=1−(1−p)rpr.
Moments of X can be found in a following way
EX=ψ′(1),EX2=ψ′′(1)+ψ′(1).
The derivatives of ψ are ψ′(r)=(1−(1−p)r)2p, ψ′′(r)=(1−(1−p)r)32p(1−p) ,
so EX=p1, EX2=p22(1−p)+p1=p22−p,VarX=p21−p.
Comments