Discrete variable
A discrete variable is a variable which can only take on a finite number of values. There’s a limited number of possible values that the variable can take on.
Importantly, there are gaps between the possible values of a discrete variable. (if it’s a number) For example, if we have a variable which can only take on the values 1, 2, and 3, then it cannot take on the value 1.5, or 2.7, or any other value between 1 and 3 - they’re gaps.
Discrete vs continuous variables
Continuous variables are the opposite: they can represent any value, sometimes within a certain range. For example, a continuous variable could represent any value between 0 and 1, including 0.5, 0.25, 0.75, etc. There are no gaps between the possible values of a continuous variable, either. There are actually infinite possible values that a continuous variable can take.
Discrete variables have a limited number of possible values they can take.
Discrete vs categorical variables
Categorical variables are also different from discrete variables. Categorical variables represent categories or groups, and they don’t have a natural order. For example, the variable “colour” could be a categorical variable with categories like “red”, “green”, and “blue”.
We can sometimes call these ‘qualitative’ measures. They’re different from discrete.
Examples
- The number of people in a room is a discrete variable, because it can only take on whole number values (0, 1, 2, 3, etc.). It can’t be fractional values like 1.5 or 2.7.
- The result of a dice roll is a discrete variable, because it can only take on specific values (usually 1, 2, 3, 4, 5, or 6). It can’t be a value in between those numbers.
flashcards
| Question | Answer |
|---|---|
| What is a discrete variable? | A variable that can only take on a finite number of values, with gaps between possible values. |
| What is the difference between a discrete variable and a continuous variable? | A discrete variable has gaps between possible values and a limited number of them; a continuous variable can represent any value (often within a range) with no gaps and infinite possible values. |
| What is the difference between a discrete variable and a categorical variable? | A discrete variable has a limited number of numerical values; a categorical variable represents categories or groups with no natural order (qualitative measures). |
| Give an example of a discrete variable. | The number of people in a room (can only be whole numbers like 0, 1, 2… not 1.5). |
| Give another example of a discrete variable. | The result of a dice roll (can only be 1, 2, 3, 4, 5, or 6, not a value in between). |