Prob and StatsRandom Variables

Continuous Random Variables

Probability is area under a density curve.

Not started Jump to practice

A waiting time, a height, an exact weight: these can take any value in an interval, not just separate values like counts. You have already met one continuous model, the normal curve, where probability was area. This lesson makes that the general rule.

Key idea

A continuous random variable is described by a density curve: a curve on or above the x-axis with total area 1 under it. The probability that $X$ falls in an interval is the area under the curve over that interval. Any single exact value has probability 0, so $P(X \le c) = P(X < c)$.

Why it works

With infinitely many possible values, no single value can carry a positive amount of probability, or the total would be infinite. Instead probability is spread out like paint over an interval, and the height of the curve tells how thickly it is spread. An interval of width 0 holds no paint. That is why we ask about ranges: "between 4.9 and 5.1 grams," never "exactly 5 grams."
A uniform density on 0 to 20 minutes: height 1/20 = 0.05, so the total area is 20 × 0.05 = 1.

Worked example: A uniform wait

A bus arrives at a random time in the next 20 minutes, all times equally likely. Find the probability you wait less than 5 minutes, and between 5 and 12 minutes.
  1. The density is flat at height $\frac{1}{20}$ from 0 to 20.
  2. Less than 5: a rectangle of width 5, area $5 \times \frac{1}{20} = \frac{1}{4}$.
  3. Between 5 and 12: width 7, area $\frac{7}{20} = 0.35$.

Answer: $\frac14$ and $\frac{7}{20}$.

Worked example: A single value

For the same bus, find $P(X = 7)$ and $P(X \le 7)$.
  1. A single point has width 0, so its area is 0: $P(X = 7) = 0$.
  2. $P(X \le 7) = P(X < 7) = \frac{7}{20}$.

Answer: $0$ and $\frac{7}{20}$.

Worked example: A triangle

$X$ has density $f(x) = \frac{x}{8}$ for $0 \le x \le 4$. Check that it is a density, then find $P(X < 2)$.
  1. Total area: a triangle with base 4 and height $f(4) = \frac{1}{2}$: $\frac{1}{2} \cdot 4 \cdot \frac{1}{2} = 1$.
  2. Area left of 2: base 2, height $f(2) = \frac{1}{4}$: $\frac{1}{2} \cdot 2 \cdot \frac{1}{4} = \frac{1}{4}$.

Answer: $\frac{1}{4}$

Common mistake

Thinking $P(X = 3)$ is positive for a continuous variable, or reading the height of the density as a probability. Heights can even exceed 1 (a uniform density on 0 to 0.5 has height 2). Check: probabilities are areas, so a single point gets 0.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax, Introductory Statistics 2e, section 5.1 Continuous Probability Functions
  • OpenStax, Introductory Statistics 2e, section 5.2 The Uniform Distribution
@teddyrookbook GitHub