From Possible Values to a CDF
When a random variable can take only finitely many values, its cumulative distribution function can be built directly from a short list. The main work is to identify the distinct numerical values the variable can take, determine the probability of each value, put those values in increasing order, and accumulate the probabilities.
The order and the word “distinct” matter. Several outcomes in the underlying experiment may produce the same value of \(X\). Their probabilities must first be combined. Then the CDF at a threshold \(x\) includes the probability of every value of \(X\) that is less than or equal to \(x\).
Here \(q_j\) is the probability of a value of \(X\), not necessarily the probability of a single elementary outcome. To find \(q_j\), collect every outcome \(\omega\) for which \(X(\omega)=x_j\) and add the probabilities of those outcomes. In a finite probability model, this is a finite addition.
A Reliable Construction
Use the following procedure whenever the underlying outcome space is finite. If the experiment’s outcomes have probabilities \(P(\{\omega\})\), group them according to the value \(X(\omega)\). Sort the resulting distinct values as \(x_1<\cdots<x_k\), and set \(q_j=P(X=x_j)\). The accumulated totals are \(Q_j=q_1+\cdots+q_j\).
Write down what value \(X\) assigns to each possible outcome. Combine outcomes that give the same value.
Arrange the distinct values from smallest to largest, and write the probability of each value beside it.
Add the probability at each value to the total from all smaller values. The resulting total is the CDF on the interval up to the next value.
Include a value exactly equal to the threshold, as well as every smaller value. Do not include larger values.
For an ordered list \(x_1<\cdots<x_k\), the piecewise form is
This expression is simply a compact way to record which listed values are at or below \(x\). Between two consecutive possible values, changing the threshold does not add any new probability. At a listed value, its probability is included.
Proof. The event \(\{X=x_j\}\) consists precisely of the outcomes \(\omega_i\) whose assigned value is \(x_j\). These single-outcome events are disjoint, so finite additivity gives \(P(X=x_j)=\sum_{\{i:X(\omega_i)=x_j\}}p_i\). Likewise, \(\{X\leq x\}\) consists precisely of the outcomes whose assigned values are at most \(x\). The single-outcome events in this set are disjoint, so its probability is the sum of their probabilities: \(F(x)=P(X\leq x)=\sum_{\{i:X(\omega_i)\leq x\}}p_i\). Grouping the terms in this sum by their common value \(x_j\) gives the accumulated-probability formula. \(\square\)
Worked Example: A Function of One Fair Die
A fair six-sided die has outcomes \(1,2,3,4,5,6\), each with probability \(1/6\). Define \(X\) to be 0 on die outcomes 1 or 2, 1 on outcomes 3, 4, or 5, and 3 on outcome 6. Construct \(F\), then find \(F(1)\) and \(F(2)\).
First group the outcomes by the value assigned to \(X\). The distinct values are \(0,1,3\), and their probabilities are \(P(X=0)=2/6=1/3\), \(P(X=1)=3/6=1/2\), and \(P(X=3)=1/6\). The probabilities sum to \(1/3+1/2+1/6=2/6+3/6+1/6=1\), as required.
In increasing order, the cumulative totals are \(1/3\) at value 0, \(1/3+1/2=5/6\) at value 1, and \(5/6+1/6=1\) at value 3. Therefore
Since \(1\leq 1<3\), \(F(1)=5/6\). The probability at \(X=1\) is included. Also \(1\leq 2<3\), so \(F(2)=5/6\). The threshold 2 is not itself a possible value, but it includes the same possible values, 0 and 1, as threshold 1.
Worked Example: Combining Outcomes With Unequal Probabilities
A finite experiment has four outcomes \(a,b,c,d\), with probabilities \(0.10, 0.20, 0.30, 0.40\), respectively. A random variable assigns \(X(a)=2\), \(X(b)=0\), \(X(c)=2\), and \(X(d)=5\). Construct its CDF and evaluate \(F(1)\), \(F(2)\), and \(F(4)\).
The distinct values are \(0,2,5\). The value 2 comes from two outcomes, so its probability is \(P(X=2)=P(\{a\})+P(\{c\})=0.10+0.30=0.40\). The full grouped list is \(P(X=0)=0.20\), \(P(X=2)=0.40\), and \(P(X=5)=0.40\). These probabilities total \(0.20+0.40+0.40=1.00\).
The cumulative totals in order are \(0.20\), \(0.20+0.40=0.60\), and \(0.60+0.40=1.00\). Thus
At \(x=1\), only the value 0 is at or below the threshold, so \(F(1)=0.20\). At \(x=2\), both 0 and 2 are included, so \(F(2)=0.20+0.40=0.60\). At \(x=4\), the included values are still 0 and 2, so \(F(4)=0.60\). In particular, the probability \(0.40\) attached to the value 5 is not included at threshold 4.
Why the Cumulative Total Is the Right One
The event defining the CDF at \(x\) is \(\{X\leq x\}\), not just \(\{X=x\}\). When the possible values are ordered, this event is the union of all value-events at or below \(x\). Those events are disjoint: \(X\) cannot equal two different values at once. Consequently, their probabilities add. This explains both why the accumulation works and why the order of the values determines the piecewise intervals.
For \(x<x_1\), no possible value is at or below \(x\), so the sum is empty and \(F(x)=0\). For \(x\geq x_k\), every possible value is at or below \(x\), so the sum is \(q_1+\cdots+q_k=1\). These cases complete the finite piecewise description.
Worked Example: Number of Heads in Two Fair Coin Tosses
Toss a fair coin twice, with the four equally likely ordered outcomes \(HH, HT, TH, TT\). Let \(X\) be the number of heads. Construct the CDF and find \(F(0.5)\), \(F(1)\), and \(F(1.5)\).
The outcomes \(TT\), \(HT\) and \(TH\), and \(HH\) give \(X=0\), \(X=1\), and \(X=2\), respectively. Therefore \(P(X=0)=1/4\), \(P(X=1)=2/4=1/2\), and \(P(X=2)=1/4\). The total is \(1/4+1/2+1/4=1\).
In increasing order, the cumulative totals are \(1/4\), \(1/4+1/2=3/4\), and \(3/4+1/4=1\). Hence
Because \(0\leq 0.5<1\), \(F(0.5)=1/4\). At the threshold \(1\), the event is \(X\leq 1\), which includes both zero and one head, so \(F(1)=1/4+1/2=3/4\). Since \(1\leq 1.5<2\), \(F(1.5)=3/4\). These evaluations show why the threshold must be compared with the possible values, rather than treated as though it must itself be a possible value.
Common Mistake: Forgetting to Group or Include Equality
A frequent error is to put one row in the CDF table for every elementary outcome, even when several outcomes give the same value of \(X\). For example, in the two-toss example, counting the outcome \(HT\) but not \(TH\) as the value 1 would incorrectly assign probability \(1/4\), rather than \(1/2\), to \(X=1\). The correction is to collect all outcomes with that value and add their probabilities before forming cumulative totals.
Another error is to evaluate \(F(1)\) as \(P(X<1)\). That is the wrong event: by definition, \(F(1)=P(X\leq 1)\). In the two-toss example, \(P(X<1)=1/4\), while \(F(1)=P(X=0)+P(X=1)=1/4+1/2=3/4\). At a threshold equal to a listed value, include that value’s probability.
A practical check is to verify that the grouped probabilities sum to 1 and that each cumulative total adds exactly the next probability. Then, for a requested threshold, mark which listed values satisfy \(x_j\leq x\) and add only their probabilities.
Check Your Understanding
For each question, begin by identifying the distinct values and their probabilities.
- A variable takes values \(-1,2,4\) with probabilities \(0.2,0.5,0.3\), respectively. Write its CDF piecewise and find \(F(2)\).
- Three equally likely outcomes are assigned values \(0,0,3\). What is the probability of each distinct value, and what is \(F(1)\)?
- A random variable takes values \(1\) and \(6\) with probabilities \(0.7\) and \(0.3\). Find \(F(5)\) and \(F(6)\).
- Explain why probabilities of different outcomes that share the same value of \(X\) must be combined before constructing the ordered cumulative totals.
- For possible values \(-2,0,5\), which values contribute to \(F(0)\), and which contribute to \(F(3)\)?