Bernoulli Distribution — Definition, Formula & Examples
A Bernoulli distribution is a probability distribution for a random variable that has exactly two possible outcomes: success (1) with probability and failure (0) with probability .
A discrete random variable follows a Bernoulli distribution with parameter , written , if its probability mass function is for . Its mean is , its variance is , and its moment-generating function is .
Key Formula
Where:
- = Bernoulli random variable (equals 0 or 1)
- = Outcome value, either 0 (failure) or 1 (success)
- = Probability of success, where 0 ≤ p ≤ 1
How It Works
The Bernoulli distribution models any random experiment with exactly two outcomes — a coin flip, whether a customer buys a product, or whether a manufactured part is defective. You assign one outcome as "success" () and the other as "failure" (), then specify the probability of success. Once you know , you know everything about the distribution: the mean is simply , and the variance is . When you repeat independent Bernoulli trials times and count the total number of successes, the result follows a binomial distribution with parameters and .
Worked Example
Problem: A free-throw shooter makes 80% of her shots. Model a single free throw as a Bernoulli random variable and find the probability of a miss, the mean, and the variance.
Define the variable: Let if she makes the shot (success) and if she misses (failure). Then .
Find P(miss): The probability of a miss is the complement of the probability of success.
Compute the mean: The expected value of a Bernoulli random variable equals .
Compute the variance: Apply the variance formula for the Bernoulli distribution.
Answer: The probability of a miss is 0.20, the mean is 0.80, and the variance is 0.16.
Another Example
Problem: A quality inspector checks light bulbs. Each bulb has a 3% chance of being defective. What is the probability that a single randomly chosen bulb is not defective?
Set up the Bernoulli model: Define "success" as finding a defective bulb: .
Calculate P(not defective): A non-defective bulb corresponds to .
Answer: The probability that the bulb is not defective is 0.97.
Why It Matters
The Bernoulli distribution is the building block for the binomial, geometric, and negative binomial distributions, all of which appear throughout an introductory statistics or probability course. In data science and machine learning, logistic regression models each observation as a Bernoulli trial to predict binary outcomes like spam vs. not-spam. Understanding this distribution is essential before tackling hypothesis testing for proportions.
Common Mistakes
Mistake: Confusing the Bernoulli distribution with the binomial distribution and using in the formula.
Correction: A Bernoulli distribution always models a single trial (). If you are counting successes over multiple independent trials, you need the binomial distribution.
Mistake: Assuming "success" must be a positive or desirable outcome.
Correction: "Success" is just the label for the outcome you are tracking. It can represent a defective part, a disease diagnosis, or any event whose probability you want to model.
