Search for probability and statistics terms on Statlect
Index > Fundamentals of probability

Indicator functions

by , PhD

The indicator function of an event is a random variable that takes value 1 when the event happens and value 0 when the event does not happen. Indicator functions are often used in probability theory to simplify notation and to prove theorems.

Table of Contents


The following is a formal definition.

Definition Let Omega be a sample space and $Esubseteq Omega $ be an event. The indicator function (or indicator random variable) of the event E, denoted by $1_{E}$, is a random variable defined as follows:[eq1]

While the indicator of an event E is usually denoted by $1_{E}$, sometimes it is also denoted by[eq2]where $chi $ is the Greek letter Chi.

Example We toss a die and one of the six numbers from 1 to 6 can appear face up. The sample space is[eq3]Define the event [eq4]described by the sentence "An even number appears face up". A random variable that takes value 1 when an even number appears face up and value 0 otherwise is an indicator of the event E. The case-by-case definition of this indicator is[eq5]

From the above definition, it can easily be seen that $1_{E}$ is a discrete random variable with support [eq6]and probability mass function[eq7]


Indicator functions enjoy the following properties.


The n-th power of $1_{E}$ is equal to $1_{E}$:[eq8]because $1_{E}$ can be either 0 or 1 and[eq9]

Expected value

The expected value of $1_{E}$ is equal to [eq10]:[eq11]


The variance of $1_{E}$ is equal to [eq12]. Thanks to the usual variance formula and the powers property above, we obtain[eq13]


If E and F are two events, then[eq14]because:

  1. if $omega in Ecap F$, then [eq15]and[eq16]

  2. if [eq17], then[eq18]and[eq19]

Indicators of zero-probability events

Let E be a zero-probability event and X an integrable random variable. Then,[eq20]While a rigorous proof of this fact is beyond the scope of this introductory exposition, this property should be intuitive. The random variable [eq21] is equal to zero for all sample points omega except possibly for the points $omega in E$. The expected value is a weighted average of the values $X1_{E}$ can take on, where each value is weighted by its respective probability. The non-zero values $X1_{E}$ can take on are weighted by zero probabilities, so [eq22] must be zero.

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Consider a random variable X and another random variable Y defined as a function of X.[eq23]

Express Y using the indicator functions of the events [eq24] and [eq25].


Denote by [eq26]the indicator of the event [eq27] and denote by [eq28]the indicator of the event [eq25]. We can write Y as[eq30]

Exercise 2

Let X be a positive random variable, that is, a random variable that can take on only positive values. Let $c$ be a constant. Prove that [eq31]where [eq32] is the indicator of the event [eq33].


First note that the sum of the indicators [eq32] and [eq35] is always equal to 1:[eq36]As a consequence, we can write[eq37]Now, note that [eq38] is a positive random variable and that the expected value of a positive random variable is positive:[eq39]Thus,[eq40]

Exercise 3

Let E be an event and denote its indicator function by $1_{E}$. Let $E^{c}$ be the complement of E and denote its indicator function by $1_{E^{c}}$. Can you express $1_{E^{c}}$ as a function of $1_{E}$?


The sum of the two indicators is always equal to 1:[eq41]Therefore,[eq42]

The book

Most of the learning materials found on this website are now available in a traditional textbook format.