Difference between discrete and continuous variable?

Nov 2019
4
2
Austria
What is the difference between discrete and continuous variable? Any advice?
 
Jun 2019
445
237
USA
A continuous variable can take on any value (at least within a certain range). A discrete variable can only take on certain values.

For example, time is a continuous variable. You can have an elapsed time of 1.0 s, or 1.1 s, or 1.001 s, or 1.0000234 s, or 1.000000001 s, or any real number.
Now, let's say you want to measure the high temperature of the day for two weeks. The high temperature only occurs once per day. Your time values will be day 1, day 2, day 3, day 4, etc..

Electric charge is another example of a discrete variable. At macroscale values, it seems like a continuous variable. If you look at charged particles, however, you will see that the charge can only be 0, +1, +2, +3, -1, -2, -3, etc. times the charge of one electron. You can't have, say 1/4 of an electron's charge.

Number of people in a building during the day is another discrete variable. The time here is a continuous variable (people can enter or leave at any time), but the number of people will always be an integer. You can't have half of a person. (Well, you can, but let's hope not.)
 
  • Like
Reactions: Greens and greg1313

greg1313

Forum Staff
Oct 2008
7,986
1,165
London, Ontario, Canada - The Forest City
Some further examples:

Discrete variable: \(\displaystyle n|n\in\mathbb{N}\)
Continuous variable: \(\displaystyle x|x\in\mathbb{R}\)

(Read, for example, " \(\displaystyle n\) such that \(\displaystyle n\) is in the set of natural numbers"; \(\displaystyle \mathbb{R}\) represents the set of real numbers.)
 
  • Like
Reactions: Greens
Nov 2019
4
2
Austria