Cumulative probability
A distribution table gives the chance of each single value. How do you get the chance that the variable lands anywhere in a range, without adding a fresh string of entries every time?
Where you are 11 in Random variables
When you reach for it
A probability distribution table lists each value of a discrete random variable with its probability, and a question about a range of values, such as “at most 4” or “between 2 and 5”, is answered by adding the probabilities of the values in that range. That always works, but each new range means a new string of additions.
The cumulative distribution does the adding once. Its entry at x is the probability that the variable is at most x. With that table in hand, the probability of any interval is one subtraction of two entries, and “at least” questions are one subtraction from 1.
Reach for it when a question asks about a range of values, when you are handed a cumulative table (software often gives one), and when you want a middle value of the variable: the cumulative table shows where the probability passes one half.
The examples use one made-up setting. Shota looks after the jukebox in a diner. Let X be the number of songs a customer plays on one visit, counting only customers who use the jukebox, so X is at least 1:
| x | P(X = x) |
|---|---|
| 1 | 0.10 |
| 2 | 0.20 |
| 3 | 0.25 |
| 4 | 0.20 |
| 5 | 0.15 |
| 6 | 0.10 |
The procedure
Running totals
The cumulative distribution function of X is
the probability that X comes out at most x. For a discrete variable, F at a possible value is the sum of the probabilities of that value and every smaller one, so a cumulative table is a column of running totals: each entry is the previous entry plus the probability of the new value. That adding is allowed because the events X = 1, X = 2 and so on are disjoint, and the probability of a union of disjoint events is the sum of their probabilities.
Three facts follow from the definition.
- F never decreases, because each step adds a probability, and a probability is never negative.
- F is 0 to the left of the smallest value and 1 from the largest value on, because no outcome lies below the smallest value and every outcome lies at or below the largest.
- Between two possible values F is flat. No value of X lies strictly between 3 and 4, so P(X \le 3.5) = P(X \le 3).
So the graph of F is a staircase. It jumps at each possible value, and the height of the jump at x is P(X = x). Reading that the other way, the ordinary table can always be recovered from the cumulative one: P(X = x) is F(x) minus the entry for the value just below x.
A filled dot sits at the left end of each step and an open circle at the right end. At x = 3 the graph’s height is the upper one, 0.55, because F(3) = P(X \le 3) already counts the customers who play exactly 3 songs.
An interval is a difference
Take two numbers a < b. Every outcome with X \le b either has X \le a or has a < X \le b, and not both. So the event X \le b splits into two disjoint pieces, and by the addition rule
Subtracting F(a) from both sides gives the rule this lesson is about:
Notice the shape of the interval it produces: the left end is excluded and the right end is included. On the staircase it is the climb from height F(a) to height F(b), which is the sum of the jumps at the values above a and up to b.
Strict or not: the endpoints
For a discrete variable a single value carries real probability, so including or leaving out an endpoint changes the answer by exactly the probability of that endpoint. Every interval question is therefore first rewritten into the form “greater than one value, at most another”. When the possible values are integers, “at least a” is the same event as “greater than a - 1”, and “less than b” is the same event as “at most b - 1”. That gives
At least: the complement
“At least a” is the complement of “at most a - 1” (for integer values), and the probabilities of an event and its complement add to 1. So
Reading the table backward
Sometimes the question runs the other way: given a probability, which value of X? The cumulative table answers it by searching down the column for the first entry that reaches the target. The smallest x with F(x) \ge 0.5 is a median of the variable, a value m with
Why both hold: F(m) \ge 0.5 by the choice of m. And the entry just before m is below 0.5, since m was the first to reach it, and P(X \ge m) is 1 minus that entry, so above 0.5. The same search with 0.9 in place of 0.5 finds the smallest value that at least 90\% of outcomes stay at or below.
Worked examples
Building the cumulative table
Make the cumulative table for the number of songs X on Shota’s jukebox, and say what F(3) means. Find F(3.5), F(0) and F(10).
SolutionEach entry is the previous entry plus the probability of the new value:
| x | P(X = x) | F(x) = P(X \le x) |
|---|---|---|
| 1 | 0.10 | 0.10 |
| 2 | 0.20 | 0.30 |
| 3 | 0.25 | 0.55 |
| 4 | 0.20 | 0.75 |
| 5 | 0.15 | 0.90 |
| 6 | 0.10 | 1.00 |
The last entry is 1.00, as it must be. F(3) = 0.55 says that 55\% of customers who use the jukebox play 3 songs or fewer.
No customer plays between 3 and 3.5 songs, so F(3.5) = F(3) = 0.55. No customer plays 0 or fewer, so F(0) = 0. Every customer plays at most 10, so F(10) = 1.
Including or excluding an endpoint
Tamuna wants P(2 < X \le 5) and P(2 \le X \le 5). Find both from the cumulative table.
SolutionThe first is already in the form “greater than one value, at most another”, so it is one difference:
As a check, the event is X = 3, 4 or 5, and adding those entries of the original table gives 0.25 + 0.20 + 0.15 = 0.60.
For the second, X \ge 2 is the same as X > 1, because there is no possible value between 1 and 2. So
The two answers differ by 0.20, which is P(X = 2): the second event contains the customers who play exactly 2 songs and the first does not.
Three wordings
Find the probability that a customer plays (a) at most 4 songs, (b) fewer than 4 songs, (c) more than 2 but fewer than 5 songs.
Solution(a) “At most 4” is X \le 4, which is the definition of F(4): P(X \le 4) = F(4) = 0.75.
(b) “Fewer than 4” leaves out 4. For whole numbers, X < 4 is X \le 3, so P(X < 4) = F(3) = 0.55. The difference from (a) is 0.20 = P(X = 4).
(c) “More than 2 but fewer than 5” excludes both ends. Rewriting the right end, X < 5 is X \le 4, so the event is 2 < X \le 4 and
Check: the event is X = 3 or 4, and 0.25 + 0.20 = 0.45.
Money, and “at least”
Each song costs 0.75 dollars. Lusine asks for the probability that a customer spends (a) at least 3.00 dollars, (b) more than 2.00 dollars, (c) from 1.50 to 3.00 dollars, inclusive.
SolutionA customer who plays X songs spends 0.75X dollars, so each money question is a question about X.
(a) 0.75X \ge 3 means X \ge 4. “At least 4” is the complement of “at most 3”:
(b) 0.75X > 2 means X > 2.\overline{6}. Since X is a whole number, that is X \ge 3, the complement of X \le 2:
(c) 1.50 \le 0.75X \le 3.00 means 2 \le X \le 4. The left end is included, so step back to 1:
Check: 0.20 + 0.25 + 0.20 = 0.65. So 65\% of jukebox customers spend between 1.50 and 3.00 dollars.
A median, read backward
Find a median of X, and the smallest number of songs that at least 90\% of customers stay at or below.
SolutionGo down the cumulative column for the first entry that reaches 0.5: F(2) = 0.30 falls short and F(3) = 0.55 reaches it. So the median is 3 songs. Both halves of the definition hold: P(X \le 3) = 0.55 \ge 0.5, and
For 90\%, F(4) = 0.75 falls short and F(5) = 0.90 reaches it exactly. So 5 songs is the smallest number that at least 90\% of customers do not exceed; at 4 songs only 75\% are at or below.
Starting from a cumulative table
Shota also records Y, the number of songs already waiting in the jukebox’s queue when a customer walks up. He gives only the cumulative table (made-up data):
| y | F(y) = P(Y \le y) |
|---|---|
| 0 | 0.30 |
| 1 | 0.55 |
| 2 | 0.75 |
| 3 | 0.88 |
| 4 | 0.96 |
| 5 | 1.00 |
Find the full distribution of Y, the probability of 1 to 3 songs waiting, the probability of at least 2 waiting, and a median of Y.
SolutionEach probability is the jump in F at that value. P(Y = 0) = 0.30, since nothing lies below 0, and then
These six add to 1, as they must. For 1 \le Y \le 3 the left end is included, so step back to 0:
At least 2 is the complement of at most 1: P(Y \ge 2) = 1 - F(1) = 1 - 0.55 = 0.45.
For the median, F(0) = 0.30 falls short and F(1) = 0.55 reaches 0.5, so the median is 1 song waiting.
Boundaries
- The “minus one” step needs integer values. Rewriting X \ge a as X > a - 1 works because nothing lies between a - 1 and a. If the values are 0, 0.5, 1, \ldots, step back to the previous possible value instead, here a - 0.5.
- The cumulative table must be valid. Its entries never decrease, stay between 0 and 1, and end at 1. A table that drops anywhere would give a negative probability for some value.
- For a continuous variable the endpoints stop mattering. A single value has probability 0 under a density curve, so < and \le give the same answer there. The care with endpoints in this lesson is a feature of discrete variables.
- A median need not be unique. If some entry equals 0.5 exactly, say F(m) = 0.5, then the next value is also a median. The smallest value with F(x) \ge 0.5 is one standard choice.
Where this goes next
The next step in the unit, expected value, summarizes the whole distribution by a weighted mean instead of reading probabilities off it. For the binomial distribution the running totals are what software reports, and “at least 3 successes” is computed as 1 - P(X \le 2), exactly the complement used here.
On a density curve the staircase becomes a smooth rising curve, the area to the left of x, and the probability of an interval is still the difference of two left areas. That is how a probability between two values of a normal random variable is found. The same running-total idea for observed data, rather than probabilities, gives the Cumulative frequency graphs and percentiles.
Exercises
In Shota’s diner, a second jukebox plays in the evening. Let Z be the number of songs a customer plays on it (made-up data):
| z | P(Z = z) |
|---|---|
| 1 | 0.15 |
| 2 | 0.30 |
| 3 | 0.25 |
| 4 | 0.20 |
| 5 | 0.10 |
Let T be the number of times the jukebox jams in a day (made-up data), given as a cumulative table:
| t | P(T \le t) |
|---|---|
| 0 | 0.05 |
| 1 | 0.25 |
| 2 | 0.60 |
| 3 | 0.85 |
| 4 | 1.00 |
Building and reading cumulative tables
- Make the cumulative table F(z) = P(Z \le z) for z = 1 to 5.
- For Z, find F(2.5), F(0) and F(7).
- Recover the distribution of T: find P(T = t) for t = 0 to 4.
- Shota is handed a table for a variable V with values 1 to 5 whose entries are 0.20, 0.45, 0.40, 0.80, 1.00, labeled as a cumulative table. Can it be one? Find what it would make P(V = 3).
Intervals as differences
- Find P(Z \le 3).
- Find P(Z < 3).
- Find P(1 < Z \le 3).
- Find P(2 \le Z \le 5).
- Find P(2 < Z < 5).
- Find the probability that the jukebox jams from 1 to 3 times in a day, inclusive.
At least, more than, and money
- Find the probability that an evening customer plays at least 3 songs.
- Find P(Z > 3).
- Evening songs cost 0.50 dollars each. Find the probability that a customer spends from 1.00 to 2.00 dollars, inclusive.
- Find the probability that the jukebox jams at least twice in a day, and the probability that it jams at least once.
Reading backward
- Find a median of Z.
- Find a median of T, and the smallest t with P(T \le t) \ge 0.80.
- Let W be the number of songs a customer skips, with values 0 to 3 and cumulative entries 0.20, 0.50, 0.85, 1.00. Find the smallest w with F(w) \ge 0.5, and show that the next value is also a median.
- Find the smallest value k with P(Z \le k) \ge 0.90, and find P(Z > k) for that k.
Reasoning
- Explain, using disjoint events, why P(a < X \le b) = F(b) - F(a) for any numbers a < b, and why the difference never comes out negative.
- For Shota’s jukebox, P(X < 3) and P(X \le 3) differ. Explain why, and explain why the same two probabilities would be equal for a continuous variable.
- Explain why the graph of a discrete variable’s cumulative distribution is flat between possible values and why it ends at height 1.
- Tamuna knows only F(3) = 0.60 and F(5) = 0.90 for a variable with whole-number values. Can she find P(3 \le X \le 5)? Explain what she can find, and what further entry she needs.
Answers
- 0.15, 0.45, 0.70, 0.90, 1.00. Running totals: 0.15 + 0.30 = 0.45, 0.45 + 0.25 = 0.70, 0.70 + 0.20 = 0.90, 0.90 + 0.10 = 1.00.
- F(2.5) = F(2) = 0.45, since no value lies between 2 and 2.5. F(0) = 0, since every customer plays at least 1 song. F(7) = 1, since every customer plays at most 5.
- P(T = 0) = 0.05, then the jumps: 0.25 - 0.05 = 0.20, 0.60 - 0.25 = 0.35, 0.85 - 0.60 = 0.25, 1.00 - 0.85 = 0.15. They add to 1.
- No. The entries drop from 0.45 to 0.40, which would make P(V = 3) = 0.40 - 0.45 = -0.05, and no probability is negative.
- P(Z \le 3) = F(3) = 0.70.
- Z < 3 is Z \le 2, so P(Z < 3) = F(2) = 0.45.
- F(3) - F(1) = 0.70 - 0.15 = 0.55. Check: 0.30 + 0.25 = 0.55.
- Z \ge 2 is Z > 1, so F(5) - F(1) = 1.00 - 0.15 = 0.85.
- Z < 5 is Z \le 4, so F(4) - F(2) = 0.90 - 0.45 = 0.45. Check: 0.25 + 0.20 = 0.45.
- P(1 \le T \le 3) = F(3) - F(0), which is 0.85 - 0.05 = 0.80.
- P(Z \ge 3) = 1 - F(2) = 1 - 0.45 = 0.55.
- P(Z > 3) = 1 - F(3) = 1 - 0.70 = 0.30.
- 1.00 \le 0.50Z \le 2.00 means 2 \le Z \le 4, so the answer is F(4) - F(1), which is 0.90 - 0.15 = 0.75.
- P(T \ge 2) = 1 - F(1), which is 1 - 0.25 = 0.75. P(T \ge 1) = 1 - F(0), which is 1 - 0.05 = 0.95.
- 3 songs. F(2) = 0.45 falls short of 0.5 and F(3) = 0.70 reaches it. Check: P(Z \ge 3) = 0.55 \ge 0.5.
- Median 2: F(1) = 0.25 falls short and F(2) = 0.60 reaches 0.5. For 0.80: F(2) = 0.60 falls short and F(3) = 0.85 reaches it, so t = 3.
- w = 1, since F(0) = 0.20 and F(1) = 0.50. For w = 1: P(W \le 1) = 0.50 and P(W \ge 1) = 1 - 0.20 = 0.80. For w = 2: P(W \le 2) = 0.85 and P(W \ge 2) = 1 - F(1) = 0.50. Both halves of the definition hold for each, so 1 and 2 are both medians.
- k = 4: F(3) = 0.70 falls short and F(4) = 0.90 reaches 0.90. Then P(Z > 4) = 1 - 0.90 = 0.10.
- Every outcome with X \le b has either X \le a or a < X \le b, never both, so F(b) = F(a) + P(a < X \le b) by the addition rule for disjoint events; subtract F(a). The difference is itself a probability, so it is at least 0; equivalently, F never decreases.
- P(X \le 3) - P(X < 3) = P(X = 3) = 0.25, which is not 0: a discrete variable puts probability on single values. For a continuous variable every single value has probability 0, so leaving out an endpoint changes nothing.
- Between two neighboring possible values there are no outcomes, so moving x there adds no probability and F stays level. From the largest value on, X \le x holds for every outcome, and the probabilities of all outcomes add to 1.
- No. F(5) - F(3) = 0.30 is P(3 < X \le 5), the values 4 and 5 only. Including 3 needs F(2), because P(3 \le X \le 5) = F(5) - F(2).