Explains Bernoulli and binomial distributions, probability versus expected value, examples using rain forecasts, calculations, and applications in machine learning.
Probability quantifies the chance of a single event (for example, rain at 6 PM). Expected value (mean) describes the average outcome across many repeated experiments. Understanding both helps translate single-event forecasts into long-run expectations.
If each of 10 consecutive hours has a 70% chance of rain, we expect about 7 rainy hours on average. Expected value gives this “big picture” across repeated trials, while a single forecast provides the probability for one trial.
The Bernoulli distribution models a single binary outcome: success (e.g., rain) with probability p, or failure (no rain) with probability 1 − p. The two outcomes are mutually exclusive and exhaustive. The Bernoulli random variable X takes values 1 (success) or 0 (failure).
Practical example: Justyna sees a 70% chance of rain at 6 PM. Under a Bernoulli model, the two outcomes are:
Rain: probability p = 0.7
No rain: probability 1 − p = 0.3
With such a high p, bringing an umbrella is a rational decision. Bernoulli models are the building block for binary decision-making and binary classifiers in machine learning.
From Bernoulli to binomial — multiple repeated trials
When the same Bernoulli trial is repeated a fixed number of times (n), and trials are independent with constant success probability p, the count of successes X follows a binomial distribution.The binomial model applies when:
the experiment is repeated a fixed number of times (n),
each trial has exactly two outcomes (success or failure),
the probability of success p is constant across trials,
trials are independent.
Return to Justyna’s 10-hour forecast: each hour is a trial (n = 10), success = rainy hour, p = 0.7, and we assume independence between hours. This fits the binomial model.
Key questions you can ask with the binomial model:
What is the probability it rains in exactly 3 of the 10 hours?
What is the probability of exactly 7 rainy hours?
What is the chance it rains every hour?
The binomial probability mass function gives the probability of exactly x successes in n trials:P(X = x) = C(n, x) * p^x * (1 − p)^(n − x)where C(n, x) = “n choose x” is the number of distinct ways to choose which x trials are successes.
The combination factor uses factorials:C(n, x) = n! / (x! (n − x)!)A factorial n! is n × (n − 1) × … × 1. Factorials get large quickly, but many terms cancel when computing combinations.
Plotting the full distribution from X = 0 to 10 shows that low counts (0–2) have very small probability mass, while counts around 6–8 are much more likely. The mode (tallest bar) in this example is at 7, matching the expected value.The expected value (mean) of a binomial distribution is straightforward:E[X] = n * pFor n = 10 and p = 0.7:
E[X] = 10 * 0.7 = 7
Why isn’t the probability of exactly 7 equal to 1 even though the mean is 7? Because the mean is an average across many repeated 10-hour experiments. Any single 10-hour period can produce 5, 6, 7, or 8 rainy hours; probability mass is spread over these nearby outcomes. Over many repeated experiments, the average count will converge toward 7.An intuitive metaphor: imagine a bag with 10 marbles, 7 green (success) and 3 red (failure). Sampling with replacement 10 times will most often yield counts clustered near 7 green draws, but not always exactly 7.
Bernoulli: models a single binary label (spam vs. not spam), foundational for logistic regression and binary classification.
Binomial: models counts of successes across trials, useful for A/B testing (how many users click a link out of N impressions) and aggregate performance metrics.
These simple distributions are fundamental building blocks for probabilistic modeling and many AI techniques. They help convert single-event probabilities into actionable expectations over time.
Expected value describes the long-term average, not the guaranteed outcome of a single trial. Use the binomial distribution to quantify the probability of specific counts around that mean.