Discrete Structures

What Is Discrete Data? Definition and Examples

Discrete data is countable data, such as the number of students in a class. Learn how it differs from continuous data, with clear examples for each.

On this page
  1. Short answer
  2. Examples of discrete data
  3. Continuous data for contrast
  4. A quick test: is it countable?
  5. Edge cases
  6. Discrete data versus discrete mathematics
  7. Where the idea shows up in programming
  8. Summary

Short answer

Discrete data is data made of separate, countable values. You can list the possible values one by one, and there are gaps between them. The number of students in a class is discrete: it can be 24 or 25, but not 24.5.

Examples of discrete data

  • The number of students enrolled in a course
  • The number of cars passing a checkpoint in an hour
  • The number of defective items in a batch
  • The number of children in a household
  • Shoe sizes on a fixed scale

Each of these is a count or a choice from a fixed set of values.

Continuous data for contrast

Continuous data can take any value within a range. Height, weight, time and temperature are common examples. In principle, there are infinitely many possible values between any two heights, so continuous data is usually measured rather than counted. In practice, measurements are rounded to a chosen precision.

A quick test: is it countable?

Ask whether you could count the possible values as separate items. The number of goals scored in a match is discrete, because the results are whole numbers with gaps between them. A person’s height is continuous, because it can be measured more precisely and falls along a range.

Another test is whether a value could sensibly be split further. Two students cannot be divided into halves, but a height of 170 centimeters could be measured as 170.5.

Edge cases

Some data needs more care:

  • Ratings on a small scale, such as 1 to 5 stars, are discrete because only five values are possible. Whether the values have a meaningful order affects which analysis methods make sense.
  • Categories without numbers, such as colors or car models, are not quantitative. They are usually called categorical data, even though their values are also separate.

Discrete data versus discrete mathematics

Both uses of the word “discrete” refer to separate, distinct pieces. Discrete data is a statistics term for countable values. Discrete mathematics is a broader field covering sets, logic, graphs and counting, and it is widely used in computer science. The two share a root idea but are separate topics.

Where the idea shows up in programming

Programming languages make a similar split. Whole-number types such as integers hold discrete values. Decimal types, such as floating-point numbers, store a finite set of approximate values, which makes them a practical stand-in for continuous quantities. How a language represents these kinds of values is part of primitive vs non primitive data types, which covers the different categories of values a language provides.

Summary

Discrete data is countable, with separate values. Continuous data is measured across a range. When you are unsure which one you have, ask whether you could count the possible values.

The complete guide to discrete structures

What Is Discrete Structures in Computer Science?
Read the guide

Keep exploring

Guides from other topics

All topics →