Discrete Random Variables and Probability Distributions
Problem
Let X = the number of heads in 3 coin flips. List all 8 outcomes, build the probability distribution table, and graph P(X = k) as a bar chart.
Explanation
What is a discrete random variable?
A random variable is a numeric function of the outcome of a random experiment. A discrete random variable takes values in a countable set — typically the integers .
Its behavior is summarized by a probability mass function (PMF) , which must satisfy:
- for every ,
- .
Step-by-step construction
Setup: Flip a fair coin 3 times. Each of the ordered outcomes is equally likely (probability ). Let count the number of heads.
Step 1 — Enumerate all 8 outcomes and their values:
- TTT → 0
- HTT, THT, TTH → 1
- HHT, HTH, THH → 2
- HHH → 3
Step 2 — Count favorable outcomes for each value:
- : 1 outcome.
- : 3 outcomes.
- : 3 outcomes.
- : 1 outcome.
Step 3 — Build the PMF (each entry is count divided by 8):
Step 4 — Check the total: ✓.
Summary statistics
Expected value (mean):
Variance:
where .
Standard deviation: .
Recognizing the pattern
The counts are row 3 of Pascal's triangle. This is no coincidence: is Binomial(), and .
Cumulative distribution function (CDF)
sums the PMF from the left:
A discrete CDF is a step function jumping at each possible value.
Common mistakes
- Forgetting to enumerate ordered outcomes. HTT, THT, TTH are three different outcomes that all give ; collapsing them under-counts.
- Confusing PMF with CDF. PMF gives point probabilities; CDF accumulates from the left.
- Assuming probabilities must be fractions with nice denominators. Any nonnegative numbers that sum to 1 form a valid PMF.
Try it in the visualization
Adjust (number of flips) and (heads probability) sliders. The sample-space grid highlights each outcome, and the bar chart of reshapes to match. Toggle to show the CDF as a cumulative line.
Interactive Visualization
Parameters
Got your own math or physics problem?
Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.