Search for probability and statistics terms on Statlect
StatLect

Bernoulli distribution

by , PhD

The Bernoulli distribution is a univariate discrete distribution used to model random experiments that have binary outcomes.

Table of Contents

How the distribution is used

Suppose that you perform an experiment with two possible outcomes: either success or failure.

Success happens with probability p, while failure happens with probability $1-p$.

A random variable that takes value 1 in case of success and 0 in case of failure is called a Bernoulli random variable (alternatively, it is said to have a Bernoulli distribution).

Definition

Bernoulli random variables are characterized as follows.

Definition Let X be a discrete random variable. Let its support be[eq1]Let [eq2]. We say that X has a Bernoulli distribution with parameter p if its probability mass function is[eq3]

Note that, by the above definition, any indicator function is a Bernoulli random variable.

The following is a proof that [eq4] is a legitimate probability mass function.

Proof

Non-negativity is obvious. We need to prove that the sum of [eq5] over its support equals 1. This is proved as follows:[eq6]

Expected value

The expected value of a Bernoulli random variable X is[eq7]

Proof

It can be derived as follows:[eq8]

Variance

The variance of a Bernoulli random variable X is[eq9]

Proof

It can be derived thanks to the usual variance formula ([eq10]):[eq11]

Moment generating function

The moment generating function of a Bernoulli random variable X is defined for any t in R:[eq12]

Proof

Using the definition of moment generating function, we get[eq13]Obviously, the above expected value exists for any t in R.

Characteristic function

The characteristic function of a Bernoulli random variable X is[eq14]

Proof

Using the definition of characteristic function, we obtain[eq15]

Distribution function

The distribution function of a Bernoulli random variable X is[eq16]

Proof

Remember the definition of distribution function:[eq17]and the fact that X can take either value 0 or value 1. If $x<0$, then [eq18] because X can not take values strictly smaller than 0. If [eq19], then [eq20] because 0 is the only value strictly smaller than 1 that X can take. Finally, if $xgeq 1$, then [eq21] because all values X can take are smaller than or equal to 1.

Relation between the Bernoulli and the binomial distribution

A sum of independent Bernoulli random variables is a binomial random variable. This is discussed and proved in the lecture entitled Binomial distribution.

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Let X and Y be two independent Bernoulli random variables with parameter p. Derive the probability mass function of their sum[eq22]

Solution

The probability mass function of X is[eq23]The probability mass function of Y is[eq24]The support of Z (the set of values Z can take) is[eq25]The convolution formula for the probability mass function of a sum of two independent variables is[eq26]where $R_{Y}$ is the support of Y. When $z=0$, the formula gives[eq27]When $z=1$, the formula gives[eq28]When $z=2$, the formula gives[eq29]Therefore, the probability mass function of Z is[eq30]

Exercise 2

Let X be a Bernoulli random variable with parameter $p=1/2$. Find its tenth moment.

Solution

The moment generating function of X is[eq31]The tenth moment of X is equal to the tenth derivative of its moment generating function, evaluated at $t=0$:[eq32]But[eq33]so that[eq34]

How to cite

Please cite as:

Taboga, Marco (2021). "Bernoulli distribution", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/probability-distributions/Bernoulli-distribution.

The books

Most of the learning materials found on this website are now available in a traditional textbook format.