Grade by Grade
B. Probability Distributions · Continuous Distributions and the Normal Distribution

Discrete and Continuous Random Variables

B2.1About 65 minutes
Learning goals
  • I can explain the difference between a discrete and a continuous random variable.
  • I can classify a variable as discrete or continuous and justify my choice.
  • I can tell a discrete frequency distribution (from counting) apart from a continuous frequency distribution (from measuring).
  • I can state the interval of true values that a rounded measurement stands for.

Words to know

random variable
A variable whose value is a numerical outcome of a random experiment, such as the number of heads in 3 tosses or the mass of a randomly chosen apple.
discrete random variable
A random variable that can take only separate, countable values (often whole numbers), such as 0, 1, 2, 3. Its values come from counting.
continuous random variable
A random variable that can take any value in an interval of real numbers, so it has infinitely many possible values between any two values. Its values come from measuring.
continuous sample space
A sample space that is an interval (or several intervals) of real numbers, such as all times between 0 and 60 minutes.
frequency distribution
A table or graph that shows how often each value (or each interval of values) occurred.
class interval
One of the equal-width intervals, such as 5 to 6 minutes, used to group continuous data.

How tall are you, exactly?

Ask a friend how tall they are and they might say 172 cm. But that is not exactly their height. A better ruler might give 172.3 cm, a laser might give 172.31 cm, and so on forever. Height is a quantity you measure, and a measurement can land anywhere on a scale.

Now ask how many siblings they have. The answer is 0, 1, 2, 3 ... and nothing in between. Nobody has 1.37 siblings. That is a quantity you count.

This lesson is about that difference. It is the doorway to the whole unit.

Remember: random variables

In the unit Discrete Probability Distributions you met random variables: a rule that gives a number to each outcome of an experiment. If you toss three coins and let X be the number of heads, then X can be 0, 1, 2 or 3. You listed every value with its probability in a probability distribution table, and the probabilities added to 1.

That X is discrete. You can list its values, and there are gaps between them.

A continuous random variable is different. It can take any value in an interval. Let T be the time a randomly chosen student takes to run 1 km. T could be 6 minutes, 6.5 minutes, 6.55 minutes or 6.5512 minutes. Its sample space is a whole interval, for example all real numbers from 3 to 12 minutes. That is a continuous sample space.

Discrete random variableContinuous random variable
Comes fromcountingmeasuring
Possible valuesseparate values you can list: 0, 1, 2, ...every real number in an interval
Between two valuesthere may be no possible value (nothing between 2 and 3 heads)there are always infinitely many more values
Examplesnumber of heads, goals in a hockey game, defective bulbs in a box, people in a cartime, mass, length, temperature, volume, speed
Typical graphbar graph or probability histogram (one bar per value)histogram of class intervals, with bars that touch
Discrete and continuous random variables side by side.
676.56.66.556.56
Between 6 and 7 there are values like 6.5. Between 6.5 and 6.6 there are values like 6.55. Zoom in as far as you like and there are still more values. A continuous variable can take any of them.

Discrete and continuous frequency distributions

When you collect data, you organize it in a frequency distribution.

  • A discrete frequency distribution comes from counting outcomes. Each possible value gets its own row (or bar). Example: toss three coins 80 times and count how often you get 0, 1, 2 or 3 heads.
  • A continuous frequency distribution comes from measuring. There are too many possible values to list, so you group the data into class intervals of equal width. Example: the times of 40 students on a 1 km run, grouped into 4 to 5 min, 5 to 6 min, and so on.

On a graph you can see the difference. The discrete graph has a separate bar for each value, with gaps. The continuous histogram has bars that touch, because the intervals cover the whole number line with no gaps.

0102030frequency0123number of heads (3 coins)Discrete: counted051015frequency456789time to run 1 km (min)Continuous: measured
Left: 80 tosses of three coins. Each count (0, 1, 2 or 3 heads) has its own bar, with gaps between. Right: 1 km run times for 40 students, grouped into 1-minute intervals. The bars touch because every time between 4 and 9 minutes belongs to some interval.
Number of heads0123Total
Frequency931291180
Discrete frequency distribution: three coins tossed 80 times.
Time (min)4 to 55 to 66 to 77 to 88 to 9Total
Frequency391410440
Continuous frequency distribution: 1 km run times for 40 students. An interval such as "5 to 6" means 5 ≤ t < 6, so a time of exactly 6.0 min goes in the next interval.

Rounded measurements are still continuous

Real data always look a little bit discrete, because we round measurements. If a ruler measures to the nearest 0.1 cm, every recorded length ends in one decimal place. But the variable itself is still continuous.

A recorded value stands for an interval of true values:

  • "23.4 cm to the nearest 0.1 cm" means 23.35 ≤ L < 23.45.
  • "172 cm to the nearest centimetre" means 171.5 ≤ h < 172.5.

The rule: go half a unit of the measuring precision below and above the recorded value.

23.323.3523.423.4523.5all recorded as 23.4
Every true length from 23.35 cm up to (but not including) 23.45 cm is recorded as 23.4 cm when we round to the nearest 0.1 cm.
Worked example

Example 1: Discrete or continuous?

Classify each random variable as discrete or continuous. Explain.

  1. The number of snow days at a school in January.
  2. The mass of a randomly chosen bag of apples at an orchard in Norfolk County.
  3. A student's mark on a test, recorded as a whole-number percent.
  4. The amount of maple sap (in litres) collected from one tree in a day.
  1. Snow days are counted: 0, 1, 2, ... There is no value between 2 and 3 days. Discrete.
  2. Mass is measured. A bag could weigh 2.31 kg or 2.314 kg. Continuous.
  3. Test marks are counted (points earned out of a total, then turned into whole-number percents). The possible values can be listed: 0, 1, ..., 100. Discrete.
  4. Volume of sap is measured and can be any value in an interval. Continuous.

Discrete: 1 and 3. Continuous: 2 and 4. Ask yourself: did I count it or measure it?

Worked example

Example 2: A discrete probability distribution, then a continuous question

Let X be the number of heads when three fair coins are tossed. (a) Write the probability distribution of X. (b) Compare it with the 80-toss frequency table above. (c) Explain why you cannot make a similar table for T, the time to run 1 km.

  1. (a) There are 2³ = 8 equally likely outcomes. One has 0 heads (TTT), three have 1 head, three have 2 heads, one has 3 heads. So P(0) = 1/8, P(1) = 3/8, P(2) = 3/8, P(3) = 1/8. They add to 8/8 = 1.
  2. (b) Expected frequencies in 80 tosses are 80 × 1/8 = 10, 80 × 3/8 = 30, 30 and 10. The observed 9, 31, 29, 11 are close to these, as you would expect from a random experiment.
  3. (c) T can be any real number in an interval, so there are infinitely many values and you cannot list them in a table. Even worse, the chance of any one exact time, such as exactly 6.000... minutes, is essentially zero. For continuous variables we must group values into intervals (and, later in this unit, use a mathematical model such as the normal curve).

(a) 1/8, 3/8, 3/8, 1/8. (b) Close to the expected 10, 30, 30, 10. (c) T has infinitely many possible values, so we work with intervals instead of single values.

Worked example

Example 3: The interval behind a measurement

A weather station records the temperature as −7.5°C, rounded to the nearest 0.5°C. A kitchen scale shows 250 g, rounded to the nearest gram. Write the interval of true values each reading stands for.

  1. The precision of the thermometer is 0.5°C. Half of that is 0.25°C.
  2. True temperature: −7.5 − 0.25 = −7.75 and −7.5 + 0.25 = −7.25. So −7.75 ≤ T < −7.25.
  3. The scale's precision is 1 g. Half of that is 0.5 g. So 249.5 ≤ m < 250.5.

−7.75°C ≤ T < −7.25°C and 249.5 g ≤ m < 250.5 g.

Watch out: values that look discrete

Shoe size and age in years are recorded as separate values, but they come from different places. Foot length is continuous; shoe size is a discrete label (sizes come in half steps). Age is really continuous (time since birth), but "age in completed years" is a discrete count. When you classify a variable, classify the way it is recorded, and say so.

Just for fun

A continuous random variable walks into a bakery. The baker asks, "Exactly how much flour do you want?" It is still answering.

Hands-on activity

Count it, then time it

You need: 3 coins, a phone or watch with a stopwatch, a pencil and paper.

  1. Discrete part. Toss the 3 coins 40 times. Each time, record the number of heads (0, 1, 2 or 3). Make a frequency table and a bar graph with gaps between bars. Compare with the expected frequencies 5, 15, 15, 5.
  2. Continuous part. Ask a family member to time you saying the alphabet out loud as fast as you can, 20 times (take turns if you like). Record each time to the nearest 0.1 s.
  3. Look at your 20 times. How many different values did you get? Could two times be truly equal if you had a perfect stopwatch?
  4. Group the times into intervals of 0.5 s (for example 3.0 to 3.5 s, 3.5 to 4.0 s) and draw a histogram with touching bars.

What to look for: the coin data can only be 0, 1, 2 or 3. The times are spread over an interval and many are different. Your stopwatch rounds, so a time shown as 3.4 s really means 3.35 ≤ t < 3.45. Keep your times: you will use them again in the next two lessons.

Your turn

1

Discrete or continuous: the number of maple trees in a city park?

2

Discrete or continuous: the time it takes to shovel a driveway after a snowstorm?

3

Discrete or continuous: the number of goals scored in a hockey game?

4

Discrete or continuous: the temperature in Thunder Bay at noon on a day in February?

5

A pumpkin's mass is recorded as 4.6 kg, to the nearest 0.1 kg. What interval of true masses does this represent?

6

Give one example of a discrete frequency distribution and one of a continuous frequency distribution from your own life.

7

Why do the bars of a histogram for continuous data touch?

More practice: warm-up

1

Do we get discrete data by counting or by measuring?

2

Discrete or continuous: the volume of milk in a 4 L bag?

3

Discrete or continuous: the number of students absent today?

4

Discrete or continuous: a runner's speed in km/h?

5

A length is recorded as 12 cm to the nearest centimetre. What is the smallest true length it could be?

More practice: on your own

1

A random variable X is the number of red cards in a 5-card hand. List its possible values. Is X discrete or continuous?

2

A random variable Y is the length of a randomly chosen icicle on a roof, in centimetres. Describe a possible sample space for Y. Is it discrete or continuous?

3

A family's yearly hydro bill is recorded to the nearest cent. Is the bill discrete or continuous? Explain.

4

A swimmer's time is recorded as 58.27 s to the nearest hundredth. Write the interval of true times.

5

In the run-time table above, how many students ran 1 km in under 6 minutes? What fraction of the class is that?

Challenge

1

Explain why, for a continuous random variable, there is always another possible value between any two possible values a and b.

2

Two scales weigh the same parcel. Scale A shows 2 kg (nearest kg). Scale B shows 2.00 kg (nearest 0.01 kg). Give the interval for each, and explain why neither scale turns mass into a discrete variable.

3

In 80 tosses of three coins, the frequencies of 0, 1, 2 and 3 heads were 9, 31, 29 and 11. Find the experimental mean number of heads and compare it with the expected value E(X) = 1.5 from the unit Discrete Probability Distributions.

Check your understanding

Quiz

1.

Which random variable is continuous?

2.

Which statement about a discrete random variable is true?

3.

A mass is recorded as 3.7 kg to the nearest 0.1 kg. Which interval contains the true mass?

4.

Why do bars touch in a histogram of continuous data?

5.

Toss three fair coins. What is P(X = 2), where X is the number of heads?

6.

Which is an example of a continuous frequency distribution?

For parents and teachers

Big idea (B2.1): a discrete random variable comes from counting (0, 1, 2, ...); a continuous random variable comes from measuring and can take any value in an interval. This unit is all about the continuous kind, ending with the normal distribution.

How to help: Play "count or measure?". Point at things around the house (eggs in the fridge, the temperature outside, the length of a scarf, the number of unread emails) and ask your teen to say discrete or continuous and why. Then ask: "If the recipe says 250 g of flour, what range of true masses would your scale accept?"

Common difficulties:

  • Thinking that rounded data are discrete. A length recorded to the nearest millimetre is still a continuous variable.
  • Confusing the label with the quantity: shoe size is discrete, foot length is continuous.
  • Forgetting the "half a unit" rule when writing the interval behind a measurement.
  • Leaving gaps between histogram bars for continuous data (gaps belong to bar graphs of discrete values).