# 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$?

-
You want the preimage of a subset of $\mathbb{R}$ to be an element of $\mathcal{F}$ (so you can assign a measure to it), not a collection of elements of $\mathcal{F}$. – Qiaochu Yuan Jun 19 '11 at 23:26
A collection of elements of $\mathcal{F}$, interpreted as the union of these elements, is an element of $\mathcal{F}$. – Leo Jun 19 '11 at 23:32
Yes, but that's completely unnecessary when you can just take a union of points in $\Omega$ instead. – Qiaochu Yuan Jun 19 '11 at 23:35
You can, however, think of $X$ as a map from $R$ to $F$,by taking preimages. You then get a morphism of sigma-algebras. Some probabilistic questions can be phrased only in terms of this morphism. – Mark Jun 19 '11 at 23:38

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(Ω)?

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 Ω.

-

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.

-
This is correct. But if we consider example in this question, we see that random variable can not be defined for each possible outcome (element of $\Omega$) without considering other outcomes and without considering the defined events. So why not consider just $\mathcal{F}$ instead? – Leo Jun 19 '11 at 23:39

The main reason is that in probability theory one often works with multiple $\sigma$-algebras defined on a common sample space $\Omega$.

A very standard example is a collection of $\sigma$-algebras $({\mathcal F})_{n \in {\mathbb Z}}$ such that ${\mathcal F}_n \subset {\mathcal F}_{n+1}$ for all $n \in {\mathbb Z}$. If one thinks about the $\sigma$-algebra as an amount of knowledge about $\Omega$ then this would represent gradual gathering of information. Therefore if $X$ is ${\mathcal F}_n$-measurable for some $n \in {\mathbb Z}$ it will naturally be measurable in all "later" algebras ${\mathcal F}_m$, $m \geq n$. From this point of view, it's more natural to think about $X$ as residing in $\Omega$ rather than in one concrete $\sigma$-algebra. [Note: nevertheless, it's true that there exists also a canonical $\sigma$-algebra associated with $X$, namely $\sigma(X)$ which is a smallest $\sigma$-algebra that makes $X$ measurable.]

Another reason one doesn't want to restrict random variable to one particular $\sigma$-algebra is that we often use operations such as conditional expectation $\mu(X|{\mathcal A})$ of random variable w.r.t. $\sigma$-algebra. Operations like these effectively change what you'd consider a domain of the random variable from one $\sigma$-algebra to another.

There is much more to be said and it all has to do with probabilistic way of thinking but the bottom line would be that in probability theory one has a huge amount of freedom of how to model the given problem: there is no canonical sample space, no canonical $\sigma$-algebra and no canonical measure; each of them can be extended and restricted as the need requires.

-