29  Bernoulli random variable

Figure 29.1: Distribution (left) and density (right) functions of a Bernoulli random variable.

29.1 Distribution and density

Definition 29.1 To construct a continuous distribution for a Bernoulli random variable, one can use the linear combination of two heavy side functions (), i.e.  (29.1)FB(x)=H(x)(1p)+H(x1)p. Given that the distribution function is specified in terms of Heavyside function, it is possible to take the derivative with respect to x to obtain the density function, i.e.  (29.2)fB(x)=δ(x)(1p)+δ(x1)p, where δ(x) is the Dirac function ().

29.2 Characteristic function

Proposition 29.1 The characteristic function of a Bernoulli random variable reads explicitly: (29.3)ϕB(t)=peit+(1+p), and similarly the moment generating function (29.4)MB(t)=pet+(1+p).

Proof. By the definition of characteristic function, one have to compute the following expectation, i.e.  ϕB(t)=E{eitX}==eity[pδ(y1)+(1p)δ(y)]dy==peityδ(y1)dy+eityδ(y)dypeityδ(y)dy==peit1+eit0peit0==peit+(1p) where, thanks to the fundamental property () of the Dirac delta the final expression simplifies.

29.3 Moments

Proposition 29.2 The n-th moment of a Bernoulli random variable with probability p reads E{Bn}=P(B=1)=p, for all nN.

Proof. Let’s considering the characteristic function of the Bernoulli () and take the derivative with respect to t, i.e.  tϕB(t)=ipeitE{B}=tϕB(t)i=peit. Hence, the above expression evaluated in t=0 gives E{B}=tϕB(t)in|t=0=p. Thanks to the exponential structure the n-th derivative reads tnϕB(t)=inpeitE{Bn}=tnϕB(t)in=peit. Therefore, all the n moments are exactly equal to p. The same result is obtained with the moment generating function ().