Statistics & Probability · Grade 12 and undergraduate

Continuous Random Variables: Densities, Uniform and Exponential

Quick answer

A continuous random variable, like a waiting time or a length, can take any value in an interval, so the chance of any single exact value is 0. Its probabilities come from a probability density function f: f(x) ≥ 0, the total area under f is 1, and P(a < X < b) is the area from a to b. The mean is ∫ x f(x) dx and the variance is ∫ (x − μ)² f(x) dx. The uniform distribution spreads probability evenly over an interval; the exponential distribution models waiting times, with P(X > t) = e^(−λt).

What you'll learn

  • Check that a function is a valid probability density
  • Compute probabilities as areas under a density
  • Find the mean and variance of a continuous random variable
  • Use the uniform and exponential distributions

Probability as area

A bus comes every 1010 minutes, and you arrive at a random moment. Your wait XX can be any number from 00 to 1010, not only whole minutes. For such a continuous random variable, probabilities come from a probability density function ff:

  • f(x)≥0f(x) \ge 0 everywhere, and the total area under ff is 11;
  • P(a<X<b)=∫abf(x) dxP(a < X < b) = \displaystyle\int_a^b f(x)\,dx, the area between aa and bb.

The mean and variance replace the sums of a discrete random variable with integrals:

μ=∫x f(x) dxσ2=∫(x−μ)2f(x) dx=∫x2f(x) dx−μ2\mu = \int x\,f(x)\,dx \qquad \sigma^2 = \int (x - \mu)^2 f(x)\,dx = \int x^2 f(x)\,dx - \mu^2
DistributionDensityMeanStandard deviation
uniform on [a,b][a, b]1b−a\tfrac{1}{b - a}a+b2\tfrac{a + b}{2}b−a12\tfrac{b - a}{\sqrt{12}}
exponential, rate λ\lambdaλe−λx\lambda e^{-\lambda x}, x≥0x \ge 01λ\tfrac{1}{\lambda}1λ\tfrac{1}{\lambda}

Why a single value has probability zero

P(X=2)P(X = 2) would be the area above a single point: a region with no width. But P(1.99<X<2.01)P(1.99 < X < 2.01) is a thin strip with some area. A density is probability per unit of length, so only intervals carry probability. That is why f(x)f(x) itself can be larger than 11: it is a rate, not a probability. It also means P(X≤a)P(X \le a) and P(X<a)P(X < a) are the same.

An exponential density with mean 2 The density f(x) = 0.5e^(−0.5x) for x from 0 to 8, starting at 0.5 and decaying toward 0. The area under the curve from 0 to 2 is shaded: the probability of a wait shorter than the mean, about 0.63. 2468xf
  • f(x) = 0.5e^(−0.5x)
An exponential density with mean 2

Worked examples

Common mistakes

Practice problems

  1. Find cc so that f(x)=cxf(x) = cx on [0,2][0, 2] is a density.

    Answer

    c=12c = \tfrac{1}{2}

    Full solution

    ∫02cx dx=2c=1\int_0^2 cx\,dx = 2c = 1.

  2. For f(x)=x2f(x) = \tfrac{x}{2} on [0,2][0, 2], find P(X>1)P(X > 1).

    Answer

    34\tfrac{3}{4}

    Full solution

    ∫12x2 dx=4−14\int_1^2 \tfrac{x}{2}\,dx = \tfrac{4 - 1}{4}.

  3. For f(x)=x2f(x) = \tfrac{x}{2} on [0,2][0, 2], find the mean.

    Answer

    43\tfrac{4}{3}

    Full solution

    ∫02x22 dx=86\int_0^2 \tfrac{x^2}{2}\,dx = \tfrac{8}{6}.

  4. XX is uniform on [2,8][2, 8]. Find P(3<X<5)P(3 < X < 5) and the mean.

    Answer

    13\tfrac{1}{3} and 55

    Full solution

    The density is 16\tfrac{1}{6}, and the interval has length 22.

  5. Calls arrive with exponential gaps, mean 44 minutes. Find the chance of waiting more than 88 minutes.

    Answer

    e−2≈0.135e^{-2} \approx 0.135

    Full solution

    λ=14\lambda = \tfrac{1}{4}, so P(X>8)=e−8/4P(X > 8) = e^{-8/4}.

  6. In the figure, check that the shaded area is about 0.630.63.

    Answer

    1−e−1≈0.6321 - e^{-1} \approx 0.632

    Full solution

    ∫020.5e−0.5x dx=1−e−1\int_0^2 0.5e^{-0.5x}\,dx = 1 - e^{-1}. For any exponential, P(X<μ)=1−e−1P(X < \mu) = 1 - e^{-1}.

  7. A bulb from Example 3 has already lasted 1,0001{,}000 hours. What is the chance it lasts 1,5001{,}500 more?

    Answer

    e−1.5≈0.223e^{-1.5} \approx 0.223, the same as for a new bulb

    Full solution

    P(X>2500)P(X>1000)=e−2.5e−1=e−1.5\tfrac{P(X > 2500)}{P(X > 1000)} = \tfrac{e^{-2.5}}{e^{-1}} = e^{-1.5}. The exponential distribution is memoryless.

  8. A student says P(X=0.5)=f(0.5)=0.75P(X = 0.5) = f(0.5) = 0.75 for f(x)=3x2f(x) = 3x^2. What is wrong?

    Answer

    P(X=0.5)=0P(X = 0.5) = 0; f(0.5)f(0.5) is a density, not a probability.

    Full solution

    A single point has no width, so it holds no area. Only intervals have positive probability.

Frequently asked questions

What is a probability density function?

A function f with f(x) ≥ 0 and total area 1 under its graph. The probability that X falls between a and b is the area under f from a to b.

Why is P(X = a) zero for a continuous variable?

It is the area of a region with no width. Only intervals carry probability, so P(X ≤ a) and P(X < a) are equal.

How do you find the mean of a continuous random variable?

μ = ∫ x f(x) dx over all possible values. The variance is ∫ (x − μ)² f(x) dx, or ∫ x² f(x) dx − μ².

What is the uniform distribution?

On [a, b], f(x) = 1/(b − a). Its mean is (a + b)/2 and its standard deviation is (b − a)/√12.

What is the exponential distribution?

f(x) = λe^(−λx) for x ≥ 0, a model for waiting times. Its mean is 1/λ, and P(X > t) = e^(−λt).

What to learn next