# Random variable

variable representing a random phenomenon

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 ${\displaystyle (\Omega _{1},{\mathcal {A}}_{1})}$  and ${\displaystyle (\Omega _{2},{\mathcal {A}}_{2})}$ . A measurable space is any pair of sets, called ${\displaystyle \Omega }$  and ${\displaystyle {\mathcal {A}}}$ , that follow these rules:

1. ${\displaystyle \Omega }$  is not empty;
2. The elements of ${\displaystyle {\mathcal {\mathcal {A}}}}$  are subsets of ${\displaystyle \Omega }$ ;
3. ${\displaystyle \Omega }$  and the empty set are both elements of ${\displaystyle {\mathcal {A}}}$ ;
4. ${\displaystyle {\mathcal {A}}}$  is closed under complements and countable unions.

A random variable, named ${\displaystyle X}$ , is a measurable function from ${\displaystyle \Omega _{1}}$  to ${\displaystyle \Omega _{2}}$ . This is written ${\displaystyle X:\Omega _{1}\to \Omega _{2}}$ . A random variable is typically represented by capital roman letters such as ${\displaystyle X}$ , ${\displaystyle Y}$ , ${\displaystyle Z}$  and ${\displaystyle T}$ ,[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 ${\displaystyle \Omega _{1}}$  is called the sample space. The set ${\displaystyle {\mathcal {A}}_{1}}$  is called the event space.

## Use in Probability

Take a probability measure ${\displaystyle \mathbb {P} }$  on ${\displaystyle (\Omega _{1},{\mathcal {A}}_{1})}$ . Take a set ${\displaystyle A}$  in ${\displaystyle {\mathcal {A}}_{2}}$ . Then ${\displaystyle \mathbb {P} (A)}$  is defined to mean ${\displaystyle \mathbb {P} (X^{-1}(A))}$ .

## 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 ${\displaystyle \Omega _{1}=\{1,2,3,4,5,6\}}$ . Take ${\displaystyle {\mathcal {A}}_{1}}$  to be the power set of ${\displaystyle \Omega _{1}}$ . Take ${\displaystyle \Omega _{2}=\{apple,orange\}}$ . Take ${\displaystyle {\mathcal {A}}_{2}}$  to be the power set of ${\displaystyle \Omega _{2}}$ . Our random variable follows the even/odd rule from above:

${\displaystyle X(\omega )={\begin{cases}apple&{\text{ if }}\omega {\text{ is odd}};\\orange&{\text{ if }}\omega {\text{ is even}}.\end{cases}}}$

Here ${\displaystyle \omega }$  represents the number on the dice after you roll it. We said the dice is fair. In mathematics, this means ${\displaystyle \mathbb {P} (\{\omega \})=1/6}$  for ${\displaystyle \omega =1,2,3,4,5}$  and ${\displaystyle 6}$ .

The event that you eat an apple is a set in the event space. It is ${\displaystyle \{1,3,5\}}$ . The probability that you eat an apple is the probability measure of this set. It is ${\displaystyle \mathbb {P} (\{1,3,5\})=1/2}$ .

### 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:

${\displaystyle X(\omega )={\begin{cases}apple&{\text{ if }}\omega {\text{ is odd}};\\orange&{\text{ if }}\omega {\text{ is even}}.\end{cases}}}$

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

${\displaystyle \mathbb {P} (\{\omega \})={\begin{cases}1/5&{\text{ if }}\omega =1,2,3,4,6;\\0&{\text{ if }}\omega =5.\end{cases}}}$

The event that you eat an apple is the same set as for the fair dice. It is ${\displaystyle \{1,3,5\}}$ . 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 ${\displaystyle \mathbb {P} (\{1,3,5\})=2/5}$ .

## Probability spaces

The examples show that a random variable doesn't automatically give probabilities. If we choose ${\displaystyle \mathbb {P} }$  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 ${\displaystyle (\Omega ,{\mathcal {A}},\mathbb {P} )}$ . This fixes the probability measure. Then there is no confusion about the probabilities of events.

## References

1. "List of Probability and Statistics Symbols". Math Vault. 2020-04-26. Retrieved 2020-08-21.
2. "Random Variables". www.mathsisfun.com. Retrieved 2020-08-21.
3. "Random Variables". www.stat.yale.edu. Retrieved 2020-08-21.