Skip to content
Family Table Math

Continuous Random Variables

Some quantities are counted (the number of goals in a game), but many are measured: heights, masses, times, temperatures. A measured quantity can take any value in a range, so you can’t list its outcomes one by one the way you did for discrete random variables. Instead, you group the data into intervals, draw a histogram, and think of probability as area. This idea is the foundation for the normal distribution.

A random variable XX gives a number to each outcome of an experiment.

DiscreteContinuous
Valuesseparate values you can countany value in an interval
How you get themcountingmeasuring
Examplesnumber of heads, number of absent studentsheight in cm, mass in g, time in minutes
Graphbar graph (gaps between bars)histogram (bars touch)

A good test: could there be a value between any two possible values? Between 170170 cm and 171171 cm there’s 170.5170.5 cm, 170.52170.52 cm, and so on. That makes height continuous.

You can never pin down a continuous distribution exactly:

  • Sampling. You can’t measure every apple in Ontario, so you only ever see a sample, and a different sample gives a slightly different picture.
  • Measurement uncertainty. Every measurement is rounded. A mass recorded as 172172 g really means “somewhere from 171.5171.5 g to 172.5172.5 g”. No ruler or scale gives the exact value.

So statisticians use a smooth model (a curve, like the normal curve) that describes the data well, rather than trying to know the true distribution perfectly.

Frequency tables, histograms, and polygons

Section titled “Frequency tables, histograms, and polygons”

To organize continuous data:

  1. Split the range into intervals (also called classes or bins) of equal width, such as 140≤m<150140 \le m \lt 150. Each value goes in exactly one interval.
  2. Count the frequency in each interval.
  3. Draw a frequency histogram: bars with no gaps, one per interval, with height equal to the frequency.
  4. For a frequency polygon, plot a point at the midpoint of the top of each bar and join the points with straight lines. Add a point with frequency 00 at the midpoint of an empty interval at each end, so the polygon starts and ends on the axis.

Here are the masses of 5050 apples from one orchard:

Mass (g)140140–150150150150–160160160160–170170170170–180180180180–190190190190–200200
Frequency3388141413139933

(Each interval includes its left end but not its right end, so 160160–170170 means 160≤m<170160 \le m \lt 170.)

A frequency histogram of the masses of 50 apples in 10 gram intervals from 140 to 200 grams, with frequencies 3, 8, 14, 13, 9, 3, and a frequency polygon joining the tops of the bars at their midpoints. 2 4 6 8 10 12 14 130 140 150 160 170 180 190 200 210 mass (g) frequency frequency polygon
A frequency histogram of the apple masses, with its frequency polygon.

The interval width changes what you see:

  • Too wide (say, 22 or 33 intervals): the details of the shape disappear.
  • Too narrow (say, 11 g intervals for 5050 apples): most intervals hold 00, 11, or 22 values, and the graph looks jagged and random.
  • A useful middle ground is often about 55 to 1010 intervals.

As you collect more and more data and make the intervals narrower, the frequency polygon starts to look like a smooth curve. That curve is the model for the distribution.

If you divide each frequency by the total, you get relative frequencies, which estimate probabilities. For example, P(160≤m<180)≈14+1350=0.54P(160 \le m \lt 180) \approx \dfrac{14 + 13}{50} = 0.54.

For a smooth model curve (a probability density curve), the total area under the curve is 11, and

P(a≤X≤b)=area under the curve from a to bP(a \le X \le b) = \text{area under the curve from } a \text{ to } b

A single value has no width, so its area is 00:

P(X=a)=0for any single value aP(X = a) = 0 \quad \text{for any single value } a

That’s why, for continuous variables, P(X<a)P(X \lt a) and P(X≤a)P(X \le a) are the same. It also matches real life: the chance an apple has a mass of exactly 172.000…172.000\ldots g is zero. Only ranges make sense.

Is each random variable discrete or continuous?

  • (a) the time it takes to run 100100 m
  • (b) the number of cars in a parking lot
  • (c) the volume of juice in a bottle
  • (d) a shoe size

Solution. (a) Continuous: time is measured, and any value in a range is possible. (b) Discrete: cars are counted. (c) Continuous: volume is measured. (d) Discrete: shoe sizes only come in set values like 88, 8128\tfrac{1}{2}, 99, with nothing in between. (The foot length that a shoe size is based on is continuous, though.)

Twenty students recorded their commute to school, in minutes:

12.4, 18.7, 22.1, 15.0, 9.8, 25.3, 17.6, 14.2, 20.9, 11.5,12.4,\ 18.7,\ 22.1,\ 15.0,\ 9.8,\ 25.3,\ 17.6,\ 14.2,\ 20.9,\ 11.5, 16.8, 23.4, 19.2, 13.7, 21.6, 17.1, 8.9, 15.9, 18.3, 26.016.8,\ 23.4,\ 19.2,\ 13.7,\ 21.6,\ 17.1,\ 8.9,\ 15.9,\ 18.3,\ 26.0

Make a frequency table with intervals of width 55 minutes, starting at 55. Describe the shape.

Solution. The smallest value is 8.98.9 and the largest is 26.026.0, so intervals from 55 to 3030 cover everything. Tally each value (remember 15.015.0 goes in 1515–2020, not 1010–1515):

Time (min)55–10101010–15151515–20202020–25252525–3030
Frequency2244884422

Check: 2+4+8+4+2=202 + 4 + 8 + 4 + 2 = 20. ✓

The distribution is symmetric and mound-shaped: most commutes are 1515 to 2020 minutes, with fewer very short or very long ones.

Example 3: Probability from a frequency table

Section titled “Example 3: Probability from a frequency table”

Use the apple table above. Estimate the probability that a randomly chosen apple from the orchard has a mass of at least 180180 g, and the probability that it has a mass of exactly 175175 g.

Solution. The intervals 180180–190190 and 190190–200200 hold 9+3=129 + 3 = 12 apples:

P(m≥180)≈1250=0.24P(m \ge 180) \approx \frac{12}{50} = 0.24

Mass is continuous, so the probability of any single exact value is 00: P(m=175)=0P(m = 175) = 0. (An apple recorded as ”175175 g” really has a mass somewhere from 174.5174.5 g to 175.5175.5 g, which is a range, not a single value.)

Example 4: Probability as the area of a rectangle

Section titled “Example 4: Probability as the area of a rectangle”

A subway train arrives every 1212 minutes. If you show up at a random time, your waiting time XX is equally likely to be anywhere from 00 to 1212 minutes. This is a continuous uniform distribution. Find P(3≤X≤7)P(3 \le X \le 7).

Solution. The density “curve” is a flat line. The total area must be 11, and the base is 1212, so the height is 112\dfrac{1}{12}.

A uniform distribution for waiting time from 0 to 12 minutes, drawn as a rectangle of height 1/12. The region from 3 to 7 minutes is shaded and has area 4/12. 1 2 3 4 5 6 7 8 9 10 11 12 13 1/12 0 area = 4/12 waiting time (min)
The waiting-time model. The shaded area is P(3≤X≤7)P(3 \le X \le 7).

The probability is the area of the shaded rectangle:

P(3≤X≤7)=(7−3)×112=412=13≈0.3333P(3 \le X \le 7) = (7 - 3) \times \frac{1}{12} = \frac{4}{12} = \frac{1}{3} \approx 0.3333

Calling something discrete because the data were rounded. Heights recorded to the nearest centimetre look like whole numbers, but height itself is continuous. Ask what’s being measured, not how it was written down.

Leaving gaps between histogram bars. For continuous data, the intervals touch (150150–160160, 160160–170170, …), so the bars touch too. Gaps are for bar graphs of discrete or categorical data.

Putting a boundary value in two intervals. Decide which end each interval includes (usually the left) and stick to it. With 160≤m<170160 \le m \lt 170, a mass of exactly 170170 g goes in the next interval.

Forgetting the zero points on a frequency polygon. The polygon should start and end on the horizontal axis, at the midpoints of the empty intervals just outside the data.

Giving a non-zero probability for a single value. For a continuous variable, P(X=a)=0P(X = a) = 0. Probabilities only come from ranges, as areas.

1. (Warm-up) Is each random variable discrete or continuous?

  • (a) the mass of a newborn baby
  • (b) the number of texts you get in a day
  • (c) the temperature of a cup of tea
  • (d) the number of red cars that pass in an hour
Solution

(a) Continuous. (b) Discrete. (c) Continuous. (d) Discrete.

2. (Warm-up) A student’s height is recorded as 164164 cm, to the nearest centimetre. What range of actual heights could this be? Why is P(height=164 cm exactly)=0P(\text{height} = 164 \text{ cm exactly}) = 0?

Solution

Any height from 163.5163.5 cm up to (but not including) 164.5164.5 cm rounds to 164164 cm.

Height is continuous, so a single exact value has no width and its area under the density curve is 00. Only a range like 163.5≤h<164.5163.5 \le h \lt 164.5 has a non-zero probability.

3. (Warm-up) Using the apple table, estimate the probability that a randomly chosen apple has a mass less than 160160 g.

Solution

3+8=113 + 8 = 11 apples are under 160160 g:

P(m<160)≈1150=0.22P(m \lt 160) \approx \frac{11}{50} = 0.22

4. (Core) Sixteen reaction times, in seconds, were measured in a science class:

0.31, 0.27, 0.35, 0.22, 0.29, 0.41, 0.33, 0.26,0.31,\ 0.27,\ 0.35,\ 0.22,\ 0.29,\ 0.41,\ 0.33,\ 0.26, 0.30, 0.38, 0.24, 0.34, 0.28, 0.36, 0.32, 0.290.30,\ 0.38,\ 0.24,\ 0.34,\ 0.28,\ 0.36,\ 0.32,\ 0.29

  • (a) Make a frequency table with intervals of width 0.050.05 s, starting at 0.200.20 s.
  • (b) Which interval(s) have the highest frequency?
  • (c) Estimate the probability that a reaction time is under 0.300.30 s.
Solution

(a)

Time (s)0.200.20–0.250.250.250.25–0.300.300.300.30–0.350.350.350.35–0.400.400.400.40–0.450.45
Frequency2255553311

Check: 2+5+5+3+1=162 + 5 + 5 + 3 + 1 = 16. ✓ (Remember 0.300.30 goes in 0.300.30–0.350.35 and 0.350.35 goes in 0.350.35–0.400.40.)

(b) 0.250.25–0.300.30 and 0.300.30–0.350.35 are tied, with 55 each.

(c) 2+5=72 + 5 = 7 times are under 0.300.30 s: P≈716=0.4375P \approx \tfrac{7}{16} = 0.4375.

5. (Core) List the points you would plot for the frequency polygon of the commute times in Example 2.

Solution

Plot (midpoint, frequency), including a 00 at each end:

(2.5,0), (7.5,2), (12.5,4), (17.5,8), (22.5,4), (27.5,2), (32.5,0)(2.5, 0),\ (7.5, 2),\ (12.5, 4),\ (17.5, 8),\ (22.5, 4),\ (27.5, 2),\ (32.5, 0)

6. (Core) A ferry leaves every 3030 minutes, and you arrive at a random time. Your waiting time XX is uniform from 00 to 3030 minutes. Find:

  • (a) P(X<10)P(X \lt 10)
  • (b) P(12≤X≤20)P(12 \le X \le 20)
  • (c) P(X=15)P(X = 15)
Solution

The height of the rectangle is 130\tfrac{1}{30}, so each probability is (width) ×130\times \tfrac{1}{30}.

(a) P(X<10)=10×130=13≈0.3333P(X \lt 10) = 10 \times \tfrac{1}{30} = \tfrac{1}{3} \approx 0.3333

(b) P(12≤X≤20)=8×130=415≈0.2667P(12 \le X \le 20) = 8 \times \tfrac{1}{30} = \tfrac{4}{15} \approx 0.2667

(c) P(X=15)=0P(X = 15) = 0: a single value has no width.

7. (Core) A biologist weighs 4040 trout from one lake and finds an average mass of 612612 g. A classmate weighs 4040 different trout from the same lake and gets 598598 g. Give two reasons the results differ, and explain why statisticians describe trout masses with a model instead of an exact distribution.

Solution

Sampling: they weighed different fish, and each sample of 4040 is only part of the population, so random variation between samples is expected.

Measurement uncertainty: each scale rounds, may be calibrated slightly differently, and a wet, wriggling fish is hard to weigh precisely.

Because you can never weigh every fish exactly, the true distribution can’t be known perfectly. A model (a smooth curve with a few parameters, like a mean and standard deviation) describes the data well and can be used to make predictions.

8. (Challenge) Regroup the apple data into intervals of width 2020 g: 140140–160160, 160160–180180, 180180–200200. What is lost compared with the 1010 g intervals? What might happen if you used 22 g intervals instead?

Solution

The new frequencies are 3+8=113 + 8 = 11, 14+13=2714 + 13 = 27, and 9+3=129 + 3 = 12.

With only three bars, you can still see that the middle is most common, but you lose detail. For example, you can no longer see that 160160–170170 is slightly more common than 170170–180180, or how quickly the frequencies drop off at the ends.

With 22 g intervals, there would be 3030 intervals for only 5050 apples, so most would hold 00, 11, or 22 apples. The histogram would look jagged, and random ups and downs would hide the overall shape.

9. (Challenge) A continuous random variable XX takes values from 00 to 44. Its density curve is a triangle: it rises in a straight line from height 00 at x=0x = 0 to a peak at x=2x = 2, then falls back to 00 at x=4x = 4.

  • (a) Find the height of the peak.
  • (b) Find P(X<1)P(X \lt 1).
Solution

(a) The total area must be 11. The triangle has base 44, so 12(4)(h)=1\tfrac{1}{2}(4)(h) = 1, giving h=0.5h = 0.5.

(b) From 00 to 22 the height rises from 00 to 0.50.5, so at x=1x = 1 the height is 0.250.25. The region from 00 to 11 is a small triangle:

P(X<1)=12(1)(0.25)=0.125P(X \lt 1) = \frac{1}{2}(1)(0.25) = 0.125