Grade 11 → Probability and Statistics ↓
Random Variables
In probability and statistics, the concept of "random variable" is fundamental. A random variable is a variable whose possible values are the numerical outcomes of a random phenomenon. To understand it in more detail, a random variable can be thought of as a function that assigns a real number to each outcome in the sample space of a random experiment.
Understanding random variables
Random variables can be discrete or continuous. Discrete random variables have a countable number of possible values. On the other hand, continuous random variables have an infinite number of possible values.
Discrete random variable
Discrete random variables are generally generated by counting something. For example, if you roll a six-sided dice, the possible outcomes (1, 2, 3, 4, 5, 6) are discrete and countable. We can represent this random variable as X
where X
can take any value from 1 to 6. Let us look at this concept with an example.
Outcome of Dice Roll: {1, 2, 3, 4, 5, 6}
Here, each line segment represents a possible outcome of throwing a dice. The random variable X
takes any of these values, each with a probability of 1/6
.
Continuous random variable
Continuous random variables arise from measuring something. These variables can take an infinite number of values, such as height, weight, time, and temperature. For example, consider measuring rainfall in a city. The random variable Y
might represent the amount of rainfall in centimeters, which can take any value from 0 to any positive number, depending on the circumstances.
In the above figure, the line represents all possible values of rainfall, which is a continuous range from 0 cm onwards.
Probability distributions
A probability distribution is a function that provides the probabilities of occurrence of different possible outcomes. For discrete random variables, the probability distribution is known as the probability mass function (PMF), while for continuous random variables, it is called the probability density function (PDF).
Probability mass function (PMF)
The probability mass function gives the probability that a discrete random variable is exactly equal to some value. For the dice roll example mentioned earlier, the PMF of X
can be represented as:
P(X = x) = 1/6 for x in {1, 2, 3, 4, 5, 6}
Each blue bar represents the probability of any one of the numbers on the dice coming up, all with probability equal to 1/6
.
Probability density function (PDF)
The probability density function is used for continuous random variables. The PDF indicates the relative probability of this random variable taking a given value. However, the PDF does not give probabilities directly (since the probability at any single point is zero for a continuous random variable), but instead, it needs to be integrated over an interval to provide a probability.
Suppose f(y)
is the probability density function for a random variable Y
The probability that Y
is between a
and b
is given by:
P(a < Y < b) = ∫[a, b] f(y) dy
Expectation and variance of random variables
Expectation (mean)
The expectation or mean of a random variable provides the average value of the outcomes. For a discrete random variable X
with PMF P
, the expectation is calculated as:
E(X) = Σ [x * P(x)]
For a continuous random variable Y
with pdf f
, the expectation is calculated as:
E(Y) = ∫ y * f(y) dy
Variance and standard deviation
Variance measures how far the values of a random variable are spread out from the mean. For a discrete random variable X
, the variance is calculated as:
Var(X) = Σ [(x - E(X))^2 * P(x)]
The standard deviation is the square root of the variance, which provides a measure of how spread out the numbers in a data set are.
Real-life examples
Random variables are used extensively in a variety of fields. Some examples include:
- Insurance: Insurers use random variables to model risks and set policy prices.
- Manufacturing: Companies measure and control variations in their processes using continuous random variables.
- Finance: Stock prices are modeled as random variables to forecast their future behavior.
- Medicine: Clinical trials use the concept of random variables to analyze the effectiveness of treatments.
Through these examples, we see that random variables help us model the uncertainty inherent in various real-world processes and decision-making scenarios.