The difference between a random variable and an event

probabilityrandom variablesstatistics

In layman terms, what is the difference between a random variable and an event? To my understanding a random variable is a function outputting a real number. And an event is an outcome or a set of outcomes.

Best Answer

This may be an instance where the most possible general definition gives more insight. Consider a pair $(\Omega, \Sigma)$ where $\Omega$ is the sample space and $\Sigma \subseteq 2^\Omega$ is a $\sigma$-algebra. The measurable sets (i.e., elements of $\Sigma$) are called events. A random variable is a measurable function $X\colon \Omega \to \Bbb R$. By measurable function we mean that for every open interval $]a,b[\subseteq \Bbb R$, we have that $X^{-1}\big(]a,b[\big) \in \Sigma$ is measurable. To put it simply:

A random variable is a nice function from the sample space to the real line (and a random vector takes values in some $\Bbb R^k$, etc.). An event is a certain subset of the sample space, to which a probability may be assigned.

This does not depend on any choice of probability. More precisely, a probability space is a triple $(\Omega, \Sigma, \Bbb P)$ where $(\Omega, \Sigma)$ is as above and $\Bbb P\colon \Sigma \to \Bbb R_{\geq 0}$ is a measure with $\Bbb P(\Omega) = 1$. Then finding $\Bbb P(X = x)$ means finding the "measure" of the event $\{\omega \in \Omega \mid X(\omega) = x\}\in \Sigma$, inside of the sample space $\Omega$.

Example: consider the experiment of tossing a fair coin $n$ times. The sample space is $\Omega = \{{\rm heads}, {\rm tails}\}^n$. The $\sigma$-algebra of events will be all possible subsets of $\Omega$. Say that we write $0$ for heads and $1$ for tails, and the random variable $X \colon \Omega \to \Bbb R$ gives the result of the second toss. That is: $X\colon \Omega \to \Bbb R$ is given by $X(\omega_1,\ldots, \omega_n)= \omega_2$. The event "getting heads on the second toss" is $X^{-1}(0) = \{ (\omega_1,\ldots, \omega_n) \in \Omega \mid \omega_2 = 0 \}$, and the probability of this happening is $\Bbb P(X = 0) = 1/2$.

Related Question