Statistics 101 — Mean and variance of Bernoulli distribution
A Bernouilli distribution is a discrete probability distribution for a Bernouilli trial — a random experiment that has only two outcomes (usually called a “Success” or a “Failure”). For example, the probability of getting ahead (a “success”) while flipping a coin is 0.5. The probability of “failure” is 1 — P (1 minus the probability of success, which also equals 0.5 for a coin toss). It is a special case of the binomial distribution for n = 1. In other words, it is a binomial distribution with a single trial (e.g. a single coin toss).
The probability of failure is labeled on the x-axis as 0 and success is labeled as 1. In the following Bernoulli distribution, the probability of success (1) is 0.4, and the probability of failure (0) is 0.6:
Bernoulli distribution
The probability density function (pdf) for this distribution is px (1 — p)1 — x, which can also be written as:
pdf Bernoulli
The expected value for a random variable, X, from a Bernoulli distribution is:
E[X] = p.
For example, if p = .04, then E[X] = 0.4.
The variance of a Bernoulli random variable is:
Var[X] = p(1 — p).