Random variables are foundational to understanding probability and statistics. When we typically think of variables, we consider them as being determinate, but in the context of probability, we are often dealing with uncertain or random outcomes. Hence, a "random variable" is a means of translating these uncertain outcomes into a definite numeric form. Despite its name, a random variable is actually a function. It doesn't vary in the way typical variables do. Instead, it assigns a specific number to every possible outcome of a random experiment.
Formally, it can be defined as:
Given a sample space of a random experiment (the set of all possible outcomes), a random variable is a function that maps every outcome in to a real number.
This definition implies that for every outcome in the sample space , there is a corresponding value in (the set of real numbers) such that:
While both random variables and events deal with uncertainty, they serve
different purposes. Events classify outcomes, whereas random variables
quantify them. Events help structure the sample space, enabling set
operations like union, intersection, and complement. Random variables, by
converting outcomes to numbers, enable arithmetic operations and
analyses.
Example 2.1. Consider an experiment of tossing two fair coins simultaneously. Here, the sample space = {(, ), (, ), (, ) (, )}.
Suppose the random variable is defined as the number of heads obtained in the two coin tosses.
Using the convent () = , we can represent the relation of random variables and outcomes as follows:
For the outcome (heads, heads):
For the outcome (heads, tails):
For the outcome (tails, heads):
For the outcome (tails, tails):
The relation between events and random variables can be understood as follows:
Event A: Both coins show “heads”. This corresponds to = {(, )}. The value of the random variable for this event is () = 2. Therefore, when we write ( = 2), it actually means ({, })
Event B: Exactly one coin shows “heads”. This corresponds to = {(, )}. The value of the random variable for this event is () = 2. Therefore, when we write ( = 2), it actually means P({, }, {, })
There are two main types of Random Variables: