Sub topic 2
Discrete versus Continuous Random Variables
Prerequisites and scope
This chapter assumes you can do arithmetic with fractions, decimals, and percents. It also assumes you know the mean, median, and range of a data set, the basic probability of simple events, and how to read a number line. It builds on the previous chapter's definition of a random variable: a rule that assigns a number to each outcome of a random process. Here the question is how many values that number can take, and why the answer changes how you compute probabilities.
The core distinction
A random variable is discrete if its possible values can be listed one by one, even if the list never ends. Counts are the usual example. A random variable is continuous if it can take any value in an interval, so between any two possible values there is another possible value. Measurements such as time, length, and weight are the usual examples.
| Feature | Discrete | Continuous |
|---|---|---|
| Possible values | Separate, listable values | Every value in an interval |
| Typical source | Counting | Measuring |
| Probability of one exact value | Can be positive | Always 0 |
| How probability is described | A table of P(X = x) | Area under a curve |
| GRE example | Number of heads in 3 flips | Height of a randomly chosen adult |
The test for classification is not whether the numbers look like whole numbers. It is whether the variable can take values between any two of its values.
Discrete random variables
Let X be the number of heads in 3 fair coin flips. The possible values are 0, 1, 2, and 3. Nothing lies between 1 and 2, because you cannot get 1.5 heads. Each value has its own positive probability:
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X = x) | 1/8 | 3/8 | 3/8 | 1/8 |
The probabilities add to 1, which is required for any complete list of outcomes. To find P(X ≥ 2), add the entries for 2 and 3: 3/8 + 1/8 = 4/8 = 1/2.
A discrete variable can have infinitely many values. The number of flips needed to get the first head can be 1, 2, 3, and so on without end. The values are still separate and can be listed in order, so the variable is discrete.
Discrete values also need not be whole numbers. The price of an item that is always a multiple of $0.01 is discrete, because the possible prices are separate. In practice, though, GRE questions describe discrete variables with counts.
Continuous random variables
Let H be the height of a randomly chosen adult, measured with perfect precision. H could be 170 cm, 170.2 cm, 170.23 cm, and so on. Between any two heights there is always another one. You cannot list the values.
This has a surprising consequence. If H can take infinitely many values packed together, the probability of any single exact value must be 0. Otherwise the probabilities would add to more than 1. So P(H = 170) = 0, even though 170 is a possible height. "Possible" does not mean "has positive probability" for a continuous variable.
Probability is instead assigned to intervals. P(169 < H < 171) is the area under the variable's density curve between 169 and 171. The total area under the curve is 1. The curve's height at a point is not a probability. It only tells you how concentrated the values are near that point.
The following diagram contrasts the two cases.
Why the difference matters for probability
For a discrete variable, the endpoints of an inequality matter. In the coin example, P(X ≥ 2) = 1/2 but P(X > 2) = P(X = 3) = 1/8. Changing "≥" to ">" removes the value 2 and changes the answer.
For a continuous variable, the endpoints do not matter, because a single point has probability 0:
- P(a < X < b) = P(a ≤ X ≤ b)
- P(X ≤ c) = P(X < c)
- P(X ≥ c) = P(X > c)
This is useful on the normal distribution questions later in the tutorial. When a question asks for the probability that a normally distributed quantity is "at least" or "more than" a value, the two readings give the same answer.
Using code to see the contrast
The next program computes a discrete probability by adding table entries, then approximates a continuous probability as an area. It uses the standard normal cumulative distribution function, which gives the area to the left of a point. You will meet it formally in a later chapter, so treat it here as a tool that returns areas.
from fractions import Fraction
from math import erf, sqrt
# Discrete: number of heads in 3 fair flips
pmf = {0: Fraction(1, 8), 1: Fraction(3, 8), 2: Fraction(3, 8), 3: Fraction(1, 8)}
print(sum(pmf.values())) # 1
print(sum(p for x, p in pmf.items() if x >= 2)) # 1/2
print(sum(p for x, p in pmf.items() if x > 2)) # 1/8
# Continuous: standard normal, area to the left of z
def phi(z):
return 0.5 * (1 + erf(z / sqrt(2)))
print(round(phi(1) - phi(0), 4)) # 0.3413, P(0 < Z < 1)
print(phi(1) - phi(1)) # 0.0, P(Z = 1) is an interval of width 0The discrete answers change when the inequality changes. The continuous answer for a single point is 0, because the interval from 1 to 1 has no width and so no area.
Rounding, measuring, and the gray area
Real measurements are recorded to limited precision. A height recorded to the nearest centimeter takes only whole-number values, which looks discrete. The underlying quantity, height, is still continuous. GRE questions treat the quantity as described in the problem, so look for the wording:
- "The number of ..." or "how many" signals a count, so the variable is discrete.
- "The weight of ...", "the time ...", or "the length of ..." signals a measurement, so the variable is continuous.
- If a problem says a continuous quantity was "rounded to the nearest whole number," the rounded values are listable, but the problem usually still intends the continuous model.
Large discrete variables are sometimes modeled as continuous. The number of points on a test with hundreds of questions has many closely spaced values, so a smooth curve describes it well. This is the reason test scores appear in normal-distribution problems.
Common errors
- Judging by the look of the numbers. A continuous variable can have a whole-number-looking value such as 170. A discrete variable can have a decimal value, such as a price in dollars and cents. Ask whether values between the listed ones are possible.
- Assuming "possible" means "positive probability." For a continuous variable, every exact value is possible and has probability 0.
- Treating "greater than" and "at least" as the same for discrete variables. They differ by the probability of the boundary value.
- Reading the height of a density curve as a probability. A density curve can exceed 1 in height for a narrow distribution. Only area is probability.
- Forgetting that the table must sum to 1. If a discrete probability table has a missing entry, find it by subtracting the known entries from 1.
Worked examples
Example 1. Classify each variable.
- The number of customers who enter a shop in an hour: discrete, because it is a count.
- The time a customer spends in the shop: continuous, because time can take any value in an interval.
- The number of defective items in a box of 50: discrete, with values 0 through 50.
- The exact temperature at noon: continuous.
Example 2. A discrete variable X takes values 1, 2, 3, and 4. P(1) = 0.1, P(2) = 0.2, and P(3) = 0.4. Find P(X ≥ 3).
The probabilities must sum to 1, so P(4) = 1 − (0.1 + 0.2 + 0.4) = 0.3. Then P(X ≥ 3) = 0.4 + 0.3 = 0.7.
Example 3. A continuous variable Y has a symmetric bell-shaped distribution centered at 50. Is P(Y > 50) equal to P(Y ≥ 50)? Yes. A single point has probability 0, so the two events have the same probability. By symmetry, each equals 0.5.
Connection to the rest of the tutorial
The next chapters move from the idea of a variable to the idea of a distribution, which is the full description of how probability is spread over the values. For discrete variables, that is a table. For continuous variables, it is a curve, and the normal distribution is the most important curve on the GRE. Because normal variables are continuous, every question about them is a question about area over an interval.
Exercises
Exercise
A fair six-sided die is rolled, and X is the number shown. Is X discrete or continuous? Find P(X > 4) and P(X ≥ 4).
Show answer
X is discrete because its values 1 through 6 are separate and listable. Each value has probability 1/6. P(X > 4) = P(5) + P(6) = 2/6 = 1/3. P(X ≥ 4) = P(4) + P(5) + P(6) = 3/6 = 1/2. The two answers differ because the boundary value 4 has positive probability.
Exercise
The weight W of a randomly chosen apple is modeled by a continuous distribution with mean 150 grams. State P(W = 150). Then say whether P(W < 150) equals P(W ≤ 150), and explain why.
Show answer
P(W = 150) = 0, because a single value of a continuous variable has no area under the curve. P(W < 150) equals P(W ≤ 150), because the two events differ only by the single point 150, which has probability 0.
Exercise
A discrete variable takes the values 0, 1, 2, and 3 with P(0) = 0.15, P(1) = 0.35, and P(2) = 0.30. Find P(3), then find P(X ≤ 1).
Show answer
The probabilities sum to 1, so P(3) = 1 − (0.15 + 0.35 + 0.30) = 0.20. P(X ≤ 1) = P(0) + P(1) = 0.15 + 0.35 = 0.50.