Distributions · Definition
Bernoulli distribution
Before you start you need to know
It is the simplest model of an experiment with two outcomes and the building block of other distributions.
Definition
A Bernoulli variable \(X\) only takes the values 1 (success) and 0 (failure); its only parameter \(p\) is the probability \(P\) of success.
A Bernoulli trial is any experiment with two outcomes called success and failure: a free throw that goes in or not, a defective or good part, a 6 on a die. The variable encodes success as 1 and failure as 0; its mass function reduces to the pair \(P(X=1)=p\), \(P(X=0)=1-p\).
Its expectation and variance are computed directly: \(E[X]=1\cdot p+0\cdot(1-p)=p\) and, since \(X^2=X\), \(E[X^2]=p\), so \(\operatorname{Var}(X)=p-p^2=p(1-p)\). A typical mistake is writing \(p^2\) as the variance.
The variance \(p(1-p)\) is largest, equal to \(\tfrac14\), when \(p=\tfrac12\) (maximum uncertainty) and is 0 when \(p=0\) or \(p=1\), since the outcome is already certain. With a die and success = «a 6 shows», \(p=\tfrac16\) and \(\operatorname{Var}(X)=\tfrac5{36}\).
Every indicator variable of an event \(A\) (1 if \(A\) occurs, 0 otherwise) is Bernoulli with \(p=P(A)\), so \(E[X]=P(A)\): probabilities and expectations become linked. Repeating independent trials and counting successes leads to the binomial distribution.
Think about it
Why is \(X^2=X\) for a Bernoulli variable, and what follows from it?
Because it only takes the values 0 and 1, which satisfy \(x^2=x\). Hence \(E[X^2]=E[X]=p\) and the variance is \(p-p^2\).
If event \(A\) has probability 0.25, what is the expectation of its indicator?
0.25, because the indicator is Bernoulli with \(p=P(A)\) and \(E[X]=p\).
Exercises 10
- A Bernoulli variable has \(p=0.3\). Compute \(E[X]\).
- A Bernoulli variable has \(p=0.3\). Compute \(\operatorname{Var}(X)\).
- Which of these variables is Bernoulli?
- A fair die is rolled and \(X=1\) if a 6 shows, \(X=0\) otherwise. Compute \(\operatorname{Var}(X)\).
- A fair die is rolled and \(X=1\) if a multiple of 3 shows, \(X=0\) otherwise. Compute \(E[X]\).
- If \(X\) is Bernoulli with \(p=0.4\), compute \(E[X^2]\).
- If \(X\) is Bernoulli and \(E[X]=0.6\), compute \(\operatorname{Var}(X)\).
- For which value of \(p\) is the variance of a Bernoulli variable largest?
- A Bernoulli variable has \(\operatorname{Var}(X)=0.16\) and \(p<\tfrac12\). What is \(p\)?
- If \(X\) is Bernoulli, which statement is true?
What comes next
References
- Joseph K. Blitzstein, Jessica Hwang, Introduction to Probability, 2nd edition, CRC Press, 2019. §3.3
- Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. §4.6
- Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying Ye, Probabilidad y estadística para ingeniería y ciencias, 9.ª edición, Pearson, 2012. §5.2