# nLab random variable

Contents

### Context

#### Measure and probability theory

measure theory

probability theory

# Contents

## Idea

A random variable, or stochastic variable, is a quantity that is subject to ‘random’ variation.

Some authors in probability theory distinguish between random variables and random elements: a random element is a generic entity (such as a point of a set or space) subject to random variation, while a random variable is specifically a number subject to random variation.

## Definition

The formalization of this idea in modern probability theory (Kolmogorov 33, III) is to take a random variable to be a measurable function $f$ on a probability space $(X,\mathcal{F},\mu)$ (e.g. Grigoryan 08, 3.2, Dembo 12, 1.2.1).

One thinks of $X$ as the space of all possible configurations (all the “possible worlds” with respect to the idealized situation under consideration), thinks of the measure $\mu(U)$ of any subset of it as the probability that one of the configurations $x \in U \subset X$ is randomly realized, and thinks of $f(x)$ as the value of the given random variable in the situation of that configuration.

Often, a random element is a measurable function $X\to Y$, where $Y$ is a generic measurable space, while the term random variable is reserved for the case where $Y$ is $\mathbb{R}$, $\mathbb{R}^n$, or a more general vector space. One speaks for example of random elements of a set, and of real-valued or vector-valued random variables.

In particular, the term random variable tends to be used for those situation where there is a notion of expectation value. For example the expectation value of a (real-valued) random variable $f$ is the integral

$\langle f \rangle \coloneqq \int_X f \cdot \mu$

of $f$ against the probability measure $\mu$, i.e. the average value of the random variable over all possible configuration, weighted by their probability.

## Properties

### Relation to type theoretic constructions

There is at least some similarity of the concept of random variables to usage of the function monad (“reader monad”) in the context of monads in computer science.

In Verdier 14 it says:

The intuition behind the Reader monad, for a mathematician, is perhaps stochastic variables. A stochastic variable is a function from a probability space to some other space. So we see a stochastic variable as a monadic value.

you could interpret this by regarding random variables as reader monad computations.

See also (Toronto-McCarthy 10b, slide 24). Toronto-McCarthy 10a, 2.2, Toronto 14 call the function monad the random variable idiom.

### Random variables and Dedekind reals

Given a measure space $(X,\Sigma,\mu)$, a random variable is also often defined as an equivalence class of measurable real-valued functions on $X$ where two such functions are identified when they differ only on a subset of measure zero.

In this context, it has been observed by P. Deligne1 that the po-set of measurable subsets $\Sigma$ can be equipped with a suitable Grothendieck topology.

In the resulting Grothendieck topos $Meas(X,\Sigma,\mu)$ the object of Dedekind real numbers $R_D$ corresponds to the sheaf of random variables on $X$ in this sense.

A Dedekind real in a topos $Sh(X)$ of sheaves on a topological space is just a continuous real-valued function on $X$. This suggests the view that the sheaf-theoretic perspective on $(X,\Sigma,\mu)$ sweeps the measure-theoretic details under the rug and brings out the conceptual essence of a random variable as simply a real-valued ‘function’ or ‘variable real number’ on $X$ and goes in the same direction as the connection to the function monad mentioned in the previous section.

The details of this example, due to D. Scott, are described in (Johnstone 1977, p.213).

## References

The modern formal concept originates around

• Andrey Kolmogorov, Grundbegriffe der Wahrscheinlichkeitsrechnung, Ergebnisse der Mathematik und Ihrer Grenzgebiete, Springer Berlin Heidelberg 1933.

Surveys and lecture notes include

• Alexander Grigoryan, Measure theory and probability, 2008. (pdf)

• Amir Dembo, Probability theory, 2012. (pdf)

• Peter Johnstone, Topos Theory , Academic Press New York 1977. (Dover reprint 2014)

Discussion from a point of view of type theory/computer science includes

category: probability

1. SGA4.I, p.412.

Last revised on July 11, 2024 at 04:22:58. See the history of this page for a list of all contributions to it.