← Back to Blog
Exam Guides2026-09-056 min read

Discrete Random Variables: PMF, CDF, and Expected Value

Understand discrete random variables, probability mass functions, and expected values for Exam P.

Probability Mass Function and CDF

A discrete random variable X takes countable values. Its probability mass function (PMF) is p(x) = P(X = x), and must satisfy p(x) >= 0 for all x and the sum of all p(x) = 1. The cumulative distribution function (CDF) is F(x) = P(X <= x) = sum of p(t) for all t <= x.

On Exam P, you may be given a PMF in table form or as a formula and asked to compute probabilities. For instance, if X has PMF p(x) = c * x for x = 1, 2, 3, 4, find c. The sum must equal 1: c(1 + 2 + 3 + 4) = 10c = 1, so c = 0.1.

The CDF of a discrete random variable is a step function that jumps at each value in the support. Between jumps, F(x) is constant. The size of the jump at x equals p(x). This means P(X = x) = F(x) - F(x-), where F(x-) is the left-hand limit. Understanding this relationship helps you convert between PMF and CDF representations, which Exam P frequently requires.

For computing probabilities over intervals, use P(a < X <= b) = F(b) - F(a) and P(a <= X <= b) = F(b) - F(a-). Be precise about whether endpoints are included; with discrete variables, this matters. For example, P(2 <= X <= 4) = F(4) - F(1), not F(4) - F(2).

Expected Value and Variance

The expected value E[X] = sum of x * p(x) measures the center of the distribution. The variance Var(X) = E[X^2] - (E[X])^2 measures spread. The standard deviation is the square root of variance. A useful shortcut for Exam P: Var(aX + b) = a^2 * Var(X).

Continuing the example, E[X] = 0.1(1 + 4 + 9 + 16) = 0.1(30) = 3.0. E[X^2] = 0.1(1 + 8 + 27 + 64) = 10, so Var(X) = 10 - 9 = 1.

Note the correction above: E[X] = sum of x * p(x) = 0.1 * 1 + 0.2 * 2 + 0.3 * 3 + 0.4 * 4 = 0.1 + 0.4 + 0.9 + 1.6 = 3.0. And E[X^2] = 0.1 * 1 + 0.2 * 4 + 0.3 * 9 + 0.4 * 16 = 0.1 + 0.8 + 2.7 + 6.4 = 10.0. So Var(X) = 10 - 9 = 1.0.

Several properties of expectation are essential for Exam P. Linearity of expectation states E[aX + bY] = aE[X] + bE[Y], regardless of whether X and Y are independent. This is one of the most powerful tools in probability. For variance, however, Var(X + Y) = Var(X) + Var(Y) only when X and Y are uncorrelated (which includes the case of independence). When they are correlated, you must add 2 * Cov(X, Y).

Common Exam P Patterns

Exam P frequently tests whether you can set up expectations correctly. A key identity is E[g(X)] = sum of g(x) * p(x). This is called the Law of the Unconscious Statistician (LOTUS). For example, if you need E[X(X-1)], compute it directly from the PMF rather than finding the distribution of X(X-1) first. Also remember E[X(X-1)] = E[X^2] - E[X], which connects to factorial moments.

The factorial moment E[X(X-1)] is particularly useful because for many named distributions (Binomial, Poisson), it has a simple closed form. For a Binomial(n, p), E[X(X-1)] = n(n-1)p^2. For a Poisson(lambda), E[X(X-1)] = lambda^2. From these, you can quickly derive E[X^2] = E[X(X-1)] + E[X] and then the variance.

Higher Moments and Moment Generating Functions

The k-th moment of X is E[X^k]. The k-th central moment is E[(X - mu)^k] where mu = E[X]. The third central moment divided by sigma^3 gives the skewness, which measures asymmetry. Positive skewness means the right tail is heavier; negative skewness means the left tail is heavier. While Exam P rarely asks you to compute skewness directly, understanding it helps you reason about distributions.

The moment generating function (MGF) M(t) = E[e^(tX)] encodes all moments: the k-th derivative of M(t) evaluated at t = 0 equals E[X^k]. For discrete random variables, M(t) = sum of e^(tx) * p(x). If the MGF exists in a neighborhood of zero, it uniquely determines the distribution. This uniqueness property is tested on Exam P when you are asked to identify a distribution from its MGF.

Indicator Random Variables

An indicator variable I_A takes value 1 if event A occurs and 0 otherwise. Its PMF is p(1) = P(A) and p(0) = 1 - P(A). Notice that E[I_A] = P(A) and Var(I_A) = P(A)(1 - P(A)). Indicator variables are extremely useful for computing expectations of counts.

For example, suppose you want E[number of defective items in a sample of n]. Let I_i = 1 if item i is defective. Then the count of defectives is I_1 + I_2 + ... + I_n, and by linearity, E[count] = sum of P(item i is defective). This works even when the indicators are not independent, which is the case when sampling without replacement.

Common Pitfalls

A frequent error on Exam P is applying the variance formula incorrectly. Remember that Var(X) = E[X^2] - (E[X])^2 requires you to square the entire expectation, not just the variable. Students sometimes compute E[X^2] - E[X]^2 and forget that E[X]^2 means (E[X])^2.

Another mistake is confusing E[X^2] with (E[X])^2. These are equal only when Var(X) = 0, meaning X is a constant. In all other cases, E[X^2] > (E[X])^2 by the variance formula, since variance is always non-negative.

Finally, be careful with LOTUS. When computing E[g(X)], do not find the distribution of g(X) first. Apply the formula directly: E[g(X)] = sum of g(x) * p(x). This is almost always faster and less error-prone.

Study Tips

For Exam P, create a reference sheet of the PMF, mean, variance, and MGF for each named discrete distribution (Bernoulli, Binomial, Geometric, Negative Binomial, Poisson, Hypergeometric, Discrete Uniform). Know how to derive the mean and variance from the MGF using M\'(0) and M\'\' (0) - (M\'(0))^2. Practice computing expectations and variances for custom PMFs given in table form, as these appear on nearly every exam. Aim to complete PMF and expectation problems in under three minutes each.

Ready to practice?

Put this knowledge to work with flashcards and practice exams.

Start Studying Free