By the end of this lesson, you should be able to
- Identify a random variable and interpret its distribution.
- Recognize the assumptions required for a binomial model.
- Calculate and interpret a binomial probability and expected value.
Suppose we toss a fair coin twenty times and count the number of heads. There is no mystery about the procedure, but the count is not fixed in advance.
That count is a random variable: a numerical function of an uncertain outcome. The entire set of probabilities assigned to its possible values is its probability distribution.
Discrete random variables
Let be the number of heads in twenty independent, fair coin tosses. The possible values are .
A probability mass function lists for each possible . Every entry is nonnegative, and all the probabilities sum to one.
The count is not equally likely to be 0 or 10. There is exactly one way to get 20 heads, but many different sequences with exactly 10 heads.
The binomial distribution
A binomial model applies when we have:
- A fixed number of trials.
- Exactly two relevant outcomes per trial, often called success and failure.
- A constant probability of success for each trial.
- Independent trials.
Then , the number of successes, follows a binomial distribution:
The term is the number of ways to arrange successes among trials.
For a fair coin, . With two tosses, the probability of exactly one head is
If you count the sequences and , you get exactly the same answer.
Expected value isn’t necessarily a possible outcome
For a binomial random variable,
The expected number of heads in twenty fair tosses is , and its standard deviation is .
In one trial of a different experiment, the expected value might be 2.6 successes. That does not mean 2.6 successes can actually occur. An expectation is a long-run weighted average, not a promise about a single experiment.
Real data can violate the model
Imagine surveying ten people who all live in the same household. Their answers may be correlated. If we pretend their responses are independent Bernoulli trials, the simple binomial model may badly misrepresent the uncertainty.
Likewise, changing success probabilities from person to person violate the constant- assumption of the basic model.
Those are not small print. They are reasons to ask whether a probability model is suitable before applying it.
From probability to inference
Once we specify a binomial model, we can ask: If the coin really is fair, how surprising would a count of 18 heads in 20 tosses be?
That’s the doorway into hypothesis testing. The exact binomial test laboratory lets you explore that question. Unlike a normal approximation, it calculates the finite-sample probabilities directly.
Exercise
- Give the four conditions for a binomial count.
- What is the probability of exactly 2 heads in 3 independent fair tosses?
- If , what are its mean and variance?
Worked answers
-
Fixed number of trials, two outcomes, constant success probability, independent trials.
-
.
-
Mean ; variance .
Read further
See OpenStax: Discrete Random Variables.
Derive and compute the distribution
Let indicate success on trial . Under independent identical Bernoulli trials, and
For and , exactly two successes has probability . At least one has probability . The expected count is 1 and standard deviation . A count mean and a single count outcome are different objects, even when their numerical values happen to coincide.
If probabilities differ by trial while trials remain independent, the count generally follows a Poisson-binomial distribution, not this binomial formula. Sampling without replacement from a small finite population instead calls for a hypergeometric model. Dependence or changing probability must be examined before selecting a familiar mass function.
For large , direct factorial arithmetic can overflow. Software works with log probabilities or stable recurrences. A numerical display of zero can mean underflow rather than an impossible event. In R, dbinom(k,n,p,log=TRUE) retains log probabilities, while pbinom computes cumulative probabilities without requiring manual summation of rounded masses.
Additional practice
- For , calculate and .
- Calculate mean and variance of in that example.
- Why does a basketball player’s number of successes not necessarily satisfy independent constant-probability assumptions?
Worked additional solutions
- and .
- Mean and variance .
- Skill, fatigue, defense, shot difficulty, and serial dependence may change success probability or connect outcomes. A binary outcome alone is not a binomial justification.
Keep your place
Mark this lesson complete after you've read it, attempted its exercises, and explained its central idea in your own words.
Progress is not saved unless you choose to mark the lesson complete.
Saved only in this browser's local storage. No required account, server transmission, or analytics. You can reset your saved progress on the course page. Clearing browser data also clears the record.