# Random variable

In probability theory, a branch of mathematics, a **random variable** is, as its name suggests, a "variable" that can take on random values. More formally, it is not actually a variable, but a function whose argument takes on a particular value according to some probability measure (a measure that takes on the value 1 over the largest set on which it is defined).

## Formal definition

Let be an arbitrary probability space and an arbitrary measurable space. Then a **random variable** is any measurable function *X* mapping to .

The reason a random variable has been defined in this way is that it captures the idea that events corresponding to the random variable taking on certain values can always be assigned probabilities. For example, suppose that the event *E* of interest is the a random variable *X* taking on a value in the set . This event can be expressed as . By the measurability of *X* as a random variable it follows that , hence *E* can be assigned a probability (i.e., ). If *X* is not measurable then it cannot be ascertained that *E* will belong to , hence it may not be assignable a probability via *P*.

## An easy example

Consider the probability space where is the sigma algebra of Borel subsets of and *P* is a probability measure on (hence *P* is a measure with ). Then the identity map defined by is trivially a measurable function, hence is a random variable.

## References

- P. Billingsley,
*Probability and Measure*(2 ed.), ser. Wiley Series in Probability and Mathematical Statistics, Wiley, 1986. - D. Williams,
*Probability with Martingales*, Cambridge : Cambridge University Press, 1991.