Learn
Discrete Random Variables

Random variables with a countable number of possible values are called discrete random variables. For example, rolling a regular 6-sided die would be considered a discrete random variable because the outcome options are limited to the numbers on the die.

Discrete random variables are also common when observing counting events, such as how many people entered a store on a randomly selected day. In this case, the values are countable in that they are limited to whole numbers (you can’t observe half of a person).

Continuous Random Variables

When the possible values of a random variable are uncountable, it is called a continuous random variable. These are generally measurement variables and are uncountable because measurements can always be more precise – meters, centimeters, millimeters, etc.

For example, the temperature in Los Angeles on a randomly chosen day is a continuous random variable. We can always be more precise about the temperature by expanding to another decimal place (96 degrees, 96.44 degrees, 96.437 degrees, etc.).

Instructions

1.

Suppose you have a random variable that represents the time it takes a randomly selected person to run a mile. Is this variable discrete or continuous? In script.py, set the value of mile_time to 'discrete' or 'continuous' to answer.

2.

Suppose you have a random variable that represents the individual pieces of candy a randomly selected child receives on a candy-giving holiday. Is this variable discrete or continuous? In script.py, set the value of candy to 'discrete' or 'continuous' to answer.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?