Tutorials › Measure Theory › Random Variables as Measurable Maps

Probability Spaces and Random Variables · Tutorial 727 of 798

Random Variables as Measurable Maps

Learn to identify a real-valued random variable by its measurable-map definition and calculate the events it determines in discrete and continuous probability spaces.

Intermediate 10 min read

What You'll Learn

  • Define a real-valued random variable using the Borel sigma-algebra on the real line.
  • Translate a Borel set of values into its inverse-image event.
  • Calculate event probabilities in finite and countable discrete models.
  • Use continuity to verify measurability in a continuous model.
  • Distinguish a set of possible values from the event of outcomes mapped into that set.

From Outcomes to Real Numbers

A probability space describes outcomes and events; a random variable assigns a real number to each outcome. The measurable-map definition makes this assignment compatible with probability: whenever we specify a Borel set of real values, the outcomes assigned values in that set must form an event. In this way, statements such as “the value lies between 1 and 2” become events to which the probability measure can be applied.

Throughout, \((\Omega,\mathcal{F},\mathbb{P})\) is a probability space: \(\mathcal{F}\) is a sigma-algebra of subsets of \(\Omega\), and \(\mathbb{P}\) is a measure on \(\mathcal{F}\) with \(\mathbb{P}(\Omega)=1\). An event is a set in \(\mathcal{F}\). The Borel sigma-algebra \(\mathcal{B}_{\mathbb{R}}\) is the sigma-algebra generated by the open subsets of \(\mathbb{R}\). A real-valued function \(X:\Omega\to\mathbb{R}\) assigns one finite real number \(X(\omega)\) to every \(\omega\in\Omega\).

Definition: A real-valued random variable on \((\Omega,\mathcal{F},\mathbb{P})\) is a function \(X:\Omega\to\mathbb{R}\) such that $$ X^{-1}(B)=\{\omega\in\Omega:X(\omega)\in B\}\in\mathcal{F} $$ for every \(B\in\mathcal{B}_{\mathbb{R}}\). The set \(X^{-1}(B)\) is called the inverse image of \(B\) under \(X\); when \(B\) is a Borel set, it is an event.

The definition concerns inverse images, not whether the set \(B\) itself is a subset of the sample space. The real line is the space of values, while \(\Omega\) is the space of outcomes. For example, if \(B=(1,2]\), the event of interest is the set of outcomes \(\omega\) for which \(X(\omega)\in(1,2]\), not the interval \((1,2]\) considered as a subset of \(\Omega\).

Why Inverse Images Give Events

Inverse images respect the operations used to build a sigma-algebra. This elementary fact explains why the measurability definition is the right one.

Proposition: Let \((\Omega,\mathcal{F},\mathbb{P})\) be a probability space, let \(X:\Omega\to\mathbb{R}\) be any function, and let \(B,B_1,B_2,\ldots\) be subsets of \(\mathbb{R}\). Then $$ X^{-1}(B^c)=(X^{-1}(B))^c,\qquad X^{-1}\left(\bigcup_{n=1}^{\infty}B_n\right)=\bigcup_{n=1}^{\infty}X^{-1}(B_n), \qquad X^{-1}(\varnothing)=\varnothing. $$ Consequently, if \(X^{-1}(B)\in\mathcal{F}\) for every open \(B\subseteq\mathbb{R}\), then \(X\) is a random variable.

Proof. For any \(\omega\in\Omega\), \(X(\omega)\in B^c\) holds exactly when \(X(\omega)\notin B\). This gives the complement identity. Also, \(X(\omega)\in\bigcup_n B_n\) holds exactly when there is at least one \(n\) for which \(X(\omega)\in B_n\); this gives the union identity. No value \(X(\omega)\) belongs to the empty set, so its inverse image is empty. To prove the consequence, define \(\mathcal{G}=\{B\subseteq\mathbb{R}:X^{-1}(B)\in\mathcal{F}\}\). The identities show that \(\mathcal{G}\) contains \(\mathbb{R}\), is closed under complements, and is closed under countable unions; thus it is a sigma-algebra. If it contains every open set, it contains the sigma-algebra generated by the open sets, namely \(\mathcal{B}_{\mathbb{R}}\). Therefore \(X^{-1}(B)\in\mathcal{F}\) for every Borel \(B\), as required. \(\square\)

This result is a useful way to check measurability when the domain has a topology and the function is continuous. Here, continuity means that the inverse image of every open set is open in the domain. If the domain’s sigma-algebra contains its open sets, the proposition then applies.

Theorem: Let \(\Omega=[0,1]\), let \(\mathcal{F}\) be the Lebesgue sigma-algebra on \([0,1]\), and let \(\mathbb{P}\) be Lebesgue measure restricted to \([0,1]\). Every continuous function \(X:[0,1]\to\mathbb{R}\) is a real-valued random variable on this probability space.

Proof. Let \(B\subseteq\mathbb{R}\) be open. By continuity, \(X^{-1}(B)\) is open in the relative topology of \([0,1]\). Every relatively open subset of \([0,1]\) is Borel in \([0,1]\), and every such Borel set is Lebesgue measurable. Thus \(X^{-1}(B)\in\mathcal{F}\) for every open \(B\). The proposition implies \(X^{-1}(B)\in\mathcal{F}\) for every \(B\in\mathcal{B}_{\mathbb{R}}\), which is precisely the definition of a random variable. \(\square\)

Worked Examples

Worked Example: A Variable on a Finite Sample Space

Let \(\Omega=\{a,b,c,d,e\}\), let \(\mathcal{F}\) be the collection of all subsets of \(\Omega\), and assign probabilities \(\mathbb{P}(\{a\})=1/10\), \(\mathbb{P}(\{b\})=2/10\), \(\mathbb{P}(\{c\})=3/10\), \(\mathbb{P}(\{d\})=2/10\), and \(\mathbb{P}(\{e\})=2/10\). These weights sum to \(1/10+2/10+3/10+2/10+2/10=10/10=1\), so they define a probability measure. Define \(X(a)=0\), \(X(b)=1\), \(X(c)=1\), \(X(d)=2\), and \(X(e)=3\). Find the event that \(X\in[1,2)\) and its probability.

Because every subset of \(\Omega\) belongs to \(\mathcal{F}\), the inverse image of every Borel set is an event, so \(X\) is a random variable. The values \(1\) and no others in the list \(0,1,1,2,3\) belong to \([1,2)\): the lower endpoint \(1\) is included and the upper endpoint \(2\) is excluded. Hence $$ X^{-1}([1,2))=\{b,c\},\qquad \mathbb{P}(X^{-1}([1,2)))=\mathbb{P}(\{b\})+\mathbb{P}(\{c\})=\frac{2}{10}+\frac{3}{10}=\frac{5}{10}=\frac12. $$ Check: The inverse images of the distinct values \(0,1,2,3\) are \(\{a\},\{b,c\},\{d\},\{e\}\). Their probabilities are \(1/10,5/10,2/10,2/10\), whose sum is \(10/10=1\). The event for \([1,2)\) is exactly the fiber for the value \(1\), with probability \(5/10\).

Worked Example: An Event in a Countable Discrete Model

Let \(\Omega=\mathbb{N}=\{1,2,\ldots\}\), let \(\mathcal{F}\) be its power set, and assign \(\mathbb{P}(\{n\})=2^{-n}\). The weights sum to \(1\), since \(\sum_{n=1}^{\infty}2^{-n}=1\). Define \(X(n)=n\). Find the event \(X\in\{2,4,6,\ldots\}\), and calculate its probability.

Every subset of \(\mathbb{N}\) is in \(\mathcal{F}\), so every function from this sample space to \(\mathbb{R}\), including \(X\), is measurable. In this case, $$ X^{-1}(\{2,4,6,\ldots\})=\{2,4,6,\ldots\}. $$ The event probability is the sum of the point probabilities: $$ \mathbb{P}(X^{-1}(\{2,4,6,\ldots\}))=\sum_{k=1}^{\infty}2^{-2k} =\sum_{k=1}^{\infty}\left(\frac14\right)^k =\frac{1/4}{1-1/4}=\frac13. $$ Check: The complementary event consists of odd positive integers. Its probability is \(\sum_{k=1}^{\infty}2^{-(2k-1)}=2\sum_{k=1}^{\infty}(1/4)^k=2/3\). The two events partition \(\mathbb{N}\), and their probabilities add to \(1/3+2/3=1\).

Worked Example: A Continuous Variable and an Interval Event

Take \(\Omega=[0,1]\), \(\mathcal{F}\) to be the Lebesgue sigma-algebra on \([0,1]\), and \(\mathbb{P}\) to be Lebesgue measure restricted to \([0,1]\). Define \(X(\omega)=2\omega+1\). This function is continuous, so the theorem shows that it is a random variable. Find the event \(X\in(2,5/2]\) and its probability.

Solving the membership condition while preserving its strict and non-strict endpoints gives $$ 2<X(\omega)\le\frac52 \quad\Longleftrightarrow\quad 2<2\omega+1\le\frac52 \quad\Longleftrightarrow\quad \frac12<\omega\le\frac34. $$ Therefore \(X^{-1}((2,5/2])=(1/2,3/4]\), an event in \(\mathcal{F}\). Its probability is its Lebesgue measure: $$ \mathbb{P}(X^{-1}((2,5/2]))=m((1/2,3/4])=\frac34-\frac12=\frac14. $$ Check: For every \(\omega\) in \((1/2,3/4]\), \(2\omega+1\) is greater than \(2\) and at most \(2(3/4)+1=5/2\). The interval has length \(1/4\), matching the computed probability.

Worked Example: A Nonlinear Continuous Variable

On the same probability space \(([0,1],\mathcal{F},\mathbb{P})\), define \(Y(\omega)=|2\omega-1|\). The absolute value function and the affine function \(\omega\mapsto2\omega-1\) are continuous, so their composition \(Y\) is continuous and hence a random variable. Find the event \(Y\le1/2\) and its probability.

The inequality is equivalent to $$ |2\omega-1|\le\frac12 \quad\Longleftrightarrow\quad -\frac12\le2\omega-1\le\frac12 \quad\Longleftrightarrow\quad \frac14\le\omega\le\frac34. $$ Thus \(Y^{-1}((-\infty,1/2])=[1/4,3/4]\). Both endpoints are included because the original inequality is non-strict. Its probability is $$ \mathbb{P}(Y^{-1}((-\infty,1/2]))=m([1/4,3/4])=\frac34-\frac14=\frac12. $$ Check: At either endpoint, \(Y(1/4)=|1/2-1|=1/2\) and \(Y(3/4)=|3/2-1|=1/2\), so both satisfy \(Y\le1/2\). The interval has length \(1/2\), confirming the probability.

A Common Misreading

A frequent error is to treat the values in a Borel set as if they were outcomes. In the affine example, one might incorrectly write “the event \(X\in(2,5/2]\) is \((2,5/2]\)” and then try to take its probability in \(\Omega=[0,1]\). That interval lies in the value space \(\mathbb{R}\), not in the sample space \([0,1]\), and is not the event being asked for. The correction is to take the inverse image: \(X^{-1}((2,5/2])=(1/2,3/4]\). The probability is then computed on that event in the sample space.

The measurability requirement matters for exactly this reason: a probability \(\mathbb{P}(X^{-1}(B))\) is meaningful only if \(X^{-1}(B)\) is an event in \(\mathcal{F}\). In a discrete model with the full power set as \(\mathcal{F}\), every real-valued function is measurable. In a continuous model, continuity is one convenient sufficient condition. In either setting, first identify the Borel set of values, then find its inverse image in the sample space.

Check Your Understanding

In each question, distinguish the Borel set of values from its inverse-image event.

  1. On \(\Omega=\{a,b,c\}\) with the full power set, suppose \(X(a)=1\), \(X(b)=2\), and \(X(c)=2\). Find \(X^{-1}([1,2))\).
  2. For \(X(\omega)=3\omega\) on \([0,1]\), find the inverse image of \((1,2]\), taking care with both endpoints.
  3. Why is every real-valued function on a countable sample space with its full power set measurable?
  4. State the inverse-image identity for the complement of a set, and explain how it is used in checking measurability.
  5. For \(Y(\omega)=|2\omega-1|\) on \([0,1]\), find the inverse image of \([0,1/4)\).