Difficulty: Intermediate | Prerequisites: Basic probability rules, set theory, integration basics
This material sits at the heart of STAT 3021: you are moving from counting outcomes and assigning probabilities to events (Chapters 1 and 2) into the formal machinery that lets you model entire experiments with a single function. Random variables, PMFs, PDFs, and CDFs are the language every later topic in the course (expectation, variance, named distributions, hypothesis testing) is built on. If you can classify a variable, write its PMF or PDF, verify validity, and compute probabilities from it, you have the toolkit for everything that follows.
A random variable maps outcomes of an experiment to numbers. Discrete random variables use a probability mass function (PMF) to assign probabilities to individual values; continuous random variables use a probability density function (PDF) where probabilities come from integrating over intervals. Both types have a cumulative distribution function (CDF) that gives P(X ≤ x). Validity checks boil down to two rules: all values non-negative, and the total probability equals 1.
Random variable (RV)
A function that assigns a numerical value to each outcome in a sample space. In simple terms, it turns the result of an experiment into a number you can do maths with.
Discrete random variable
A random variable whose set of possible values is finite or countably infinite (e.g. 0, 1, 2, 3, 4, 5). Think of it as anything you can list out and count on your fingers, even if the list is long.
Continuous random variable
A random variable that can take any value within an interval (or union of intervals) on the real line. Think of it as anything you would measure rather than count: time, weight, distance.
Probability mass function (PMF)
For a discrete RV X, the function p(x) = P(X = x) that gives the probability of each individual value. The two requirements: p(x) ≥ 0 for all x, and the sum of all p(x) values equals 1.
Probability density function (PDF)
For a continuous RV X, the function f(x) such that probabilities are found by integrating: P(a ≤ X ≤ b) = ∫ from a to b of f(x) dx. The two requirements: f(x) ≥ 0 for all x, and ∫ from −∞ to ∞ of f(x) dx = 1. Note: f(x) itself is not a probability; it can exceed 1.
Cumulative distribution function (CDF)
F(x) = P(X ≤ x), defined for all real x, for both discrete and continuous random variables. It is non-decreasing, right-continuous, approaches 0 as x → −∞ and 1 as x → ∞.
Binomial distribution
The distribution of the number of successes in n independent trials, each with the same probability of success p. PMF: P(X = k) = C(n, k) · p^k · (1 − p)^(n − k) for k = 0, 1, ..., n. Think of it as the go-to model for "how many times does something happen in a fixed number of attempts."
Ask: can I list every possible value? If yes, the variable is discrete. Counting the number of successful free throws out of 5 attempts gives X ∈ {0, 1, 2, 3, 4, 5}, a finite set, so X is discrete.
When each trial is independent and has the same probability of success p, the number of successes X in n trials follows a Binomial(n, p) distribution.
Setup from the homework: n = 5 trials, p = 0.70 success rate per throw.
Possible values: X can be 0, 1, 2, 3, 4, or 5.
PMF formula: P(X = k) = C(5, k) · (0.7)^k · (0.3)^(5 − k), for k = 0, 1, 2, 3, 4, 5.
P(X = 3): C(5, 3) · (0.7)^3 · (0.3)^2 = 10 · 0.343 · 0.09 = 0.3087.
P(X ≤ 3): Sum P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3). This equals 0.00243 + 0.02835 + 0.1323 + 0.3087 = 0.47178.
Comparison: P(X ≤ 3) is strictly larger than P(X = 3) because the cumulative probability includes P(X = 3) plus all the probabilities for values below 3.
Sometimes you are handed a table rather than a formula. For example, X takes values −1, 1, 3 with probabilities 0.25, 0.15, 0.60.
Validity check: All probabilities are non-negative, and 0.25 + 0.15 + 0.60 = 1.00. Valid.
P(X ≤ 1): Sum all probabilities where x ≤ 1, so P(X = −1) + P(X = 1) = 0.25 + 0.15 = 0.40.
P(X < 1): Sum all probabilities where x is strictly less than 1, so P(X = −1) = 0.25.
The difference: P(X ≤ 1) − P(X < 1) = P(X = 1) = 0.15. For discrete RVs, ≤ and < give different answers whenever the boundary value has positive probability.
If the variable can take any real value in some interval (not just isolated points), it is continuous. Measurements like height, time, and temperature are classic examples.
For a continuous RV, f(x) is a density, not a probability. You cannot say "the probability of X being exactly 2.5 is f(2.5)." Probabilities come only from integrating the PDF over an interval.
This also means P(X = any single value) = 0 for continuous variables. So P(X > 1) = P(X ≥ 1), and P(X ≤ 3) = P(X < 3). The strict and non-strict inequalities give the same answer.
Two conditions must hold:
f(x) ≥ 0 for all x.
∫ from −∞ to ∞ of f(x) dx = 1.
Example from the homework: f(x) = 3x^(−4) for x ≥ 1, and 0 otherwise.
Non-negativity: 3x^(−4) > 0 for all x ≥ 1. Satisfied.
Total integral: ∫ from 1 to ∞ of 3x^(−4) dx = 3 · [x^(−3) / (−3)] from 1 to ∞ = [−x^(−3)] from 1 to ∞ = 0 − (−1) = 1. Satisfied.
Set the total integral equal to 1 and solve for the constant.
Example from the homework: f(y) = y² + c for 0 ≤ y ≤ 1, and 0 otherwise.
∫ from 0 to 1 of (y² + c) dy = [y³/3 + cy] from 0 to 1 = 1/3 + c.
Set equal to 1: 1/3 + c = 1, so c = 2/3.
Also check non-negativity: y² + 2/3 ≥ 0 + 2/3 > 0 for all y in [0, 1]. Valid.
Example: P(X > 1) for f(x) = 3x^(−4), x ≥ 1.
P(X > 1) = ∫ from 1 to ∞ of 3x^(−4) dx = 1 (the entire support is x ≥ 1).
P(X ≥ 0) = P(X ≥ 1) = 1 (because f(x) = 0 for x < 1, so integrating from 0 to 1 adds nothing).
Both equal 1. They are the same because the density lives entirely on [1, ∞).
F(x) = P(X ≤ x) accumulates probability from left to right. It answers the question: "What is the probability that X is at most x?"
Every CDF shares three properties: it is non-decreasing, it approaches 0 as x → −∞, and it approaches 1 as x → +∞.
The CDF is a step function. It jumps at each value the RV can take, and the size of each jump equals the probability of that value.
Example from the homework: X takes values −1, 1, 3 with probabilities 0.25, 0.15, 0.60.
F(x) = 0 for x < −1
F(x) = 0.25 for −1 ≤ x < 1
F(x) = 0.40 for 1 ≤ x < 3
F(x) = 1.00 for x ≥ 3
The function is right-continuous: at each jump point, the value of F includes the jump (closed on the left of each interval of constancy, or equivalently the step lands at the point, not just after it).
The CDF is obtained by integrating the PDF from −∞ up to x.
Example from the homework: f(x) = 3x^(−4) for x ≥ 1.
For x < 1: F(x) = 0.
For x ≥ 1: F(x) = ∫ from 1 to x of 3t^(−4) dt = [−t^(−3)] from 1 to x = 1 − x^(−3).
So F(x) = 1 − 1/x³ for x ≥ 1, and 0 otherwise. Notice F(1) = 0, and as x → ∞, F(x) → 1.
P(X ≤ a) = F(a) directly.
P(X > a) = 1 − F(a).
P(a < X ≤ b) = F(b) − F(a).
For continuous RVs, P(X < a) = P(X ≤ a) = F(a) because individual points carry zero probability.
For discrete RVs, P(X < a) may differ from P(X ≤ a) if a is one of the possible values.
This comes up repeatedly in homework and exams. The procedure is mechanical once you know the two rules.
Check that every probability value is ≥ 0.
Check that the sum of all probability values equals exactly 1.
If a constant is unknown, set the sum equal to 1 and solve.
Check that f(x) ≥ 0 for all x in the support (and zero elsewhere).
Check that ∫ from −∞ to ∞ of f(x) dx = 1.
If a constant c is unknown, compute the integral in terms of c, set it equal to 1, and solve. Then verify the non-negativity condition still holds with the value of c you found.
Worked example: f(y) = y² + c on [0, 1].
∫₀¹ (y² + c) dy = 1/3 + c = 1, so c = 2/3.
Check: y² + 2/3 ≥ 2/3 > 0 for all y ∈ [0, 1]. Non-negativity holds.
\text{Binomial PMF: } P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}, \quad k = 0, 1, \ldots, n\text{CDF (continuous): } F(x) = \int_{-\infty}^{x} f(t)\, dt\text{CDF (discrete): } F(x) = \sum_{t \leq x} P(X = t)\text{PDF validity: } f(x) \geq 0 \text{ for all } x, \quad \int_{-\infty}^{\infty} f(x)\, dx = 1\text{PMF validity: } p(x) \geq 0 \text{ for all } x, \quad \sum_{\text{all } x} p(x) = 1P(a < X \leq b) = F(b) - F(a)Students often think f(x) in a PDF gives the probability of x. It does not. The PDF value is a density; you must integrate over an interval to get a probability. A PDF can have values greater than 1, and that is perfectly fine.
Students often treat P(X ≤ a) and P(X < a) as interchangeable. For continuous RVs this is true, but for discrete RVs it is not. P(X ≤ 1) and P(X < 1) differ by exactly P(X = 1) when X is discrete.
Students sometimes forget to check both conditions when validating a PDF or PMF. Non-negativity and the total-equals-one condition must both be verified. Finding a constant that makes the integral equal 1 is not enough if the resulting function goes negative somewhere.
Students sometimes confuse the PMF with the CDF. The PMF gives probability at a single point; the CDF gives cumulative probability up to and including that point.
⚠️ "Classify the random variable as discrete or continuous" is a near-certain exam question. The answer hinges on whether you count or measure.
⚠️ You will almost certainly be asked to verify that a function is a valid PMF or PDF. Have the two-condition checklist memorised cold.
⚠️ "Find the constant c" problems appear frequently. The technique is always the same: integrate (or sum) over the support, set equal to 1, solve for c, then verify non-negativity.
⚠️ Expect a question comparing P(X ≤ a) with P(X < a) or P(X = a). Know the answer differs by type: for continuous RVs they are equal, for discrete RVs they differ by the point mass at a.
⚠️ CDF sketching for discrete distributions is a common exam task. Remember: step function, right-continuous, jumps at each possible value by the size of that value's probability.
Q: True or false: A probability density function f(x) can never exceed 1.
A: False. A PDF is a density, not a probability. It can exceed 1 as long as the total area under the curve is 1.
Q: True or false: For a discrete random variable, P(X ≤ 3) = P(X < 3) + P(X = 3).
A: True. This is always the case, discrete or continuous.
Q: Fill in the blank: To verify a PMF is valid, check that all values are ______ and that they sum to ______.
A: Non-negative (≥ 0); 1.
Q: True or false: For a continuous random variable, P(X = 5) = 0.
A: True. Individual points carry zero probability for continuous distributions.
Q: A basketball player shoots 5 free throws with 70% accuracy. What distribution does the number of makes follow?
A: Binomial(n = 5, p = 0.7).
Q: Suppose Y is a continuous RV with PDF f(y) = 4y³ for 0 ≤ y ≤ 1, and 0 otherwise. Verify this is a valid PDF.
A: f(y) = 4y³ ≥ 0 on [0, 1]. ∫₀¹ 4y³ dy = [y⁴]₀¹ = 1. Both conditions met, so it is valid.
Q: Using the PMF table where X takes values −1, 1, 3 with probabilities 0.25, 0.15, 0.60, compute P(X ≥ 1).
A: P(X ≥ 1) = P(X = 1) + P(X = 3) = 0.15 + 0.60 = 0.75.
Q: For X ~ Binomial(5, 0.7), what is P(X = 5)?
A: P(X = 5) = C(5, 5) · (0.7)⁵ · (0.3)⁰ = 1 · 0.16807 · 1 = 0.16807.
Q: A continuous RV has CDF F(x) = 1 − 1/x³ for x ≥ 1. Find P(1 ≤ X ≤ 2).
A: P(1 ≤ X ≤ 2) = F(2) − F(1) = (1 − 1/8) − (1 − 1) = 7/8 − 0 = 0.875.
Q: Why does P(X > 1) = P(X ≥ 1) for a continuous random variable but not necessarily for a discrete one?
A: For continuous RVs, P(X = 1) = 0, so removing or including the single point x = 1 changes nothing. For discrete RVs, P(X = 1) can be positive, so the two expressions differ by that amount.
This material feeds directly into expected value and variance (next chapter), which are computed by summing xp(x) for discrete RVs or integrating xf(x) for continuous ones. You cannot compute those without a valid PMF or PDF.
The binomial distribution introduced here is one of several named discrete distributions you will meet (Poisson, geometric, hypergeometric). Each has its own PMF, but the validity rules and CDF logic are identical.
CDFs become central again when you study percentiles, quantiles, and the normal distribution. The idea that F(x) = P(X ≤ x) is the backbone of statistical inference later in the course.
Quality control in manufacturing uses binomial models to decide how many items in a batch are defective. The free-throw example is a simplified version of the same structure.
Power-law PDFs like f(x) = 3x^(−4) model phenomena where extreme values are rare but possible, including income distributions and the sizes of natural disasters.
Random variable, discrete vs continuous, PMF, PDF, CDF, cumulative distribution function, probability mass function, probability density function, binomial distribution, Binomial(n, p), step function, right-continuous, power-law distribution, STAT 3021, UMN, intro probability, valid PMF, valid PDF, find constant c, integrate PDF, sum PMF, P(X ≤ x), P(X = x), P(X > x)