# Difference between discrete and continuous variable?

#### MarcosUve

What is the difference between discrete and continuous variable? Any advice?

#### DarnItJimImAnEngineer

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.)

• Greens and greg1313

#### greg1313

Forum Staff
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.)

• Greens

#### MarcosUve

Thank you, Guys! This is what I need.

• greg1313

#### MarcosUve

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.)
By the way, I found a strong article about Difference Between Discrete and Continuous Variable | Differencebtwn and now completely agree with you.