Why random variable is defined as a mapping from the sample space?

Consider a probability space $(\Omega, \mathcal{F}, P)$. Why in the definition of a random variable $X$ it is required that $X$ is a mapping from the sample space and not from the $\sigma$-algebra of events? That is, why $X: \Omega \rightarrow R$ and not $X: \mathcal{F} \rightarrow R$?


Solution 1:

This was originally posted as a comment:

Here is a question whose goal is to make you understand what others already wrote. Follow your suggestion and assume that X: $\mathcal{F}\to\mathbb{R}$ for your favorite random variable X (say, the result of the throw of a die, that is, an integer from 1 to 6). What numbers would be X(∅) and X(Ω)?

To which Leo answered this:

This is a very good point, thank you. It made me realize that events from $\mathcal{F}$ may happen simultaneously; in particular, event Ω always happens with any event. If we define X on $\mathcal{F}$, how to choose its values then? For a "die" random variable, for example, there is no way to define it on $\mathcal{F}$.

Solution 2:

The sample space can be viewed as the "states of nature." A random variable represents a measurement of the system under observation. The $\sigma$-algebra represents the subsets of the sample space to which we can assign probability.