§ 01What Is a Discrete Probability Distribution?
A discrete distribution assigns a probability to each of a countable set of outcomes. Before we can talk about means and variances, we need to understand exactly what a probability distribution is.
In everyday life, many phenomena produce outcomes that can be listed: the number of heads in five coin flips, the number of goals scored in a football match, the number of defective chips in a batch of 100. These are discrete random variables: they take values from a finite or countably infinite set, usually the non-negative integers.
A probability distribution is a complete description of how likely each possible value is. For a discrete random variable X, we capture this using two closely related functions: the probability mass function (PMF) and the cumulative distribution function (CDF).
The most important discrete distributions you will encounter at varsity level are the Binomial, Poisson, Geometric, Hypergeometric, and Negative Binomial distributions. On this page we build the foundations, PMF, CDF, E[X], and Var[X], that make all of these distributions understandable.
§ 02The Probability Mass Function (PMF)
The probability mass function of a discrete random variable X is the function that tells you the probability that X takes each specific value.
The PMF must satisfy two axioms, the same axioms that underpin all of probability theory:
If either axiom is violated, the function is not a valid PMF. The first axiom says probabilities can never be negative. The second says that when you add up the probabilities of all possible outcomes, you get exactly one, meaning something must happen.
Reading a PMF from a table
PMFs are often presented as a table of values. Consider the number of heads X when a fair coin is tossed three times:
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 1/8 | 3/8 | 3/8 | 1/8 |
Check: 1/8 + 3/8 + 3/8 + 1/8 = 8/8 = 1. ✓ The PMF sums to 1.
The PMF can also be displayed as a bar chart, a key visualisation for understanding the shape and spread of a distribution. Each bar sits at a value x and has height equal to P(X = x).
§ 03Interactive PMF Diagram — Binomial(n, p)
The chart below shows the PMF of the Binomial distribution B(n, p). Drag the sliders to change n (number of trials) and p (probability of success) and watch how the distribution shifts, spreads, and skews.
P(X = k) = C(n,k) · pk · (1−p)n−k
Notice how the distribution is symmetric when p = 0.5, right-skewed when p is small, and left-skewed when p is large. As n increases, the bell-shaped normal approximation becomes visible, this is the Central Limit Theorem at work.
§ 04The Cumulative Distribution Function (CDF)
While the PMF answers "what is the probability X equals exactly x?", the cumulative distribution function (CDF) answers "what is the probability that X is at most x?"
The CDF accumulates probabilities. For the three-coin-toss example:
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 1/8 | 3/8 | 3/8 | 1/8 |
| F(x) = P(X ≤ x) | 1/8 | 4/8 | 7/8 | 8/8 = 1 |
Properties of the CDF
Every valid CDF for a discrete random variable satisfies these four properties. Knowing them helps you spot errors and answer "at least / at most" probability questions quickly:
For a discrete distribution, the CDF is a staircase function, it remains flat between values of X and jumps upward at each value by an amount equal to P(X = x). This contrasts with a continuous distribution, where the CDF is a smooth, increasing curve.
Using the CDF for probability calculations
The CDF unlocks efficient computation of "between" and "at least" probabilities:
§ 05Expected Value — The Weighted Average
The expected value E[X] (also called the mean or population mean, denoted μ) is the long-run average value of X over infinitely many independent repetitions of the experiment.
This is a weighted average of all possible values of X, where the weight of each value is its probability. Values that are more likely contribute more to the average.
Linearity of Expectation
One of the most powerful results in probability is that expectation is linear, regardless of whether the random variables are independent:
This means you can calculate the expected value of a sum by summing the individual expected values: even for dependent random variables. This property is used everywhere, from computing expected winnings in card games to analysing the average case complexity of algorithms.
Expected value of a function of X
Often we need E[g(X)] for some function g. The law of the unconscious statistician (LOTUS) states:
This is used constantly when computing variance, as we shall see next.
§ 06Variance and Standard Deviation
The expected value tells us where the distribution is centred. The variance Var[X] (also written σ²) tells us how spread out the distribution is: how far typical values of X deviate from the mean.
This is the expected squared deviation from the mean. Squaring ensures positive values and penalises large deviations more heavily.
The computational shortcut
Expanding (x − μ)² and applying linearity of expectation gives a far more convenient formula for calculation:
In words: variance equals the mean of the squares, minus the square of the mean. This formula is almost always faster to use in calculations because it avoids computing μ separately before working through each squared deviation.
Standard Deviation
The standard deviation σ = √Var[X] measures spread in the same units as X, making it directly interpretable. Variance is in squared units (e.g., goals², dollars²), which is why standard deviation is reported when describing real-world data.
Note that adding a constant b shifts the distribution but does not change its spread, only multiplying by a stretches or compresses it. The b disappears because variance measures deviation from the mean, and adding a constant shifts both X and the mean by the same amount.
§ 07Worked Examples
Ten fully worked examples, escalating from reading a PMF table to computing variance from scratch.
P(X = 1) = k, P(X = 2) = 2k, P(X = 3) = 3k, P(X = 4) = 4k
- For a valid PMF, all probabilities must sum to 1:
k + 2k + 3k + 4k = 1 - Collect terms:
10k = 1 ⟹ k = 1/10 - The distribution is: P(1)=0.1, P(2)=0.2, P(3)=0.3, P(4)=0.4.
- Check axioms: all values ≥ 0 ✓, and 0.1+0.2+0.3+0.4 = 1 ✓
- F(1) = P(X ≤ 1) = 0.1
- F(2) = P(X ≤ 2) = 0.1 + 0.2 = 0.3
- F(3) = P(X ≤ 3) = 0.3 + 0.3 = 0.6
- F(4) = P(X ≤ 4) = 0.6 + 0.4 = 1.0
- P(X > 2) = 1 − F(2) = 1 − 0.3 = 0.7
- Apply the definition E[X] = Σ x · P(X = x):
- E[X] = 0(0.2) + 1(0.5) + 2(0.3)
- E[X] = 0 + 0.5 + 0.6 = 1.1
- We already know E[X] = 1.1, so (E[X])² = 1.21.
- Compute E[X²] = Σ x² · P(X = x):
E[X²] = 0²(0.2) + 1²(0.5) + 2²(0.3) = 0 + 0.5 + 1.2 = 1.7 - Apply the shortcut:
Var[X] = 1.7 − 1.21 = 0.49 - Standard deviation: σ = √0.49 = 0.7
- Each outcome has probability 1/6. By symmetry or calculation:
E[X] = (1+2+3+4+5+6)/6 = 21/6 = 3.5 - E[X²] = (1²+2²+3²+4²+5²+6²)/6 = (1+4+9+16+25+36)/6 = 91/6 ≈ 15.167
- Var[X] = E[X²] − (E[X])² = 91/6 − (7/2)² = 91/6 − 49/4
- Common denominator 12: 182/12 − 147/12 = 35/12 ≈ 2.917
- Use E[aX + b] = aE[X] + b:
E[3X − 2] = 3(5) − 2 = 13 - Use Var[aX + b] = a²Var[X]:
Var[3X − 2] = 9 × 4 = 36
- Build the CDF: F(0)=0.05, F(1)=0.25, F(2)=0.60, F(3)=0.85, F(4)=1.
- P(1 ≤ X ≤ 3) = F(3) − F(0) = 0.85 − 0.05 = 0.80
- Alternatively, add directly: P(1)+P(2)+P(3) = 0.20+0.35+0.25 = 0.80 ✓
- Sum the PMF over all k ≥ 1: Σk=1∞ (1−p)k−1p
- Factor out p: p · Σk=1∞ (1−p)k−1 = p · Σj=0∞ (1−p)j
- This is a geometric series with ratio r = (1−p) where |r| < 1 (since 0 < p ≤ 1):
= p · 1/(1−(1−p)) = p · 1/p = 1 ✓ - The expected value is E[X] = 1/p. (Derivation uses differentiation of the geometric series.)
- Σ P(X=x) = 1 ⟹ c(1 + 1/2 + 1/3 + 1/4 + 1/5) = 1
- Sum = (60+30+20+15+12)/60 = 137/60. So c = 60/137.
- E[X] = Σ x · (c/x) = Σ c = 5c = 300/137 ≈ 2.19
- E[X²] = Σ x² · (c/x) = c · Σ x = c(1+2+3+4+5) = 15c = 900/137 ≈ 6.57
- Var[X] = 6.57 − (2.19)² ≈ 6.57 − 4.80 ≈ 1.77
- By symmetry, E[X] = 0.
- E[X²] = (4+1+0+1+4)/5 = 10/5 = 2
- Var[X] = E[X²] − (E[X])² = 2 − 0 = 2
- By linearity: E[X² + 3X − 1] = E[X²] + 3E[X] − 1 = 2 + 0 − 1 = 1
§ 08Common Mistakes
§ 0910-Question Quiz
Test your understanding. Select an answer for each question, then click Check All Answers.
§ 10Continue in Probability
Now that you understand PMFs, CDFs, expected value, and variance, you are ready to study the named discrete distributions that apply these tools to real-world settings.