Lesson 1 of 8 · 14 min

From histograms to probability density

Estimate probabilities for a measured quantity from relative frequencies and density histograms, and see why probability becomes area for a continuous random variable.

What you will be able to do

  • Tell a continuous random variable (a measurement) from a discrete one (a count).
  • Estimate probabilities from relative frequencies in a grouped frequency table.
  • Draw and read a density histogram, where the area of each bar is a relative frequency.
  • Explain why P(X=a)=0P(X = a) = 0 for a continuous random variable.

In Unit 3 you met discrete random variables: the number of heads, the number of faulty phones. You could list every value and give each one a probability.

Now think about the time a Year 12 student takes to finish a logic puzzle. It might be 12 minutes, or 12.4, or 12.4173… A time is a measurement, so it can be any value in an interval. A random variable like this is continuous, and you cannot list its values one by one. You need a different way to describe its probabilities, and data shows you the way.

Definition

Continuous random variable

A continuous random variable can take any value in an interval of real numbers. Measurements such as time, mass, length, temperature and volume are continuous. Counts are discrete.

Times taken by 50 students to finish a logic puzzle.
Time tt (minutes)FrequencyRelative frequency
0≤t<50 \le t < 540.08
5≤t<105 \le t < 10110.22
10≤t<1510 \le t < 15170.34
15≤t<2015 \le t < 20120.24
20≤t<2520 \le t < 2560.12
Total501

Let TT be the time, in minutes, a randomly chosen student takes. Relative frequencies are point estimates of probabilities, just as they were for discrete variables. For example,

P(T<10)≈0.08+0.22=0.30.P(T < 10) \approx 0.08 + 0.22 = 0.30.

Use the table to estimate the probability that a randomly chosen student takes at least 15 minutes.

Interactive

The puzzle times as a histogram

The 50 raw times behind the table. With bins of 5 minutes the histogram matches the frequency column. Notice the shape: a single peak near 13 minutes and a tail on each side.

A frequency histogram shows counts as heights. To read probabilities straight from the picture, rescale the heights so that area is relative frequency. Divide each relative frequency by the class width:

relative frequency density=relative frequencyclass width.\text{relative frequency density} = \frac{\text{relative frequency}}{\text{class width}}.

For the 10≤t<1510 \le t < 15 class, the density is 0.345=0.068\frac{0.34}{5} = 0.068 per minute, and the bar's area is 5×0.068=0.345 \times 0.068 = 0.34. The bars' areas add to 1, because the relative frequencies do.

A density histogram of the puzzle times. Each bar's area is its relative frequency, so the total area is 1. The dashed curve is a smooth model of the same shape.

Key idea

Probability is area

In a density histogram, the probability that TT falls in an interval is estimated by the area of the bars over that interval, not their height.

Collect more and more data and use narrower and narrower classes, and the tops of the bars settle down into a smooth curve. That limiting curve is the probability density function of TT, and the area under it between aa and bb is P(a<T<b)P(a < T < b). You will work with these functions from the next lesson.

Worked example

Estimate probabilities for egg masses from grouped data

  • Simple familiar

A farm weighed 200 eggs. The results are in the table.

Mass mm (g)45≤m<5045 \le m < 5050≤m<5550 \le m < 5555≤m<6055 \le m < 6060≤m<6560 \le m < 6565≤m<7565 \le m < 75
Frequency1238705228

Let MM be the mass of a randomly chosen egg.

(a) Estimate P(M≥60)P(M \ge 60).

(b) Find the heights of the bars for the 60≤m<6560 \le m < 65 and 65≤m<7565 \le m < 75 classes in a density histogram.

(c) Estimate P(57<M<62)P(57 < M < 62), assuming masses are spread evenly within each class.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Relative frequency = frequency ÷ total; use it as the probability estimate.

  2. Density = relative frequency ÷ class width; area of a bar = relative frequency.

  3. For part of a class, take the matching fraction of its area.

Watch out for

  • Comparing frequencies of classes with different widths: compare densities instead.

  • Forgetting to divide the 62.8 eggs by 200 to make a probability.

In a density histogram, a class from 40 to 60 has relative frequency 0.3. What is the height of its bar?

There is one surprising consequence of "probability is area". What is the probability that a student takes exactly 12 minutes, to infinitely many decimal places? The interval from 12 to 12 has width zero, so the area above it is zero:

P(T=12)=0.P(T = 12) = 0.

This does not mean 12 minutes is impossible. It means a single exact value carries no probability on its own; only intervals do. A useful side effect: for a continuous random variable, P(T<12)P(T < 12) and P(T≤12)P(T \le 12) are equal.

The mass MM of a randomly chosen banana is a continuous random variable. Which statement is true?

Choose one answer

Common mistake

Height is not probability

With unequal class widths, the tallest bar of a frequency histogram is not necessarily the most likely class per unit, and in a density histogram a bar's height can even exceed 1 when classes are narrow. Always turn heights into areas: height×width\text{height} \times \text{width}.

Summary

  • A continuous random variable takes any value in an interval: it is a measurement, not a count.

  • Relative frequencies from data are point estimates of probabilities.

  • In a density histogram, height =relative frequencyclass width= \frac{\text{relative frequency}}{\text{class width}}, and area is relative frequency. The total area is 1.

  • As the data grows and the classes narrow, the bars approach a smooth curve: the probability density function.

  • For a continuous random variable P(X=a)=0P(X = a) = 0, so P(X<a)=P(X≤a)P(X < a) = P(X \le a).

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 1 of 80% read

Save your progress with a free account