Canonical: https://knowlpedia.com/probability/random-variable/

# Random variable

A measurable real-valued function on a probability space.

A **random variable** is a [measurable function](https://knowlpedia.com/measure-theory/measurable-function/) \(X:(\Omega,\mathcal{F})\to(\mathbb{R},\mathcal{B}(\mathbb{R}))\) defined on a [probability space](https://knowlpedia.com/probability/probability-space/) \((\Omega,\mathcal{F},\mathbb{P})\), meaning that for every Borel set \(B\subseteq\mathbb{R}\) one has \(X^{-1}(B)\in\mathcal{F}\).

## Consequences

A random variable induces a [distribution (law)](https://knowlpedia.com/probability/distribution-law/) on [the real numbers](https://knowlpedia.com/shared-foundations/real-numbers/) via \(\mathbb{P}_X(B)=\mathbb{P}(X\in B)\), and quantities such as [expectation](https://knowlpedia.com/probability/expectation/) and [variance](https://knowlpedia.com/probability/variance/) are defined from this law.

## Examples

- For an event \(A\in\mathcal{F}\), the indicator \(X=\mathbf{1}_A\) (equal to \(1\) on \(A\) and \(0\) on \(A^c\)) is a random variable.
- In a fair coin toss space, the function \(X(H)=1\) and \(X(T)=0\) is a random variable taking values in \(\{0,1\}\).
