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 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.
| Time (minutes) | Frequency | Relative frequency |
|---|---|---|
| 4 | 0.08 | |
| 11 | 0.22 | |
| 17 | 0.34 | |
| 12 | 0.24 | |
| 6 | 0.12 | |
| Total | 50 | 1 |
Let 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,
Use the table to estimate the probability that a randomly chosen student takes at least 15 minutes.
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:
For the class, the density is per minute, and the bar's area is . 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 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 , and the area under it between and is . You will work with these functions from the next lesson.
Worked example
Estimate probabilities for egg masses from grouped data
A farm weighed 200 eggs. The results are in the table.
| Mass (g) | |||||
|---|---|---|---|---|---|
| Frequency | 12 | 38 | 70 | 52 | 28 |
Let be the mass of a randomly chosen egg.
(a) Estimate .
(b) Find the heights of the bars for the and classes in a density histogram.
(c) Estimate , assuming masses are spread evenly within each class.
Step 1: Add the relative frequencies for (a)
The classes from 60 g up hold eggs, so .
Step 2: Divide relative frequency by class width for (b)
: relative frequency , width 5, height .
: relative frequency , width 10, height .
In a density histogram the bar's area is the relative frequency. The last class is twice as wide, so its bar must be shorter to keep the area right.
Step 3: Take the right fraction of each class for (c)
The interval covers 3 g of the 5 g class and 2 g of the class . With masses spread evenly:
Spreading evenly within a class means the bar is flat, so the area over part of it is that fraction of the whole bar.
Step 4: Convert to a probability
Try it yourself first, then check the working one step at a time.
Answer
(a) (b) heights and per gram (c) about
Method
Relative frequency = frequency ÷ total; use it as the probability estimate.
Density = relative frequency ÷ class width; area of a bar = relative frequency.
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:
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, and are equal.
The mass of a randomly chosen banana is a continuous random variable. Which statement is true?
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: .
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 , 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 , so .
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.