Turning an Event Into a Random Variable
A probability question usually begins with an event: a measurement falls in a range, a count exceeds a threshold, or a specified outcome occurs. An indicator turns that event into a numerical random variable: it records 1 when the event occurs and 0 otherwise. This simple encoding makes a direct connection between probabilities and expectations.
The connection is useful in its own right. It also gives a flexible way to express probabilities defined by a random variable, whether its distribution is discrete, continuous, or mixed. The key is to identify the event precisely before calculating.
An indicator is not a new probability model. It is a numerical description of whether a particular event occurred. For example, if \(A\) is the event that a patient’s measurement exceeds a clinical threshold, then \(\mathbf{1}_A\) equals 1 for measurements above the threshold and 0 for all others.
The Expectation of an Event Indicator
The fundamental identity follows directly from the two possible values of the indicator. On \(A\), its value is 1; outside \(A\), its value is 0. The expectation therefore weights 1 by the probability of \(A\) and 0 by the probability of its complement.
Proof. The indicator is a finite-valued random variable, so its expectation is the sum of each possible value multiplied by the probability of that value. The event \(\{\mathbf{1}_A=1\}\) is \(A\), and \(\{\mathbf{1}_A=0\}\) is \(A^c\). Thus
Equivalently, using the definition of expectation as an integral, \(E[\mathbf{1}_A]=\int \mathbf{1}_A\,dP=\int_A 1\,dP=P(A)\). In either calculation, no independence assumption is needed, and no restriction is placed on the probability of \(A\). \(\square\)
The theorem does not say that an indicator always equals the probability of its event. For a particular outcome, the indicator is either 0 or 1. The probability is the average value of that random variable over the probability model.
Events Defined by a Random Variable
Suppose \(X\) is a real-valued random variable and \(B\) is a Borel set. The event that \(X\) lands in \(B\) is \(\{X\in B\}\), and its indicator can be written as \(\mathbf{1}_{\{X\in B\}}\). It can also be written as \(\mathbf{1}_B(X)\): evaluate the indicator function of the set \(B\) at the value of \(X\).
Proof. For every outcome \(\omega\), if \(X(\omega)\in B\), both indicators equal 1. If \(X(\omega)\notin B\), both equal 0. Hence the random variables agree pointwise. Since \(X\) is measurable and \(B\) is Borel, \(\{X\in B\}\) is an event, so the indicator identity just proved applies:
For a discrete \(X\) with probability mass function \(f\), this expectation can be calculated as \(\sum_x \mathbf{1}_B(x)f(x)\): terms for values in \(B\) remain, and terms outside \(B\) become zero. For a continuous \(X\) with density \(f\), the corresponding integral is \(\int \mathbf{1}_B(x)f(x)\,dx=\int_B f(x)\,dx\). These are applications of LOTUS: the function applied to \(X\) is the indicator of the set of interest. \(\square\)
Worked Applications
Worked Example: A Discrete Event
Let \(X\) be the result of a fair six-sided die roll, so \(P(X=x)=1/6\) for \(x=1,2,3,4,5,6\). Find the probability that \(X\geq 4\) by using an indicator.
Define \(B=\{4,5,6\}\). The event of interest is \(\{X\in B\}\), and its indicator is 1 for die rolls 4, 5, or 6 and 0 for rolls 1, 2, or 3. By the indicator identity,
The first three terms are zero and the final three terms each equal \(1/6\), so
The indicator calculation gives the same result as adding the probabilities of the three outcomes in the event. Its advantage is that the event is now represented as an expectation, so the same idea applies even when an event is described by an interval or a more complicated set.
Worked Example: A Normal Interval Probability
Suppose \(X\sim N(10,4)\), where the second parameter is the variance. Find \(P(8<X\leq 12)\) using an indicator.
Let \(B=(8,12]\). The event indicator is \(\mathbf{1}_B(X)\), and its expectation is the desired probability. The standard deviation is \(\sigma=2\), so standardizing the endpoints gives
If \(\Phi\) denotes the standard normal CDF, the probability is \(\Phi(1)-\Phi(-1)\). Numerically, the interval probability is approximately \(0.682689\), which rounds to
The normal distribution has no point masses, so including or excluding either endpoint does not change this probability. For a distribution with atoms, endpoint choices can matter; the event indicator must then match the stated interval exactly.
Worked Example: A Mixed Distribution and Its Atom
Let \(X\) have probability \(0.3\) at zero and, on \(x>0\), density \(f(x)=0.7e^{-x}\). This is a valid mixed distribution: the atom contributes \(0.3\), and the continuous part has total probability \(0.7\int_0^\infty e^{-x}\,dx=0.7\). Find \(P(0\leq X\leq 1)\).
For \(B=[0,1]\), the indicator \(\mathbf{1}_B(X)\) equals 1 at the atom \(X=0\) and for continuous values between 0 and 1; it equals 0 outside that range. The mixed expectation includes both the atom and the continuous contribution:
The atom at zero is included because the event uses the endpoint \(0\leq X\). The density contributes the probability over the continuous part from 0 to 1. Even though a single endpoint has zero probability under the continuous component, the atom at zero has probability \(0.3\), so it cannot be discarded.
Interval Events and the CDF
Indicators also clarify which CDF formula corresponds to a chosen interval. Define \(F(x)=P(X\leq x)\). For real numbers \(a\leq b\), the events \(\{X\leq a\}\) and \(\{a<X\leq b\}\) are disjoint, and their union is \(\{X\leq b\}\). Therefore the interval probability is a difference of CDF values.
Proof. The event \(\{X\leq b\}\) is the disjoint union of \(\{X\leq a\}\) and \(\{a<X\leq b\}\). Additivity of probability gives
Rearranging yields \(P(a<X\leq b)=F(b)-F(a)\). The indicator identity gives \(E[\mathbf{1}_{\{a<X\leq b\}}]=P(a<X\leq b)\), proving the result. \(\square\)
This formula is valid for discrete, continuous, and mixed distributions, but its endpoint convention matters. In particular, \(F(b)-F(a)\) describes \(a<X\leq b\), not \(a\leq X\leq b\). When \(X\) has an atom at \(a\), including that endpoint adds \(P(X=a)\).
Why the Indicator View Helps
A probability question can be approached in two compatible ways: identify the event and calculate its probability directly, or write its indicator and calculate the expectation. The second approach is especially useful when applying LOTUS, because it connects the event to the distribution of \(X\) through a function of \(X\). The function is simple—zero outside the event and one inside it—but the event itself can be chosen to match the question.
For a discrete distribution, the indicator removes all mass outside the event. For a continuous distribution, it restricts the density integral to the event’s region. For a mixed distribution, it selects the relevant atoms and the relevant portions of the continuous component. In every case, the same identity remains valid.
Common Mistake: Treating the Indicator as Its Expectation
A frequent error is to say, “The indicator is 1 on the event, so its expectation is 1.” This confuses the value of a random variable on some outcomes with its average across all outcomes. The indicator is also 0 outside the event, and those outcomes contribute to the expectation through their probability.
For instance, if \(P(A)=0.2\), then \(\mathbf{1}_A\) equals 1 with probability \(0.2\) and 0 with probability \(0.8\). Consequently,
not 1. The correction is to calculate the expectation using both possible indicator values and their probabilities—or apply the theorem \(E[\mathbf{1}_A]=P(A)\).
Check Your Understanding
For each question, first identify the event and then decide how its indicator represents that event.
- If \(P(A)=0.37\), what are the two possible values of \(\mathbf{1}_A\), and what is \(E[\mathbf{1}_A]\)?
- For a real-valued random variable \(X\), write an indicator whose expectation equals \(P(X>5)\).
- Suppose \(F(x)=P(X\leq x)\). Which interval event has probability \(F(9)-F(4)\)?
- Why might \(P(0\leq X\leq 1)\) differ from \(P(0<X\leq 1)\) for a mixed distribution?
- A fair die is rolled. Express the probability of rolling an even number as an expectation and calculate it.