# What is the relationship between event and random variable?

I've been told that an event is just a random variable that has been assigned, and that random variables are a generalisation of events. However, I can't relate that to the definition of an event as a subset of the sample space. Moreover, an event can either happen or not, whereas a random variable can have multiple outcomes.

Are events like binary random variables? If so, then is each outcome of a random variable really an event?

I also need to know how the two concepts relate to each other in terms of conditional independence.

Let the experiment be given by $$\DeclareMathOperator{\P}{\mathbb{P}} \DeclareMathOperator{\E}{\mathbb{E}} (\mathbb{X},\mathbb{B}, \P)$$ where $$\mathbb{X}$$ is the sample space, $$\mathbb{B}$$ is the set of all events (subsets of $$\mathbb{X}$$ which we assign a probability) and $$\P$$ is the probability measure. Points of $$\mathbb{X}$$ are denoted $$\omega$$, and are the "elementary events" (or "outcomes"). Random variables on this experiment are functions $$f \colon \mathbb{X}\mapsto \mathbb{R}$$ and are written like $$f(\omega)$$, meaning that their value are determined by the elementary outcome $$\omega$$.

Corresponding to the event $$A$$ is the indicator random variable $$I_A(\omega) = \begin{cases} 1 ~\text{if A occurs, that is, \omega\in A.} \\ 0 ~\text{if A do not occur, that is \omega \not\in A.} \end{cases}$$ In this sense, events can be embedded as a subset of the set of all random variables defined for this experimental setup. Then the probability of $$A$$ occurring can be written as an expectation $$\P(A) = \E I_A.$$

To the additional question in comments: If $$A$$ and $$B$$ are independent (as events), then $$I_A$$ and $$I_B$$ are independent (as random variables). "Can we say that $$I_A=1$$ and $$I_B=1$$ are independent?" Well, $$I_A=1$$ is simply the event $$A$$, so I think you can answer now!

• Thank you but I still don't understand. What does the omega mean? And this leads me to the question: if two events A and B are independent, do we say I_A and I_B are independent? More importantly, can we say that I_A=1 and I_B=1 are independent? Nov 26, 2015 at 15:05
• Good answer, but I wouldn't use the term "elementary events" since they may not belong to $\mathbb B$. The usual term is "outcomes". Nov 27, 2015 at 9:12
• It is just independence of events. $I_A=i$ is an event, and so on. Nov 27, 2015 at 11:57
• +1 Nice! Check your sentence "events can be imbedded as a subset as the set of all random variables defined for this experimental setup". Also a couple of latex expressions didn't come through at the end. Dec 6, 2015 at 16:45
• @drozzy: $A$ is an event $I_A$ is the corresponding indicator random variable, defined by $I_A(\omega)=1$ if $\omega \in A$ and zero otherwise. "$A$ occurs " means that the outcome $\omega \in A$, so that $I_A=1$. Sep 29, 2018 at 15:58

Yes, events are like Boolean (you said binary but I take it this is what you mean) random variables or more precisely for every event there is a corresponding Boolean random variable. Different communities use slightly different terminology (indicator function, characteristic function, predicate) for the same thing, and the output type may be $\{0,1\}$ or $\{False, True\}$.

You raised the point:

an event can happen or not whereas a random variable can have multiple outcomes.

I think probability texts often don't do enough to describe why the axioms of probability are the way they are, so I'll give a very hand-waving go at it:

Suppose you were inventing the foundations of probability theory. Your first stab might be to say there's some set of possible ways the world could be: $X$, and some kind of function which assigns probabilities to each of these possibilities $f: X \to [0,1]$. For example we could say that $X$ is the set of numbers 1 to 6 from a die roll and $f(x) = 1/6$.

Soon you would find this a little restrictive because you want to talk about subsets of possible worlds, i.e. what if the die roll is greater than 3. So you adjust your theory and instead assign probabilities to sets $\mu: \mathcal{P}(X) \to [0,1]$ where $\mathcal{P}$ denotes the set of all subsets. Each one of these subsets you call an event, and when you say an event occured what you really mean is that the real world turned out to be one of the possible worlds in that event. $\mu$ can't just assign probabilities to sets arbitrarily, it should be consistent with $f$ and common sense.

You're almost satisfied but then you realise there are other things you want to model that weren't initially accounted for in $X$. For example you want to talk about the probability that the die bounces three times. More generally, putting your philosopher hat on, you decide its impossible (or at least very difficult) to talk about the real world, we can only talk about our limited observations of it. So instead you construct a new object $\Omega$ which represents a richer model of the world (for example maybe it's a very accurate physical simulation of a die rolling, or even of the whole universe) but you are only allowed to talk about it with random variables.

You can now instead define $X$ as random variable (a function $\Omega \to \mathbb{N}$), and many others which each talk about properties of interest. For every set of outcomes of a random variable (with a single outcome being just a special case) there is always a corresponding set of possible worlds (subset of $\Omega$), the event.

For purposes of understanding we will limit ourselves to finite sample spaces.

Firstly in answer to your question, no, the outcome of a random variable is not an event. A random variable takes as its input an element of the sample space and outputs a real number.

For example, suppose we draw a ball from an urn having 3 balls labelled A, B and C. The sample space of all balls in the urn is S = {A, B, C}. There are 8 possible events: {}, {A}, {B}, {C}, {A, B}, {A, C}, {B, C}, {A, B, C}. The event {B, C} means that the ball drawn is either B or C.

A random variable is a real valued function on the sample space. If random variable X assigns 10 to A, 10 to B and 30 to C then if A is drawn the realized value of X is 10, a real number, not an event.

If x is a number then the event corresponding to X = x is the set of sample space elements which are mapped by X to x. In the current example, the event corresponding to X = 10 is {A, B} as both A and B are mapped to 10 and C is not.

The above relationship between random variables and events extends to other concepts. For example, random variables X and Y are independent if for each pair of real numbers x and y the events X = x and Y = y are independent. Similarly X and Y are conditionally independent given Z if the events X = x and Y = y are conditionally independent given the event Z = z.

(I am assuming here that the question is about the relationship between events and random variables and not about the definitions of probability, independence and conditional independence which we have assumed.)

• Nice Explanation. Thank you. Aug 16, 2021 at 3:12
• Restating to make sure I understand: The sample space is the set of outcomes and combinations of outcomes. A random variable is a function that maps outcomes to real numbers. An event is a set of outcomes, these being specified as a certain real number output from the random variable. An event can cover a subset of outcomes because random variables can give the same output for more than one outcome. A random variable has as many events associated with it as it has different outputs. So a random variable describes what can happen, and an event specifies 1 of these options. Nov 13, 2022 at 14:49
• In the case of this example an outcome is an element in the sample space (not a combination) and an event is a subset of the sample space. An event occurs if any of its elements occur. A random variable is a function from the sample space to the reals. The concept of event is more basic than the concept of random variable. One can consider the event {x | X(x) belongs to a T} where X is a random variable and T is a subset of the real numbers so one can consider more than just the inverse of individual real numbers so last statement in comment is incorrect. More general formulations exist. Nov 13, 2022 at 15:32