Random Variable
- Represents numeric outcomes produced by a random process.
- Comes in two main types: discrete (finite or countably infinite values) and continuous (uncountably many values over ranges).
- Described by a probability mass function (PMF) for discrete variables and a probability density function (PDF) / cumulative distribution function (CDF) for continuous variables.
Definition
Section titled “Definition”A random variable is a variable that takes on different values depending on the outcome of a random event; in other words, it is a variable whose value is determined by chance.
Explanation
Section titled “Explanation”Random variables map outcomes of random events to numerical values. There are two main categories:
-
Discrete random variables can assume a finite or countably infinite set of distinct values. Their probability distribution is given by a probability mass function (PMF), which assigns a probability to each possible value.
-
Continuous random variables can take on an infinite (uncountable) number of values within a range. Their distribution is described by a probability density function (PDF). The PDF is the derivative of the cumulative distribution function (CDF). For continuous variables, the probability of any single exact value is 0; probabilities are defined over intervals using the PDF (or the CDF).
Examples
Section titled “Examples”Discrete example
Section titled “Discrete example”Consider the random variable X that represents the number of heads that come up when flipping a coin. The possible values of X are 0, 1, or 2, and the probability of each value occurring is 0.5, 0.5, and 0, respectively. This can be written as:
Continuous example
Section titled “Continuous example”Consider the random variable Y that represents the weight of an object. The possible values of Y are any value within a certain range, such as 0 to 100 pounds. The probability of a specific value occurring is 0, since there are an infinite number of values within the range. The probability of Y falling within an interval (for example, 25 to 50 pounds) can be calculated using a PDF.
An example PDF given for a continuous variable is:
Notes or pitfalls
Section titled “Notes or pitfalls”- For continuous random variables, the probability of any specific exact value is 0 because there are infinitely many possible values within the range; probabilities are meaningful only for intervals.
Related terms
Section titled “Related terms”- Probability mass function (PMF)
- Probability density function (PDF)
- Cumulative distribution function (CDF)
- Discrete random variable
- Continuous random variable