B. Probability Distributions · Continuous Distributions and the Normal DistributionFrom Frequency Polygons to Density Curves: Why We Need Models
B2.3 B2.4 B2.5About 65 minutes
Learning goals- I can explain why it is hard to build a frequency distribution for a continuous random variable.
- I can draw a relative frequency density histogram whose total area is 1.
- I can describe how a histogram approaches a smooth curve as the data grow and the class width shrinks.
- I can state the properties of a probability density curve and test whether a simple function is a valid one.
Words to know
relative frequency density
Relative frequency ÷ class width. Used as bar height, it makes each bar's area equal to the proportion of data in the class.
density curve
A smooth curve that models the distribution of a continuous random variable. It is never below the horizontal axis and the total area under it is exactly 1.
probability density function (pdf)
The function f(x) whose graph is the density curve. Probabilities are areas under its graph.
mathematical model
A formula or curve that describes a real situation well enough to make predictions, even though real data never fit it perfectly.
uniform distribution
A continuous distribution whose density curve is a horizontal line segment: every interval of the same length is equally likely.
The trouble with continuous data
For a discrete random variable such as the number of heads in 3 tosses, you can list every value and its probability in a table. Try that for the height of a maple seedling and you run into trouble:
- There are infinitely many possible values. You cannot list them all, and no table can give each one its own row.
- Measurements are rounded. A recorded 32.4 cm stands for a whole interval of true heights, so the data never show exact values anyway.
- The picture depends on your choices. As you saw in the last lesson, the class width (and even where you start the classes) changes the shape of the histogram.
- A sample is not the population. 40 seedlings give a bumpy histogram. Another 40 would give a different bumpy histogram. You can never measure every seedling there is.
Because of all this, statisticians describe continuous variables with a mathematical model: a smooth density curve that captures the overall pattern and ignores the random bumps.
Step 1: Make the area mean something
In the last lesson you learned that if each bar's height is the
relative frequency density = relative frequency ÷ class width,
then each bar's area is the relative frequency (the proportion of data in that class), and the total area is 1. This is the key move. Now histograms with different class widths and different numbers of data values can be drawn on the same vertical scale and compared fairly.
Worked exampleExample 1: A relative frequency density histogram
Turn the seedling frequency table (40 seedlings, width 5 cm, frequencies 3, 3, 10, 9, 10, 4, 1) into a relative frequency density table and check that the total area is 1.
- Relative frequencies (÷ 40): 0.075, 0.075, 0.25, 0.225, 0.25, 0.10, 0.025.
- Densities (÷ 5): 0.015, 0.015, 0.05, 0.045, 0.05, 0.02, 0.005 per cm.
- Areas (× 5): back to 0.075, 0.075, 0.25, 0.225, 0.25, 0.10, 0.025.
- Total area: 0.075 + 0.075 + 0.25 + 0.225 + 0.25 + 0.10 + 0.025 = 1.
Bar heights 0.015, 0.015, 0.05, 0.045, 0.05, 0.02, 0.005 per cm; total area 1.
Step 2: More data, narrower classes, smoother shape
Imagine measuring more and more seedlings and using narrower and narrower classes. The density histogram changes like this:
- With 40 values, the shape is rough.
- With 400 values and half the width, the shape is clearer.
- With 4000 values and an even narrower width, the tops of the bars line up along a smooth curve.
In the limit (infinitely many values, infinitely thin classes), the outline of the histogram, which is also its frequency polygon, becomes a smooth density curve. Because every density histogram has area 1, the curve has area 1 too.
Simulated seedling heights drawn as density histograms. With more values and narrower classes, the bar tops settle onto a smooth bell-shaped curve (drawn on the right). The vertical scale is the same in all three panels because the area is always 1.Step 3: Probability is area
A density curve y = f(x) for a continuous random variable X has two properties:
- f(x) ≥ 0 for every x (the curve never goes below the axis).
- The total area between the curve and the x-axis is 1.
The probability that X falls between a and b is the area under the curve from a to b. That is the continuous version of adding up bar areas. The height f(x) itself is not a probability (it can even be bigger than 1 if the curve is narrow); only areas are probabilities.
A density curve for seedling heights. The shaded area between 25 cm and 40 cm is the probability that a randomly chosen seedling is between 25 and 40 cm tall.Worked exampleExample 2: Estimating a probability from a density histogram
Use the densities from Example 1 to estimate the proportion of seedlings between 27 cm and 33 cm tall. Assume values are spread evenly inside each class.
- From 27 to 30 cm: 3 cm of the 25 to 30 bar, density 0.05. Area = 3 × 0.05 = 0.15.
- From 30 to 33 cm: 3 cm of the 30 to 35 bar, density 0.045. Area = 3 × 0.045 = 0.135.
- Total area = 0.15 + 0.135 = 0.285.
About 0.285, or 28.5% of the seedlings. (The actual count in the data is 10 of 40 = 25%, so the estimate is reasonably close.)
Worked exampleExample 3: Is it a valid density curve?
(a) Is f(x) = 0.1 for 0 ≤ x ≤ 10 (and 0 elsewhere) a valid density? (b) Is g(x) = 0.2 for 0 ≤ x ≤ 10? (c) h(x) = kx for 0 ≤ x ≤ 4 (and 0 elsewhere). Find k so that h is a valid density.
- (a) The graph is a rectangle 10 wide and 0.1 tall. Area = 10 × 0.1 = 1, and f ≥ 0. Valid. (This is a uniform distribution.)
- (b) Area = 10 × 0.2 = 2, not 1. Not valid.
- (c) The graph is a triangle with base 4 and height h(4) = 4k. Area = (1/2)(4)(4k) = 8k.
- Set 8k = 1, so k = 1/8 = 0.125. Since k > 0, h(x) ≥ 0 on the interval.
(a) Yes (b) No (c) k = 1/8.
Common shapes of density curves
- Uniform: flat (a rectangle). Example: the waiting time for a bus that comes every 20 minutes, if you arrive at a random time.
- Bell-shaped (normal): symmetric with one peak. Example: many biological measurements such as heights of plants of the same age.
- Skewed right: a long tail to the right. Example: wait times at a walk-in clinic.
- Skewed left: a long tail to the left. Example: marks on a very easy test.
The most important model in this course, the normal distribution, starts in the lesson The Normal Distribution and Its Properties.
Just for funDensity curves never worry about putting on weight. No matter how tall or wide they get, the area underneath is always exactly 1.
Hands-on activityWatch a curve appear (spreadsheet)
You need: a computer with a free spreadsheet (Google Sheets, LibreOffice Calc or Excel). If you have no computer, roll 3 dice 60 times and use the sum instead (that one is discrete, but the shape idea is the same).
- In cell A1 type =RAND()+RAND()+RAND() and press Enter. This adds three random numbers between 0 and 1, so the result is a continuous value between 0 and 3.
- Copy the formula down to A1000.
- Make a histogram of A1:A40 (the first 40 values) with about 6 classes. Then make one of all 1000 values with about 30 classes.
- Compare the two shapes.
What to look for: the 40-value histogram is bumpy. The 1000-value histogram looks like a smooth hill, highest near 1.5 and symmetric. (Every time the sheet recalculates you get new random values, and the small histogram changes a lot while the big one barely changes.)
Your turn
1Give two reasons why you cannot make a table listing every value and its probability for the mass of a randomly chosen apple.
Sample answer: (1) mass can take infinitely many values in an interval, so they cannot all be listed; (2) masses are measured and rounded, so the data never give exact values. (Also: a sample never includes every apple.)
2A class has relative frequency 0.30 and width 2 cm. What is its relative frequency density?
3A density histogram bar is 4 units wide and 0.06 tall. What proportion of the data does it represent?
4Is f(x) = 0.25 for 0 ≤ x ≤ 4 a valid density function? Explain.
Yes. f ≥ 0 and the area is 4 × 0.25 = 1.
5Find c so that f(x) = c for 2 ≤ x ≤ 7 is a valid density.
Width 5, so 5c = 1 and c = 0.2.
6Why can the height of a density curve be greater than 1?
Height is not a probability; only area is. A very narrow curve must be tall for its area to equal 1. For example, f(x) = 2 on 0 ≤ x ≤ 0.5 has area 1.
7Using the seedling densities from Example 1, estimate the proportion of seedlings taller than 42 cm.
From 42 to 45: 3 × 0.02 = 0.06. From 45 to 50: 5 × 0.005 = 0.025. Total ≈ 0.085 (8.5%).
More practice: warm-up
1What is the total area under any density curve?
2Can a density curve go below the x-axis?
3On a density curve, what represents a probability?
The area under the curve over an interval.
4What shape is the graph of a uniform density?
A rectangle (a horizontal segment).
5A uniform density runs from 0 to 20. What is its height?
More practice: on your own
1Times (min) for 50 customers: 0 to 2 (10), 2 to 4 (20), 4 to 6 (15), 6 to 10 (5). Find the relative frequency density for each class. (Notice that the last class is wider.)
Relative frequencies: 0.2, 0.4, 0.3, 0.1. Densities: 0.2 ÷ 2 = 0.1, 0.4 ÷ 2 = 0.2, 0.3 ÷ 2 = 0.15, 0.1 ÷ 4 = 0.025 per min.
2For the customer data, check that the total area is 1.
2(0.1) + 2(0.2) + 2(0.15) + 4(0.025) = 0.2 + 0.4 + 0.3 + 0.1 = 1 ✓
3Using the customer densities, estimate the proportion of customers who wait between 3 and 7 minutes.
3 to 4: 1 × 0.2 = 0.2; 4 to 6: 2 × 0.15 = 0.3; 6 to 7: 1 × 0.025 = 0.025. Total ≈ 0.525.
4A density is f(x) = kx for 0 ≤ x ≤ 10. Find k.
Triangle area (1/2)(10)(10k) = 50k = 1, so k = 0.02.
5With f(x) = 0.02x on 0 ≤ x ≤ 10, find P(X < 5).
Area of the triangle from 0 to 5: (1/2)(5)(0.02 × 5) = (1/2)(5)(0.1) = 0.25.
Challenge
1Explain why the density histogram for 4000 values with width 2 is smoother than the one for 40 values with width 8, even though its classes are narrower.
Each narrow class in the big data set still holds many values (often over 100), so random ups and downs are small relative to the counts. With 40 values, each class holds only a few, so one or two extra values change a bar a lot. Narrow classes need many values to look smooth.
2A density is f(x) = 0.5 − 0.125x for 0 ≤ x ≤ 4. Show it is valid, and find P(X > 2).
At x = 0, f = 0.5; at x = 4, f = 0; it is never negative on [0, 4]. Area = (1/2)(4)(0.5) = 1 ✓. P(X > 2) is the small triangle from 2 to 4 with height f(2) = 0.25: (1/2)(2)(0.25) = 0.25.
3For the uniform density f(x) = 1/20 on 0 ≤ x ≤ 20, find P(X = 7) and P(6.5 < X < 7.5). What happens to P(7 − d < X < 7 + d) as d → 0?
P(6.5 < X < 7.5) = 1 × (1/20) = 0.05. P(7 − d < X < 7 + d) = 2d/20 = d/10, which shrinks to 0 as d → 0. So P(X = 7) = 0. You will look at this more closely in the next lesson.
Check your understandingQuiz
1. Which is a reason continuous distributions need mathematical models?
2. What is the total area under a valid density curve?
3. A bar in a density histogram is 5 units wide and 0.04 units tall. What proportion of the data is in it?
4. Find k if f(x) = k for 3 ≤ x ≤ 11 is a density function.
5. As the number of data values grows and the class width shrinks, a relative frequency density polygon...
6. Which statement about the height f(x) of a density curve is true?
For parents and teachersBig ideas (B2.3, B2.4, B2.5): continuous data have infinitely many possible values, are rounded when measured, and look different depending on class width and sample. So we model them with a smooth density curve with total area 1, and probability = area under the curve.
How to help: The spreadsheet activity is worth doing together: watching 40 random values give a bumpy histogram while 1000 give a smooth hill makes the idea of a model very clear. Ask: "What does the area of a bar mean? What does the height mean?"
Common difficulties:
- Treating the height of the curve as a probability. Only areas are probabilities.
- Forgetting to divide by class width when classes have different widths.
- Thinking the model must match every bump in the data. A model shows the overall pattern.