Definition of Random Variable
A random variable is the object that lets probability theory talk about data numerically. It turns outcomes in a sample space into numbers, so that probabilities can be described with distributions, expectations, variances, and other statistical tools.
A random variable is a variable whose possible values are numerical outcomes of a random phenomenon. There are two main types of random variables: discrete and continuous.
-
Discrete Random Variables: These are random variables that can take on a countable number of values. For example, the number of heads in 10 coin flips is a discrete random variable.
-
Continuous Random Variables: These are random variables that can take on an infinite number of values within a given range. For example, the time it takes for a computer to solve a problem is a continuous random variable.
Formally, a random variable is a measurable function that maps outcomes of a random process to real numbers. This mapping allows us to assign probabilities to different outcomes and analyze them statistically using existing mathematical tools.
Let be the sample space of a random process, and let be a random variable. The function assigns a real number to each outcome in . The probability distribution of a random variable describes how the probabilities are distributed over the possible values of the random variable.
Probability Functions
For discrete random variables, we use the Probability Mass Function (PMF):
Properties:
- for all
For continuous random variables, we use the Probability Density Function (PDF):
Properties:
- for all
Cumulative Distribution Function (CDF)
The CDF is defined for both discrete and continuous random variables:
For discrete:
For continuous:
In summary, random variables are functions that map outcomes of random processes(sample space) to real numbers, allowing us to analyze and quantify the behavior of random phenomena.
A more rigorous definition is possible by introducing measurement and probability space, you may access here optionally: Random Variable - stackexchange.
For more details on expectation and variance calculations, see Expectation and Variance.
Some Examples
Below are some examples of random variables in different contexts: discrete, continuous, and mixed.
Discrete Random Variable
Consider a simple example of rolling a fair six-sided die. The sample space consists of the outcomes . We can define a random variable that maps each outcome to its value. For example, if we roll a die and get a 3, then . The probability distribution of this random variable is uniform, meaning each outcome has an equal probability of .
PMF: for
For detailed calculations of expected value and variance, see Expectation and Variance.
Continuous Random Variable
Consider a continuous random variable that represents the amount of rainfall in a city over a month. The sample space could be the set of all non-negative real numbers, representing the amount of rainfall in millimeters. We can define a random variable that maps each outcome to the amount of rainfall. For example, if we measure 50 mm of rainfall in a month, then . The probability distribution of this random variable could be modeled using a normal distribution, where the mean represents the average rainfall and the standard deviation represents the variability in rainfall.
Suppose the rainfall follows a normal distribution with mean mm and standard deviation mm. The PDF is:
Probability of specific ranges:
- (68.27%)
- (95.45%)
CDF: (truncated normal since rainfall ≥ 0)
Mixed Random Variable
Mixed random variables are those that can take on both discrete and continuous values. For example, consider a random variable that represents the number of customers arriving at a store in a day, where the number of customers can be any non-negative integer (discrete) and the time of arrival can be any real number (continuous).
Consider a random variable that represents the number of customers arriving at a store in a day. The sample space could be the set of all non-negative integers for the number of customers and the set of all non-negative real numbers for the time of arrival. We can define a random variable that maps each outcome to the number of customers and their arrival time. For example, if 5 customers arrive at the store at different times throughout the day, we can represent this as , where represents the time of arrival of each customer. The probability distribution of this random variable could be a combination of a discrete distribution for the number of customers and a continuous distribution for the arrival times.
Comparison: Discrete vs Continuous Random Variables
| Aspect | Discrete Random Variables | Continuous Random Variables |
|---|---|---|
| Values | Countable (finite or infinite) | Uncountable (interval) |
| Probability Function | PMF: | PDF: where |
| Individual Points | for specific | for any specific |
| CDF | Step function | Continuous function |
| Examples | Coin flips, dice rolls, counts | Time, distance, temperature |
| Expected Value |
For information about covariance and correlation between random variables, see Expectation and Variance.
Joint Random Variables
When working with multiple random variables simultaneously, we need to understand their joint behavior and relationships.
Joint random variables describe the behavior of two or more random variables defined on the same probability space. For two random variables and , their joint distribution specifies the probability of taking value and taking value simultaneously.
Joint Probability Functions
For discrete random variables, we use the Joint Probability Mass Function:
Properties:
- for all
For continuous random variables, we use the Joint Probability Density Function:
Properties:
- for all
Marginal Distributions
The marginal distribution of one variable can be obtained from the joint distribution:
For discrete:
For continuous:
Independence
Random variables and are independent if:
This means the joint distribution factors into the product of marginal distributions.
Consider rolling two fair six-sided dice. Let be the outcome of the first die and be the outcome of the second die.
Joint PMF: for
Marginal PMFs:
Since , the dice rolls are independent.
Consider the relationship between height and weight of adults. These are typically not independent.
The joint PDF describes how height and weight are distributed together in the population.
- The marginal density gives the distribution of heights regardless of weight
- The marginal density gives the distribution of weights regardless of height
Since height and weight are correlated, .
For more details on computing expectations with joint random variables, see Expectation and Variance.
Discussion