Unit 4, lesson 27

Cumulative Distribution Functions

How the cumulative distribution function of a discrete random variable adds up probability to each threshold, rises only by jumps equal to the masses, is right-continuous, and gives tail and interval probabilities.

  • Video 27
  • Random Variables and Their Distributions

Many questions about a random variable ask how much probability lies at or below a threshold, such as at most three errors or a score change of no more than one point. A probability mass function answers each of them only after you add the right masses. The cumulative distribution function does that addition once for every threshold on the real line, and its definition includes the threshold itself. This lesson builds it for discrete random variables, reads the masses back from its jumps, and finds tail and interval probabilities with every endpoint accounted for.

Key terms

Cumulative distribution function

Definition The cumulative distribution function, or CDF, of a random variable XX is the function FF defined for every real number tt by

F(t)=P(X≤t).F(t) = P(X \le t).

Every CDF is nondecreasing, is right-continuous, and satisfies F(t)→0F(t) \to 0 as t→−∞t \to -\infty and F(t)→1F(t) \to 1 as t→∞t \to \infty. If XX is discrete with PMF pXp_X and support SS, then F(t)F(t) is the sum of pX(x)p_X(x) over the support values x≤tx \le t. The inequality includes equality, so the mass at tt itself counts.

In plain words The value F(t)F(t) is all the probability at or below the threshold tt. The threshold can be any real number, including numbers the random variable never takes. Raising the threshold can only add outcomes, never remove them, which is why FF cannot decrease.

Example In a constructed model, a score change XX takes the values −2-2, 11 and 44 with probabilities 0.20.2, 0.50.5 and 0.30.3. Moving the threshold from left to right and adding each mass as it is reached gives

F(t)={0,t<−2,0.2,−2≤t<1,0.7,1≤t<4,1,t≥4.F(t) = \begin{cases} 0, & t < -2, \\ 0.2, & -2 \le t < 1, \\ 0.7, & 1 \le t < 4, \\ 1, & t \ge 4. \end{cases}

So F(0)=0.2F(0) = 0.2 even though 00 is not a possible value, and F(1)=0.2+0.5=0.7F(1) = 0.2 + 0.5 = 0.7. This FF reaches 00 and 11 because the support is finite. When the support has no upper bound, F(t)<1F(t) < 1 at every threshold, and FF only approaches 11. For the number TT of independent fair coin tosses up to and including the first head, the CDF FTF_T of TT has FT(n)=1−(12)nF_T(n) = 1 - (\tfrac{1}{2})^{n} at each positive integer nn, which is less than 11 for every nn and tends to 11.

Step function

Definition Let XX be discrete with finite support x1<x2<⋯<xmx_1 < x_2 < \dots < x_m. Its CDF is a step function. It equals 00 for t<x1t < x_1, it equals 11 for t≥xmt \ge x_m, and on each interval xk≤t<xk+1x_k \le t < x_{k+1} with 1≤k<m1 \le k < m it is constant and equal to

∑j=1kpX(xj),\sum_{j=1}^{k} p_X(x_j),

the total mass of the first kk support values. More generally, for any discrete XX and any a<ba < b, the difference F(b)−F(a)F(b) - F(a) is the total mass of the support values in (a,b](a, b], so FF is constant on every interval that contains no support value.

In plain words Between consecutive support values nothing new is added, so the graph stays flat. At each support value it steps up. A flat stretch means that no mass lies between its ends, not that probability is spread evenly along it.

Example For the score change XX the graph is flat at height 0.20.2 from −2-2 up to just below 11. That does not mean XX is spread over the values between −2-2 and 11. The values −1-1 and 00 have probability 00, and indeed F(−1)=F(0)=0.2F(-1) = F(0) = 0.2. A careful graph draws filled dots at the attained heights (−2,0.2)(-2, 0.2), (1,0.7)(1, 0.7) and (4,1)(4, 1), and open dots at the right ends of the lower pieces, at (−2,0)(-2, 0), (1,0.2)(1, 0.2) and (4,0.7)(4, 0.7).

Jump size

Definition For every real number aa, the limit of F(t)F(t) as tt increases to aa exists. It is written F(a−)F(a^-) and equals P(X<a)P(X < a). The jump of FF at aa is

F(a)−F(a−)=P(X=a).F(a) - F(a^-) = P(X = a).

So FF jumps exactly at the values with positive probability, and the size of the jump is the mass at that value. For a discrete random variable this recovers the whole PMF from the CDF.

In plain words The rise at each step is the probability of that one value. The height of the CDF itself is accumulated probability, which also contains every earlier mass.

Example For the score change, the jump at 11 is F(1)−F(1−)=0.7−0.2=0.5F(1) - F(1^-) = 0.7 - 0.2 = 0.5, which is P(X=1)P(X = 1). The jump at −2-2 is 0.2−0=0.20.2 - 0 = 0.2, and the jump at 44 is 1−0.7=0.31 - 0.7 = 0.3. At 00 there is no jump, since F(0)−F(0−)=0.2−0.2=0F(0) - F(0^-) = 0.2 - 0.2 = 0, so P(X=0)=0P(X = 0) = 0. Reading the height F(1)=0.7F(1) = 0.7 as P(X=1)P(X = 1) is a common error, because that height also includes the mass 0.20.2 at −2-2.

Right-continuity

Definition A CDF is right-continuous at every real number aa,

lim⁡t→a+F(t)=F(a).\lim_{t \to a^+} F(t) = F(a).

As tt decreases to aa, the events {X≤t}\{X \le t\} shrink to {X≤a}\{X \le a\}, and probability is continuous along a decreasing sequence of events. The limit from the left, F(a−)=P(X<a)F(a^-) = P(X < a), differs from F(a)F(a) exactly when P(X=a)>0P(X = a) > 0. So right-continuity allows jumps, and at a jump the CDF takes the upper value.

In plain words At a jump the CDF already includes the mass at that point, because the definition uses less than or equal to. On a graph this is the filled dot at the top of the step.

Example For the score change, F(t)=0.7F(t) = 0.7 for 1≤t<41 \le t < 4, so the limit from the right at 11 is 0.7=F(1)0.7 = F(1). From the left, F(t)=0.2F(t) = 0.2 for −2≤t<1-2 \le t < 1, so F(1−)=0.2F(1^-) = 0.2. Setting F(1)=0.2F(1) = 0.2 would leave out P(X=1)P(X = 1), which P(X≤1)P(X \le 1) includes, and the resulting function would not be right-continuous at 11.

Tail probability

Definition The upper tail probabilities of XX at a threshold tt are

P(X>t)=1−F(t),P(X≥t)=1−F(t−).\begin{gathered} P(X > t) = 1 - F(t), \\[0.4em] P(X \ge t) = 1 - F(t^-). \end{gathered}

Both follow from the complement rule, since {X>t}\{X > t\} is the complement of {X≤t}\{X \le t\} and {X≥t}\{X \ge t\} is the complement of {X<t}\{X < t\}. The two tails differ by P(X=t)P(X = t). The lower tails are P(X≤t)=F(t)P(X \le t) = F(t) and P(X<t)=F(t−)P(X < t) = F(t^-).

In plain words Whether the threshold value is included decides whether you subtract the CDF at tt or the level just below tt.

Example For the score change, P(X>1)=1−F(1)=1−0.7=0.3P(X > 1) = 1 - F(1) = 1 - 0.7 = 0.3, which matches the table, since 44 is the only value above 11. Changing one word gives P(X≥1)=1−F(1−)=1−0.2=0.8P(X \ge 1) = 1 - F(1^-) = 1 - 0.2 = 0.8, which is 0.5+0.30.5 + 0.3. Using 1−F(1)1 - F(1) for P(X≥1)P(X \ge 1) would remove the mass at 11 as well and give the wrong answer 0.30.3.

Interval probability

Definition For real numbers a<ba < b,

P(a<X≤b)=F(b)−F(a),\begin{aligned} &P(a < X \le b) \\[0.4em] &\quad = F(b) - F(a), \end{aligned}

because the event {X≤b}\{X \le b\} is the disjoint union of {X≤a}\{X \le a\} and {a<X≤b}\{a < X \le b\}. The other endpoint choices use limits from the left.

EventProbability
a<X≤ba < X \le bF(b)−F(a)F(b) - F(a)
a≤X≤ba \le X \le bF(b)−F(a−)F(b) - F(a^-)
a<X<ba < X < bF(b−)−F(a)F(b^-) - F(a)
a≤X<ba \le X < bF(b−)−F(a−)F(b^-) - F(a^-)

In plain words Take all the probability up to the right end and remove all the probability up to the left end. Whether an endpoint is in or out decides whether to use the CDF at that point or the level just below it.

Example For the score change, P(−1<X≤3)=F(3)−F(−1)=0.7−0.2=0.5P(-1 < X \le 3) = F(3) - F(-1) = 0.7 - 0.2 = 0.5. The only support value in (−1,3](-1, 3] is 11, so the answer checks, and neither endpoint needed to be a possible value. With both endpoints at support values,

P(−2≤X<4)=F(4−)−F((−2)−)=0.7−0=0.7,\begin{aligned} &P(-2 \le X < 4) \\[0.4em] &\quad = F(4^-) - F\big((-2)^-\big) \\[0.4em] &\quad = 0.7 - 0 = 0.7, \end{aligned}

which matches 0.2+0.50.2 + 0.5 from the included values −2-2 and 11, with 44 left out. Interval probabilities come from heights of the CDF and their differences, not from areas under its graph.

Check yourself

  1. A random variable YY takes the values −1-1, 00 and 22 with probabilities 14\tfrac{1}{4}, 12\tfrac{1}{2} and 14\tfrac{1}{4}. Write its CDF FYF_Y for every real tt, and find FY(−0.5)F_Y(-0.5) and FY(1)F_Y(1).
Show the answer

Adding the masses as the threshold passes each support value gives

FY(t)={0,t<−1,14,−1≤t<0,34,0≤t<2,1,t≥2.F_Y(t) = \begin{cases} 0, & t < -1, \\ \tfrac{1}{4}, & -1 \le t < 0, \\ \tfrac{3}{4}, & 0 \le t < 2, \\ 1, & t \ge 2. \end{cases}

So FY(−0.5)=14F_Y(-0.5) = \tfrac{1}{4}, since only the support value −1-1 lies at or below −0.5-0.5, and FY(1)=34F_Y(1) = \tfrac{3}{4}, since the support values −1-1 and 00 lie at or below 11.

  1. For the same YY, use the CDF to find P(Y≥0)P(Y \ge 0) and P(0<Y≤2)P(0 < Y \le 2). Why do the two answers differ by 12\tfrac{1}{2}?
Show the answer

The event Y≥0Y \ge 0 includes 00, so

P(Y≥0)=1−FY(0−)=1−14=34,\begin{aligned} P(Y \ge 0) &= 1 - F_Y(0^-) \\[0.4em] &= 1 - \tfrac{1}{4} = \tfrac{3}{4}, \end{aligned}

which matches the masses at 00 and 22. The event 0<Y≤20 < Y \le 2 excludes 00, so P(0<Y≤2)=FY(2)−FY(0)=1−34=14P(0 < Y \le 2) = F_Y(2) - F_Y(0) = 1 - \tfrac{3}{4} = \tfrac{1}{4}, the mass at 22 alone. The first event is the second one together with the value 00 and the values above 22, and P(Y>2)=0P(Y > 2) = 0. So the difference is P(Y=0)=12P(Y = 0) = \tfrac{1}{2}, the jump FY(0)−FY(0−)F_Y(0) - F_Y(0^-).

  1. Consider the function
G(t)={0,t<0,12,0≤t≤1,1,t>1.G(t) = \begin{cases} 0, & t < 0, \\ \tfrac{1}{2}, & 0 \le t \le 1, \\ 1, & t > 1. \end{cases}

It is nondecreasing, tends to 00 on the left and reaches 11 on the right. Is it a CDF? If not, change only the endpoint conventions to make it one, and describe the distribution you get.

Show the answer

It is not a CDF, because it is not right-continuous at 11. The value is G(1)=12G(1) = \tfrac{1}{2}, but G(t)=1G(t) = 1 for every t>1t > 1, so the limit from the right at 11 is 11. A CDF with these values would need P(X≤1)=12P(X \le 1) = \tfrac{1}{2} while P(X≤t)=1P(X \le t) = 1 for all t>1t > 1, which contradicts the continuity of probability along the shrinking events {X≤t}\{X \le t\}.

Moving the endpoint so that the middle piece is 0≤t<10 \le t < 1 and the last piece is t≥1t \ge 1 gives a right-continuous step function. It is the CDF of a random variable that equals 00 or 11, each with probability 12\tfrac{1}{2}, since its jumps at 00 and 11 both have size 12\tfrac{1}{2}.

How this lesson connects