伯努利分布:
则根据离散型随机变量的均值和方差定义:
E(X)=0*(1-p)+1*p=p
D(X)=(0-E(X))2(1-p)+(1-E(X))2p=p2(1-p)+(1-p)2p=p2-p3+p3-2p2+p=p-p2=p(1-p)