Chapter 5 · OpenStax Ch 5

Continuous Random Variables

Densities, area as probability, and the exponential model of waiting times.

5.1 Density and area

A continuous random variable can take any value in a range, such as a waiting time, a height, or a distance. There are too many values to list, so instead of a probability for each one we draw a probability density function \(f(x)\). Probability is now area under the curve,

\[P(a \le X \le b) = \int_a^b f(x)\,dx = F(b) - F(a),\]

where \(F\) is the cumulative distribution function. The whole area is 1. Drag the two handles and watch the shaded area and the probability move together. Then press “Shrink interval to a point”: the area of a line is zero, so \(P(X = x) = 0\) for every single value. Draw some values and the bars settle onto the curve, and that is what a density is, the shape a histogram approaches. Switch to the exponential and see the same rules on a curve that is not flat.

Reading: OpenStax Introductory Statistics, Sections 5.1, 5.2.

Try it

  1. Uniform is selected. The interval runs from 2 to 6 and the shaded area is its probability.
  2. Drag either handle, or slide Lower end a and Upper end b. The area readout follows.
  3. Press Shrink interval to a point. The probability reads 0. A single value has no area.
  4. Widen it again and press Draw 100. Share of draws inside approaches the area.
  5. Pick Exponential. The same rule holds under a curve that is no longer flat.

5.2 The exponential distribution

Suppose arrivals happen at random with an average rate \(\lambda\) per minute. Then the wait between one arrival and the next has the exponential distribution, \(f(w) = \lambda e^{-\lambda w}\), with mean \(1/\lambda\). Short waits are common and long waits are rare, which the histogram shows as soon as a few dozen arrivals have come in.

The exponential has a strange property. It is memoryless. Slide “already waited” to two minutes. The dashed curve for the wait still ahead of you is the original curve, just moved along. Formally, \(P(W > t + s \mid W > t) = P(W > s)\). The readouts compare the two, in theory and in the data. Waiting has bought you nothing, because the next arrival is as far away as it was when you started. Buses run on schedules. Radioactive atoms do not.

Reading: OpenStax Introductory Statistics, Section 5.3.

Try it

  1. Arrival rate λ starts at 1 per minute, so Mean wait 1/λ is 1 minute.
  2. Press Next arrival a few times. Each wait lands on the timeline and in the histogram.
  3. Press 100 arrivals. Mean wait (sample) settles near 1/λ.
  4. Slide Already waited t to 2. The conditional curve shifts but keeps its shape, and the two probability readouts stay equal. That is memorylessness.
  5. Slide λ to 3. Arrivals crowd the timeline and the mean wait drops to a third of a minute.