Contents
Discrete and Continuous Random Variables
A random variable is a number that depends on the outcome of a random process. Instead of describing outcomes in words, it assigns each outcome a numerical value, allowing calculations.
Discrete Random Variable
A discrete random variable takes countable values, usually whole numbers. The number of orders placed in an hour, or the number of heads in three coin flips, are both discrete.
Its probabilities are listed in a probability mass function (PMF), where each possible value has its own probability, and all probabilities add up to 1.
Continuous Random Variable
A continuous random variable can take any value within a range, such as delivery time or a person’s height. Because there are infinitely many possible values, the probability of landing on one exact value is 0.
Instead, we measure probability over an interval using the area under a curve called the probability density function (PDF).
Feature | Discrete | Continuous |
| Values | Countable | Any value in a range |
| Described by | PMF | |
| Probability of one exact value | Can be above 0 | Always 0 |
| Probability of a range | Add the probabilities | Find the area under the curve |
Example: Let X be the number of heads in two fair coin flips. The outcomes HH, HT, TH, TT are equally likely, so P(X = 0) = 1/4, P(X = 1) = 2/4 and P(X = 2) = 1/4. These add up to 1, which is the check every valid PMF must pass.
Probability and Statistics for Data Science
Abhishek Pati








