How to Find a PMF and CDF
At a glance
- 1. Identify the variable type
A PMF applies to discrete variables; a CDF applies to both discrete and continuous variables.
- 2. List possible values
Write every value the random variable can take and determine its probability or density.
- 3. Check the probabilities
For a PMF, verify that every probability is nonnegative and that the total is one.
- 4. Accumulate probabilities
Construct the CDF by adding probabilities up to each value, or integrating the density up to x.
A probability mass function (PMF) describes the probabilities of a discrete random variable. A cumulative distribution function (CDF) describes the probability that a random variable is less than or equal to a given number. The PMF is used only for discrete variables, while every random variable has a CDF.
The usual workflow is: identify the possible values of the random variable, find the probability of each value, and then accumulate those probabilities to obtain the CDF.
PMF definition
If is a discrete random variable, its PMF is
A valid PMF must satisfy two conditions:
for every , and
The sum is taken over all possible values of . Values that cannot take have probability zero and may be omitted from the table.
CDF definition
The CDF of any random variable is
For a discrete random variable, obtain it from the PMF by summing all probabilities at or below :
The phrase “at or below” matters: the CDF uses , not .
A CDF always has values between zero and one, is nondecreasing, approaches zero toward the left, and approaches one toward the right.
Worked example: two coin tosses
Suppose a fair coin is tossed twice, and let be the number of heads. The possible values are , , and .
The four equally likely outcomes are
Here means tails and means heads. Count the outcomes corresponding to each value of :
| Outcomes | PMF | |
|---|---|---|
| 0 | ||
| 1 | ||
| 2 |
Therefore,
The probabilities add to one:
Now construct the CDF by accumulating the PMF values.
- If , no possible value is at most , so .
- If , only the value is included, so .
- If , the values and are included, so .
- If , all possible values are included, so .
Thus,
The CDF is a step function. It jumps by at , by at , and by at . In general, the jump at a point equals the PMF value .
Finding probabilities from the CDF
Once the CDF is known, you can calculate interval probabilities. For example,
For the coin-toss example,
This correctly counts the cases and while excluding .
For a discrete variable, a single-point probability can also be recovered from the CDF using the left-hand limit:
where denotes the value approached from the left. In the example, the jump at is
If the variable is absolutely continuous
If is absolutely continuous—that is, its distribution has a probability density function (PDF)—then it does not have a PMF in the usual sense. Individual points have probability zero:
Its CDF is found by integrating its PDF :
Not every continuous random variable has a PDF, but the following formula applies whenever a PDF exists.
For example, if is uniform on , its density is
Integrating gives
For instance,
A mixed random variable can have both point masses and a continuous component. In that case, the CDF still works, but there is no single PMF that describes the entire distribution.
Common mistakes
Confusing PMF and CDF
The PMF gives the probability of one exact value, . The CDF gives the probability of all values up to a point, .
Forgetting cumulative addition
For a discrete variable, the CDF is not usually equal to the PMF. At , for example, it includes the probabilities of , , and .
Using a PMF for a continuous variable
For an absolutely continuous variable, use a PDF and integrate it. More generally, a continuous distribution need not have a PDF. The probability at a single point is zero, even though the density at that point may be positive.
Ignoring intervals between possible values
If a discrete variable takes integer values, is constant between consecutive integers. For example, if , the CDF includes the probability of but not .
Failing to check the total
A proposed discrete distribution is invalid if its PMF values do not sum to one. This check often catches missing outcomes or incorrect counting.
References
- Introduction to Probability Models, Sheldon M. Ross
- A First Course in Probability, Sheldon Ross
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.