If is a probability space and
is a measurable space (i.e., a set
along with a sigma-algebra
on
), then a random variable is a measurable function
. That is, for each
, we have
. Generally speaking, we’ll be taking
to be
where
is the Borel algebra on
.
Given a topological space , there exists a sigma-algebra
, called the Borel algebra on
, that contains all open sets (members of
) and is the smallest such sigma-algebra. This means that for each
we have
and also if
is another sigma-algebra on
with this property, then
. In general, given a collection
of subsets of
, there exists a sigma-algebra, which we’ll call
, that is the smallest sigma-algebra on
(smallest using
as the ordering relation) containing each
; we say that
is the sigma-algebra generated by
. In this sense, the Borel algebra on
is the sigma-algebra generated by the topology
. We will usually just write
to mean
.
In the special case of , there’s an easy way to check to see that a function
is a random variable (or a measurable function in general): we just look at the pre-images of intervals. Since the pre-images of functions are well-behaved with respect to set operations like union, intersection, and complement, it in fact suffices to only consider pre-images of the form
. That is, if we show that
for every
, we will have shown that
is measurable, and so a random variable. (Actually, we can look at all intervals of the form
,
,
or
. Using properties of sigma-algebras we can easily show that if we have all intervals of any of these forms, we have all intervals of any other form. Again, using properties of sigma-algebras it’s easy to take that and show that we have all countable unions of intervals — namely all countable unions of open intervals, i.e., all open sets.)
To see this, suppose for every we have
.
So now we have the pre-images of all intervals of the form and
. If we can also get pre-images for the form
, it’ll be an easy jump to countable unions of open intervals. Note that
Now we easily see that
And we have pre-images of intervals of the form . Combined with the fact we have intervals of the form
, it’s easy to see that we also have intervals of the form
. Using properties of sigma-algebras, it’s easy to show now that we have the pre-image of any open set. This tells us that if
for every
, then we have that
is measurable, and so a random variable.
In the case that is a countable set, we take
to be
(the powerset of
), and so any function
is a random variable. This is because the pre-image of
must be something (even if it’s empty); we have for every
that
, and so every function on a countable sample-space is a random variable.