Topic 2 of 7
Discrete and continuous random variables
Step 22 · Probability theory topics
Describe random variables by their probability mass or density functions, compute probabilities from them, and use cumulative distribution functions for both kinds.
Probability mass functions
A discrete random variable takes separate values, like counts. Its probability mass function p(x) = P(X = x) gives each value's probability. The probabilities are never negative, and they add to 1.
| Distribution | p(k) | Mean |
|---|---|---|
| Bernoulli(p) | p for 1, 1 − p for 0 | p |
| Binomial(n, p) | np | |
| Geometric(p) | ||
| Poisson(λ) | λ |
Example: Geometric
A free throw goes in with probability 0.7. What is the probability the first miss comes on the third throw?
- Make, make, then miss: 0.7 × 0.7 × 0.3.
Answer0.147
Example: Poisson
A help desk gets 3 calls an hour on average. What is the probability of no calls in an hour?
- For a Poisson(3) count, .
AnswerAbout 0.050
Probability density functions
A continuous random variable takes values across a whole interval. Its density f(x) gives probabilities as areas: P(a ≤ X ≤ b) is the integral of f from a to b. The total area is 1, and any single value has probability 0.
Example: A uniform variable
X is uniform on [0, 4]. What is P(1 ≤ X ≤ 2.5)?
- The density is 1/4 on [0, 4].
- The area from 1 to 2.5 is 1.5 × 1/4.
Answer0.375
Example: An exponential variable
A bulb's lifetime in years has density for x ≥ 0. What is P(X > 2)?
- .
AnswerAbout 0.368
Cumulative distribution functions
The cumulative distribution function F(x) = P(X ≤ x) works for both kinds. It rises from 0 to 1. For a continuous variable it is the integral of the density, and the density is its derivative.
Example: Uniform
Find F(x) for X uniform on [0, 4].
- For 0 ≤ x ≤ 4, F(x) is the area up to x, which is x/4.
- F is 0 below 0 and 1 above 4.
AnswerF(x) = x/4 on [0, 4]
Example: From F to probabilities
for x ≥ 0. Find P(1 < X ≤ 2).
- P(1 < X ≤ 2) = F(2) − F(1).
- That is .
AnswerAbout 0.233
Try it yourself
Work each one on paper first, then open the answer to check.
X is 1, 2 or 3 with probabilities 0.2, 0.5 and c. What is c?
Show answer
0.3
X is binomial with n = 4 and p = 0.5. What is P(X = 4)?
Show answer
X is uniform on [2, 6]. What is P(X ≤ 3)?
Show answer
0.25
f(x) = 2x on [0, 1]. What is P(X ≤ 0.5)?
Show answer
0.25
X is continuous. What is P(X = 3)?
Show answer
0
F(5) = 0.8 and F(2) = 0.3. What is P(2 < X ≤ 5)?
Show answer
0.5