Math glossary

Discrete vs. Continuous Variables: Differences and Examples

Distinguish discrete and continuous variables even when measurements are rounded. Compare data types, graphs, and six practical examples.

TL;DR

A discrete variable has separate, countable possible values. A continuous variable can vary over an interval. Counted books are discrete. A person’s height is continuous even when a table rounds it to whole centimetres.

Key Points

  • To classify a variable, ask what it can represent before data are rounded.
  • Discrete values can include fractions if the allowed choices come in steps.
  • A continuous variable can have a limited range.
  • Numerical codes can label categories without measuring a quantity.
  • Data type affects how you graph observations and calculate probabilities.

What is a discrete variable?

A discrete quantitative variable has a finite or countably infinite set of possible values. A classroom’s attendance count can be 0,1,2,…0,1,2,\dots up to its capacity. No value between 24 and 25 represents its exact count. Countability here means the allowed values can be listed systematically, possibly without an end.

Discrete variables can have noninteger values. If a classroom instrument allows only masses of 0,0.5,1.0,1.50,0.5,1.0,1.5 grams and so on, its readings are discrete because the values are fixed in half-gram steps. List the allowed readings rather than checking only whether the values are written with decimal points. OpenStax, Introductory Statistics Key Terms

What is a continuous variable?

A continuous quantitative variable can take values across an interval in the mathematical model. For example, a length might be 12.1 centimetres, 12.11 centimetres, or any value in between. A ruler places a limit on what you can record, but the length itself can be modelled continuously.

A continuous variable does not need to run from negative to positive infinity. The length of a leaf may range from 2 to 14 centimetres in a study. The key is that its model allows any value in the interval. OpenStax, Data, Sampling, and Variation in Data and Sampling

One number line marks four discrete integer points, and another marks a continuous length interval
Four allowed counts are individual points. Every location in the marked length interval is possible in the continuous model.

How do you tell the two types apart when rounding matters?

Write down exactly which quantity is recorded. “Age measured from birth” can vary continuously. “Age in completed years” changes in whole-number steps. “Age group,” such as 0–9 or 10–19, is an ordered category. The three descriptions come from the same underlying idea and make different statements about what the variable represents.

Variable Type Reason
Number of emails sent Discrete The allowed counts are whole numbers
Physical duration of a call Continuous It can vary within any given second
Duration billed in whole minutes Discrete The billing rule allows only integer values
Shoe size in half-size steps Discrete The label uses a fixed set of choices
Favourite subject coded 1, 2, or 3 Categorical The numbers are labels for subjects

A coded subject such as 3 does not count three units of a quantity. Categorical variables can be ordered or unordered. See the frequency table guide for how to display category counts and percentages.

Why does the distinction matter for graphs and probability?

Discrete counts with few possible values often work well in dot plots or separated bars. Grouped continuous measurements often work well in a histogram because the bins cover intervals. Histograms can also display discrete data with many values when suitable bins are chosen.

A discrete random variable can assign positive probability to one exact value. For example, a fair die gives P(X=3)=1/6P(X=3)=1/6. For a continuous model with a probability density, any single point has zero probability and an interval can have positive probability. A device may display an exact rounded value with positive probability because the display represents an interval of underlying measurements. OpenStax, Probability Distribution Function for a Discrete Random Variable

Six Worked Discrete and Continuous Examples

Example 1

Classify the number of players at practice.

  1. The value counts people.
  2. Counts such as 8 and 9 are possible, while 8.5 players is excluded.
  3. The variable is discrete.

Example 2

Classify a cyclist’s travel time before rounding.

  1. A stopwatch might record a whole number of seconds.
  2. The time itself can be anywhere between adjacent displayed readings.
  3. Model elapsed travel time as continuous.

Example 3

A wallet app records balances only in cents. Classify the stored balance.

  1. Each stored amount is an integer number of cents.
  2. A step from 200 to 201 cents has no intermediate allowed stored value.
  3. The stored balance is discrete.

Example 4

A thermometer rounds to the nearest 0.1∘C0.1^\circ\text{C}. Classify the temperature and the display.

  1. The underlying temperature can be modelled continuously.
  2. The display only uses a set of separate readings such as 18.1 and 18.2.
  3. The rounded display is discrete, though it records a continuous quantity.

Example 5

Classify the total rolled on two ordinary dice.

  1. Each die has discrete integer outcomes from 1 to 6.
  2. The possible sums are integers from 2 to 12.
  3. The total is discrete. It is possible to list all its allowed values.

Example 6

A survey codes bus as 1, walk as 2, and car as 3. Classify the recorded variable.

  1. The numbers name travel modes.
  2. Car does not represent three times as much travel mode as bus.
  3. The variable is categorical. The frequency of each category is a separate, discrete count.

Common Variable-Type Mistakes

Mistake 1: Calling every decimal-valued variable continuous

Ask whether there are fixed gaps in the allowed values. A half-size scale can be discrete.

Mistake 2: Calling a measured quantity discrete because the instrument rounds it

Keep the continuous quantity and the discrete display separate.

Mistake 3: Treating a numeric category code as a measurement

Read the codebook or labels. Codes do not give meaningful sums or differences between categories.

Try It Yourself

  1. Classify the number of text messages sent in one day.
  2. Classify the amount of rain that fell before rounding.
  3. Classify the reading from a ruler that records only whole millimetres.

Answers. 1. Discrete. 2. Continuous as a physical measurement. 3. The reading is discrete, although the length being measured can be modelled continuously.

Conclusion

  • Write down which quantity is counted, measured, or labelled.
  • Decide whether the allowed numeric values are separate points or span an interval.
  • Keep the underlying quantity and the recording precision distinct.

Read More

Research Behind This Article

  1. OpenStax, Introductory Statistics 2e: Data, Sampling, and Variation in Data and Sampling. OpenStax
  2. OpenStax, Introductory Statistics 2e: Chapter 1 Key Terms. OpenStax
  3. OpenStax, Statistics: Probability Distribution Function for a Discrete Random Variable. OpenStax
  4. OpenStax, Introductory Statistics 2e: Frequency Tables and Levels of Measurement. OpenStax