Search for probability and statistics terms on Statlect
StatLect

Indicator function

by , PhD

The indicator function of an event is a random variable that takes:

Indicator functions are also called indicator random variables.

Table of Contents

Things to remember

To understand the following definition, you need to remember that a random variable X is a function:

If omega in Omega is one of the possible outcomes, then [eq1] is the value taken by X when the realized outcome is omega.

Also remember that an event E is a subset of the sample space Omega.

Definition

Here is the definition.

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

Sometimes we also use the notation[eq3]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[eq4]

Define the event [eq5]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[eq6]

Indicators are discrete variables

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

Properties

Indicator functions enjoy the following properties.

Powers

The n-th power of $1_{E}$ is equal to $1_{E}$:[eq9]

Proof

This is a consequence of the facts that $1_{E}$ can be either 0 or 1, and[eq10]

Expected value

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

Proof

The proof is as follows: [eq12]

Variance

The variance of $1_{E}$ is equal to [eq13]

Proof

Thanks to the usual variance formula and the powers property above, we obtain[eq14]

Intersections

If E and F are two events, then[eq15]

Proof

If $omega in Ecap F$, then [eq16]and[eq17]If [eq18], then[eq19]and[eq20]

Indicators of zero-probability events

Let E be a zero-probability event and X an integrable random variable. Then,[eq21]

Proof

While a rigorous proof of this fact is beyond the scope of this introductory exposition, this property should be intuitive. The random variable $X1_{E}$ is equal to zero for all the 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.

Very similar concepts

In probability theory and statistics, there are two important concepts that are almost identical to that of an indicator variable:

  1. the Bernoulli distribution;

  2. the dummy variable.

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].

Solution

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].

Solution

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}$?

Solution

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

How to cite

Please cite as:

Taboga, Marco (2021). "Indicator function", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/fundamentals-of-probability/indicator-functions.

The books

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