A lesson from Essential Probability & Statistics for ML
£29/month
£29/month£29/month or £249/year · 30-day money-back guarantee
Get full accessOur content is best on a larger screen
The Bernoulli story
The PMF of a discrete random variable gives its distribution: from it we can find the probability of any event about the random variable. Random variables from quite different experiments often have PMFs of the same form, and the forms that come up most often are given names.
It helps to remember each one by a story: a simple experiment that gives rise to it. The simplest story is a single trial in which some event happens with probability and otherwise does not, such as a coin landing heads.
We call it a success if the event happens and a failure if it does not, and let on a success and on a failure. Then , so the one number fixes the whole PMF.
Definition
A random variable that takes only the values and has the Bernoulli distribution with parameter , where , when
We write , and read as "is distributed as".
Key Point
Each value of gives a different Bernoulli distribution. Saying that is Bernoulli does not fix its PMF until is given.
The bar chart below shows how the PMF changes with .
The bar at
Practice questions
4 questions
Which of these random variables has a Bernoulli distribution?
Select the correct answer:
+ 3 more questions · unlocked with a subscription
The mean of a Bernoulli
For a named distribution we usually find two summaries first. The mean tells us where its values are centred, and the variance tells us how far they tend to lie from that centre. Together they give a quick picture of the distribution without its full PMF.
For , we find the mean in terms of with the expected value formula, which multiplies each value by its probability and adds:
A Bernoulli random variable has two values, so the sum has two terms:
The value contributes nothing, so the mean is the success probability.
Theorem
If , then
This matches the mean as a long-run average: over many trials, the average of is the proportion of trials that are successes, which is close to .
A random variable takes only the values and , and . Find the PMF of .
Solution
takes only the values and , so has a Bernoulli distribution, for some .
The mean of a Bernoulli is its success probability, so the stated mean gives the parameter:
The value has the remaining probability:
The PMF of is
so is distributed as .
Practice questions
4 questions
A factory part fails its check with probability , and if the part passes and if it fails. What is ?
Select the correct answer:
+ 3 more questions · unlocked with a subscription
The variance of a Bernoulli
Like its mean, the variance of a Bernoulli depends only on .
Theorem
If , then
That is, the variance of a Bernoulli is its success probability times its failure probability. The steps below show how it depends on .
Each point on the curve is the variance of
Details
Machine makes a faulty part with probability , and machine with probability . For one part from each machine, if the part from is faulty and otherwise, and if the part from is faulty and otherwise. Which of and has the larger variance?
Solution
takes only the values and , with when the part from machine is faulty. That happens with probability , so is Bernoulli with parameter . In the same way, is Bernoulli with parameter :
The variance of a Bernoulli is its success probability times its failure probability:
So has the larger variance.
This fits the shape of : the variance is largest at , and is nearer than is.
Practice questions
5 questions
A bulb lasts a year with probability , and if it does and if it does not. What is ?
Select the correct answer:
+ 4 more questions · unlocked with a subscription
Every time you pull an answer from memory, the memory gets stronger. Reading doesn't do that. Nodeledge asks you questions on every step of every lesson, then asks again after days, weeks and months.