Random variable
A random variable is used in mathematics to study probability theory. It was developed to model the chance of events happening in all kinds of real-life scenarios.
Definition
Take two measurable spaces, and name them [math]\displaystyle{ (\Omega_1,\mathcal A_1) }[/math] and [math]\displaystyle{ (\Omega_2,\mathcal A_2) }[/math]. A measurable space is any pair of sets, called [math]\displaystyle{ \Omega }[/math] and [math]\displaystyle{ \mathcal A }[/math], that follow these rules:
- [math]\displaystyle{ \Omega }[/math] is not empty;
- The elements of [math]\displaystyle{ \mathcal \mathcal A }[/math] are subsets of [math]\displaystyle{ \Omega }[/math];
- [math]\displaystyle{ \Omega }[/math] and the empty set are both elements of [math]\displaystyle{ \mathcal A }[/math];
- [math]\displaystyle{ \mathcal A }[/math] is closed under complements and countable unions.
A random variable, named [math]\displaystyle{ X }[/math], is a measurable function from [math]\displaystyle{ \Omega_1 }[/math] to [math]\displaystyle{ \Omega_2 }[/math]. This is written [math]\displaystyle{ X:\Omega_1 \to \Omega_2 }[/math]. A random variable is typically represented by capital roman letters such as [math]\displaystyle{ X }[/math], [math]\displaystyle{ Y }[/math], [math]\displaystyle{ Z }[/math] and [math]\displaystyle{ T }[/math],[1][2] and can be either discrete (taking on a countable set of values) or continuous (taking on an interval of values).[3]
The set [math]\displaystyle{ \Omega_1 }[/math] is called the sample space. The set [math]\displaystyle{ \mathcal A_1 }[/math] is called the event space.
Use in Probability
Take a probability measure [math]\displaystyle{ \mathbb P }[/math] on [math]\displaystyle{ (\Omega_1,\mathcal A_1) }[/math]. Take a set [math]\displaystyle{ A }[/math] in [math]\displaystyle{ \mathcal A_2 }[/math]. Then [math]\displaystyle{ \mathbb P(A) }[/math] is defined to mean [math]\displaystyle{ \mathbb P(X^{-1}(A)) }[/math].
Examples with Dice
When you roll a dice, 6 events can happen. These events are the different numbers that can show on the dice: 1, 2, 3, 4, 5, or 6.
Dicing Fruit
Here is an example of a random variable. You roll a fair dice once. If the number on the dice is odd, you eat an apple, and if the number is even, you eat an orange. The random variable is the type of fruit that you will eat. Before you roll the dice, you don't know if you will eat an apple or an orange. We can also write this with mathematics:
Take [math]\displaystyle{ \Omega_1 = \{1,2,3,4,5,6\} }[/math]. Take [math]\displaystyle{ \mathcal A_1 }[/math] to be the power set of [math]\displaystyle{ \Omega_1 }[/math]. Take [math]\displaystyle{ \Omega_2 = \{apple, orange\} }[/math]. Take [math]\displaystyle{ \mathcal A_2 }[/math] to be the power set of [math]\displaystyle{ \Omega_2 }[/math]. Our random variable follows the even/odd rule from above:
- [math]\displaystyle{ X(\omega)= \begin{cases} apple & \text{ if } \omega \text{ is odd}; \\ orange & \text{ if } \omega \text{ is even}. \end{cases} }[/math]
Here [math]\displaystyle{ \omega }[/math] represents the number on the dice after you roll it. We said the dice is fair. In mathematics, this means [math]\displaystyle{ \mathbb P(\{\omega\})=1/6 }[/math] for [math]\displaystyle{ \omega = 1,2,3,4,5 }[/math] and [math]\displaystyle{ 6 }[/math].
The event that you eat an apple is a set in the event space. It is [math]\displaystyle{ \{1,3,5\} }[/math]. The probability that you eat an apple is the probability measure of this set. It is [math]\displaystyle{ \mathbb P(\{1,3,5\})=1/2 }[/math].
Dicing Fruit Unfairly
Here is another example. Sometimes a dice is unbalanced. This means that it rolls some numbers more often than others. We can do the same experiment as above, but with an unbalanced dice.
For example, let's say that we use a dice that has been changed in one way: it never rolls the number 5. Then you are less likely to eat an apple, because 5 is an odd number. The random variable is exactly the same as before:
- [math]\displaystyle{ X(\omega)= \begin{cases} apple & \text{ if } \omega \text{ is odd}; \\ orange & \text{ if } \omega \text{ is even}. \end{cases} }[/math]
This is because end possibilities have not changed. After the dice is rolled, you will eat an apple or an orange. You don't know which. What has changed is the probability that you eat an apple or an orange. In mathematics, this means
- [math]\displaystyle{ \mathbb P(\{\omega\})= \begin{cases} 1/5 & \text{ if } \omega = 1,2,3,4,6; \\ 0 & \text{ if } \omega = 5. \end{cases} }[/math]
The event that you eat an apple is the same set as for the fair dice. It is [math]\displaystyle{ \{1,3,5\} }[/math]. But this event is now less likely to happen, because the dice cannot roll a 5. In other words, the probability that you eat an apple is different than for the fair dice. It is [math]\displaystyle{ \mathbb P(\{1,3,5\}) = 2/5 }[/math].
Probability spaces
The examples show that a random variable doesn't automatically give probabilities. If we choose [math]\displaystyle{ \mathbb P }[/math] differently, one random variable can give different probabilities. This can be confusing. For this reason, mathematicians often define a random variable on a probability space. The mathematical notation for this is [math]\displaystyle{ (\Omega,\mathcal A,\mathbb P) }[/math]. This fixes the probability measure. Then there is no confusion about the probabilities of events.
Random Variable Media
If the sample space is the set of possible numbers rolled on two dice, and the random variable of interest is the sum S of the numbers on the two dice, then S is a discrete random variable whose distribution is described by the probability mass function plotted as the height of picture columns here.
Related pages
References
- ↑ "List of Probability and Statistics Symbols". Math Vault. 2020-04-26. Retrieved 2020-08-21.
- ↑ "Random Variables". www.mathsisfun.com. Retrieved 2020-08-21.
- ↑ "Random Variables". www.stat.yale.edu. Retrieved 2020-08-21.
Further reading
- Klenke, Achim, Probability Theory: A Comprehensive Course : Springer (2013) ISBN 978-1-4471-5360-3