Random Variables and Discrete Distributions, STAT 3021 Ch. 3 – Study Notes
offline

Source: STAT 3021 Lecture Notes, Ch. 3

Difficulty: Intermediate | Prerequisites: Ch. 1–2 (sets, sample spaces, probability rules) Tags: random variable, discrete distribution, PMF, CDF, probability mass function, cumulative distribution function, STAT 3021


Big picture: Chapter 3 bridges the gap between the set-based language of probability (Chapter 2) and the numerical machinery of statistics. A random variable assigns a number to each outcome in the sample space, which lets you compute things like averages, variances, and probabilities using functions rather than listing outcomes. This chapter introduces discrete random variables and their two core descriptions: the probability mass function (PMF) and the cumulative distribution function (CDF). Everything from expected value to hypothesis testing builds on these.


TL;DR

A random variable is a function that maps each outcome in a sample space to a number. Once you have numbers instead of labels, you can describe probabilities with functions. The probability mass function (PMF) tells you the probability of each individual value; the cumulative distribution function (CDF) tells you the probability of getting that value or anything smaller.


Key Terms

Random variable

A function that associates a real number with each element in the sample space. Denoted by a capital letter (X, Y), while a specific value it takes is written in lowercase (x, y).

Think of it as a rule that converts outcomes (like "two defective components out of three") into numbers (like 2).

Discrete random variable

A random variable that can take on a countable number of distinct values (e.g. 0, 1, 2, 3). The values might be finite or countably infinite.

In simple terms, you can list the possible values, even if the list is long.

Continuous random variable

A random variable that can take any value within an interval or collection of intervals. You cannot list all possible values.

Think of it as a measurement that can land anywhere on a scale (temperature, weight, time).

Probability mass function (PMF)

A function f(x) that gives the probability that a discrete random variable X takes the value x. Written as f(x) = P(X = x). Also called the probability function or probability distribution.

In simple terms, the PMF is the complete list of "which values can X take, and how likely is each one?"

Cumulative distribution function (CDF)

A function F(x) = P(X ≤ x) that gives the probability that the random variable takes a value less than or equal to x. Defined for all real numbers, from negative infinity to positive infinity.

Think of it as a running total: for any number x, F(x) tells you the probability of landing at x or below.

Dummy variable (categorical random variable)

A random variable that is binary or categorical in nature, used to code non-numeric categories as numbers (e.g. 0 = no, 1 = yes).


Core Content: Concept of a Random Variable

What a random variable does

  • A random variable X is a function from the sample space S to the real numbers.

  • It turns qualitative outcomes into numbers you can do arithmetic with.

  • Convention: capital X for the random variable itself, lowercase x for a particular value it takes.

Example: defective components

  • Three electrical components are tested. Each is either defective (D) or non-defective (N).

  • The sample space is S = {NNN, NND, NDN, DNN, NDD, DND, DDN, DDD}.

  • Define X = the number of defective components. Then X maps each outcome to 0, 1, 2, or 3.

  • The event "exactly 2 defective" corresponds to E = {DDN, DND, NDD}, and for every outcome in E, x = 2.

Example: drawing balls from an urn

  • Two balls drawn without replacement from an urn with 4 red and 3 black. Define Y = number of red balls drawn.

  • Sample space and values:

    • RR → y = 2

    • RB → y = 1

    • BR → y = 1

    • BB → y = 0

Example: correct helmet matches

  • Three helmets returned randomly to three owners (Smith, Jones, Brown). Define M = number of correct matches.

  • The six permutations produce m values of 3, 1, 1, 1, 0, 0.

Finite vs countably infinite sample spaces

  • The examples above have finite sample spaces. But some experiments produce countably infinite ones.

  • Example: throw a die until a 5 appears. S = {F, NF, NNF, NNNF, ...} where F = five occurs, N = five does not occur. The elements can still be counted (first, second, third, ...), so X is still a discrete random variable.

Categorical (dummy) variables

  • Sometimes the random variable is binary: 0 or 1, coding for a category (pass/fail, yes/no). These are called dummy variables.


Core Content: Discrete Probability Distributions (PMF and CDF)

Probability mass function (PMF)

The PMF f(x) of a discrete random variable X must satisfy three conditions:

  1. f(x) ≥ 0 for every possible x. (No negative probabilities.)

  1. The sum of f(x) over all possible values of x equals 1. (All probabilities add up to certainty.)

  1. P(X = x) = f(x). (The function directly gives you the probability of each value.)

If you have a table or formula that meets all three conditions, you have a valid PMF.

Cumulative distribution function (CDF)

The CDF F(x) is defined as:

F(x) = P(X ≤ x) = the sum of f(t) for all t ≤ x.

Key properties of the CDF for a discrete random variable:

  • F(x) is a non-decreasing step function. It jumps at each value where X has positive probability, and is flat between those values.

  • F(x) approaches 0 as x goes to negative infinity, and approaches 1 as x goes to positive infinity.

  • You can recover individual probabilities from the CDF: P(X = x) = F(x) minus F evaluated just below x.

How PMF and CDF relate

  • The CDF is the cumulative (running) sum of the PMF.

  • The PMF gives the probability at each point; the CDF gives the probability up to and including each point.

  • Given one, you can always reconstruct the other.


Formulas and Diagrams

PMF conditions:

f(x) \geq 0 \quad \text{for all } x
\sum_{x} f(x) = 1
P(X = x) = f(x)

CDF definition:

F(x) = P(X \leq x) = \sum_{t \leq x} f(t), \quad -\infty < x < \infty

The CDF for a discrete random variable looks like a staircase: flat stretches at each plateau, with vertical jumps at the values where X has positive probability. The height of each jump equals f(x) at that point.


Real-World Applications

Random variables are how you model anything you measure or count in the real world. The number of defective items in a production run, the number of customers arriving at a shop in an hour, the number of correct answers on a multiple-choice exam: each is a discrete random variable with its own PMF. The CDF is what you use when you need to answer questions like "what is the probability of getting 7 or fewer defects?" rather than "what is the probability of getting exactly 7?"


Common Misconceptions

  • Students often confuse the random variable X with the values x it takes. X is the function (the rule); x is a specific number. On an exam, writing P(x = 3) instead of P(X = 3) can lose marks.

  • Forgetting that a valid PMF must sum to exactly 1. If your probabilities add up to something other than 1, either you have missed a value or made an arithmetic error.

  • Thinking the CDF gives you P(X = x). It does not. The CDF gives P(X ≤ x). To get the probability at a single point from the CDF, you need to take the difference between consecutive CDF values.

  • Assuming every random variable is discrete. Some variables (like temperature or weight) are continuous. The distinction matters because continuous random variables use probability density functions, not mass functions.


Why It Matters / Exam Flags

⚠️ Expect to be given a scenario and asked to define the random variable, list the sample space, and write out the PMF. Practise this workflow until it is automatic.

⚠️ You will need to verify that a proposed function is a valid PMF by checking all three conditions (non-negativity, sums to 1, gives P(X = x)).

⚠️ CDF questions often ask you to compute P(a < X ≤ b) = F(b) - F(a). Know this relationship cold.

⚠️ The distinction between discrete and continuous random variables matters for choosing the right tools (summation vs integration). If you are asked to classify a variable, the answer usually hinges on whether the values are countable.


Quick Self-Test

  1. True or false: A random variable maps outcomes in the sample space to real numbers. (True.)

  1. Fill in the blank: The three conditions for a valid PMF are f(x) ≥ 0, the sum of all f(x) = ______, and P(X = x) = ______. (1; f(x))

  1. True or false: The CDF of a discrete random variable is a smooth curve. (False. It is a step function.)

  1. Fill in the blank: F(x) = P(X ______ x). (≤)

  1. True or false: If X can take values 0, 1, and 2, then f(0) + f(1) + f(2) must equal 1. (True.)


Practice Q&A

Q: Three coins are flipped. Let X be the number of heads. List the sample space and write out the PMF of X.

A: S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}. X can be 0, 1, 2, or 3. f(0) = 1/8, f(1) = 3/8, f(2) = 3/8, f(3) = 1/8. Check: 1/8 + 3/8 + 3/8 + 1/8 = 1.

Q: Using the PMF from the previous question, compute F(2).

A: F(2) = P(X ≤ 2) = f(0) + f(1) + f(2) = 1/8 + 3/8 + 3/8 = 7/8.

Q: A discrete random variable X has PMF f(1) = 0.2, f(2) = 0.3, f(3) = k. Find k.

A: The PMF must sum to 1, so 0.2 + 0.3 + k = 1, giving k = 0.5.

Q: Explain the difference between f(x) and F(x) in one sentence.

A: f(x) gives the probability of X being exactly equal to x, while F(x) gives the probability of X being less than or equal to x.

Q: Two balls are drawn without replacement from an urn containing 4 red and 3 black balls. Let Y = the number of red balls drawn. Write the PMF of Y.

A: The possible values are y = 0, 1, 2. f(0) = P(BB) = (3/7)(2/6) = 1/7. f(1) = P(RB) + P(BR) = (4/7)(3/6) + (3/7)(4/6) = 4/7. f(2) = P(RR) = (4/7)(3/6) = 2/7. Check: 1/7 + 4/7 + 2/7 = 1.


Connections to Other Topics

Random variables are the bridge between the abstract set-based probability of Chapter 2 and everything quantitative that follows. Expected value (mean of a random variable), variance, and standard deviation all require a PMF or its continuous counterpart. The named distributions you will meet next (binomial, Poisson, geometric, normal) are specific PMFs and PDFs with known formulas, and every one of them is built on this chapter's definitions.


Related Terms / Search Tags

random variable, discrete random variable, continuous random variable, probability mass function, PMF, probability distribution, cumulative distribution function, CDF, f(x), F(x), sample space, dummy variable, categorical variable, step function, defective components example, urn problem, STAT 3021, intro to probability and statistics, University of Minnesota