Home / Courses / Probability / Unit 4
Probability Unit 4: Discrete Random Variables
A random variable assigns a number to each outcome of an experiment. This unit covers how discrete random variables are described by PMFs and CDFs and summarized by expected value and variance.
Covers: Random variables and PMFs, Cumulative distribution functions, Expected value, Expectation of a function (LOTUS), Variance and standard deviation, Linear transformations, Indicator variables, Deductibles and policy limits
Study guide
A random variable X is a function that assigns a number to each outcome in the sample space. It is discrete when its possible values can be listed, such as the number of heads in ten flips. Its probability mass function p(x) = P(X = x) must be nonnegative and sum to 1 over all possible values. The cumulative distribution function F(x) = P(X ≤ x) is a nondecreasing step function that jumps by p(x) at each possible value and rises from 0 to 1. You can move between the two: p(x) is the size of the jump in F at x, and P(a < X ≤ b) = F(b) − F(a).
The expected value E[X] = Σ x p(x) is the long-run average of X over many repetitions, the balance point of the PMF. It need not be a possible value: a fair die has mean 3.5. To find the expectation of a function, use the law of the unconscious statistician, E[g(X)] = Σ g(x)p(x). In general E[g(X)] ≠ g(E[X]); for example E[1/X] differs from 1/E[X]. Expectation is linear, so E[aX + b] = aE[X] + b, and the expectation of a sum is the sum of expectations even when the variables are dependent.
Variance measures spread: Var(X) = E[(X − μ)²] = E[X²] − μ², and the standard deviation is its square root, in the same units as X. Shifting X does not change its variance, while scaling multiplies it: Var(aX + b) = a²Var(X). The mean is the constant c that minimizes E[(X − c)²], and that minimum is exactly the variance. A useful identity for nonnegative integer variables is the tail-sum formula E[X] = Σ_{k≥1} P(X ≥ k), which is often the quickest route to a mean.
Indicator variables make hard expectations easy. Write a count as a sum of indicators, Iⱼ = 1 if event j happens, so that E[count] = Σ P(event j). This gives the expected number of people who get their own hat (always 1) and the expected number of distinct faces in six die rolls. Insurance problems are another common application: the payment is a function of the loss, such as max(X − d, 0) with a deductible d or min(·, u) with a limit u. Compute the payment for each possible loss first, then take the expectation.
Key ideas
- A PMF is nonnegative and sums to 1; a CDF is a step function from 0 to 1.
- E[X] is the probability-weighted average and need not be a possible value.
- LOTUS: E[g(X)] = Σ g(x)p(x), and usually E[g(X)] ≠ g(E[X]).
- Expectation is linear even for dependent variables.
- Var(X) = E[X²] − (E[X])², and Var(aX + b) = a²Var(X).
- Indicator variables turn expected counts into sums of probabilities.
- For insurance payments, transform each loss before averaging.
Formulas and rules
Common mistakes
- Computing E[X²] − E[X] instead of E[X²] − (E[X])².
- Assuming E[g(X)] = g(E[X]) for nonlinear g.
- Adding the constant b to the variance or forgetting to square the coefficient a.
- Subtracting a deductible from the mean loss instead of from each loss that exceeds it.
- Reading P(X ≤ x) from a CDF when the question asks for P(X = x).
Before the test, make sure you can
- Verify a PMF and find an unknown constant.
- Convert between a PMF and a CDF.
- Calculate E[X], E[X²], Var(X) and SD(X) from a table.
- Apply LOTUS to compute E[g(X)].
- Use Var(aX + b) = a²Var(X) and E[aX + b] = aE[X] + b.
- Use indicators and linearity to find expected counts.
- Calculate expected insurance payments with deductibles and limits.
Words to know
- Random variable
- A function assigning a real number to each outcome of an experiment.
- Discrete random variable
- A random variable whose possible values can be listed.
- PMF
- p(x) = P(X = x), nonnegative and summing to 1.
- CDF
- F(x) = P(X ≤ x), nondecreasing from 0 to 1.
- Expected value
- E[X] = Σ x p(x), the long-run average of X.
- LOTUS
- E[g(X)] = Σ g(x)p(x), the law of the unconscious statistician.
- Variance
- Var(X) = E[(X − μ)²] = E[X²] − μ².
- Standard deviation
- The square root of the variance, in the units of X.
- Linearity of expectation
- E[aX + bY + c] = aE[X] + bE[Y] + c, with or without independence.
- Indicator variable
- A variable equal to 1 if an event occurs and 0 otherwise; its mean is the event's probability.
- Mode
- The value with the highest probability.
- Median
- A value m with P(X ≤ m) ≥ ½ and P(X ≥ m) ≥ ½.
- Deductible
- An amount subtracted from each loss before the insurer pays.
- Policy limit
- The maximum amount an insurer will pay on a loss.
- Tail-sum formula
- For nonnegative integer X, E[X] = Σ_{k≥1} P(X ≥ k).
- Hypergeometric distribution
- Counts successes in a sample drawn without replacement from a finite population.
Sample practice questions
30 more questions like these, from level 1 to 5, are in the practice set.
Which two conditions must a function p(x) satisfy to be a probability mass function?
- p is increasing and its largest value is 1
- p(x) ≥ 0 for all x and Σ p(x) = 1
- p(x) > 0 for all real x and ∫ p(x) dx = 1
- p(x) ≤ 1 for all x and Σ p(x) = 0
Show the answer and steps
Answer: B) p(x) ≥ 0 for all x and Σ p(x) = 1
- A PMF gives probabilities, so each value is nonnegative.
- The possible values are exhaustive, so the probabilities add to 1.
- Integrals and positivity at every real x describe densities, not PMFs.
For a discrete random variable X with PMF p(x), the expected value E[X] is:
- Σ x p(x)
- Σ x²p(x)
- Σ p(x)/x
- The most likely value of X
Show the answer and steps
Answer: A) Σ x p(x)
- E[X] is the probability-weighted average of the possible values.
- Multiply each value by its probability and add.
- The most likely value is the mode, and Σ x²p(x) is E[X²].
Find the variance of a single roll of a fair six-sided die.
- 35/12
- 49/4
- 7/2
- 91/6
Show the answer and steps
Answer: A) 35/12
- E[X²] = (1 + 4 + 9 + 16 + 25 + 36)/6 = 91/6.
- (E[X])² = (7/2)² = 49/4.
- Var = 91/6 − 49/4 = 182/12 − 147/12 = 35/12 ≈ 2.92.