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.
The following is a formal definition.
Definition
Let
be a sample space and
be an event. The indicator
function (or indicator random variable) of the event
,
denoted by
,
is a random variable defined as
follows:
While the indicator of an event
is usually denoted by
,
sometimes it is also denoted
by
where
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
isDefine
the event
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
.
The case-by-case definition of this indicator
is
From the above definition, it can easily be seen that
is a discrete random
variable with
support
and
probability mass
function
Indicator functions enjoy the following properties.
The
-th
power of
is equal to
:
because
can be either
or
and
The expected value of
is equal to
:
The variance of
is equal to
.
Thanks to the usual variance
formula and the powers property above, we
obtain
If
and
are two events,
then
because:
if
,
then
and
if
,
then
and
Let
be a zero-probability event and
an integrable random
variable.
Then,
While
a rigorous proof of this fact is beyond the scope of this introductory
exposition, this property should be intuitive. The random variable
is equal to zero for all sample points
except possibly for the points
.
The expected value is a weighted average of the values
can take on, where each value is weighted by its respective probability. The
non-zero values
can take on are weighted by zero probabilities, so
must be zero.
Below you can find some exercises with explained solutions.
Consider a random variable
and another random variable
defined as a function of
.
Express
using the indicator functions of the events
and
.
Denote by
the
indicator of the event
and denote by
the
indicator of the event
.
We can write
as
Let
be a positive random variable, that is, a random variable that can take on
only positive values. Let
be a constant. Prove that
where
is the indicator of the event
.
First note that the sum of the indicators
and
is always equal to
:
As
a consequence, we can
write
Now,
note that
is a positive random variable and that the
expected value of a positive random
variable is
positive:
Thus,
Let
be an event and denote its indicator function by
.
Let
be the complement of
and denote its indicator function by
.
Can you express
as a function of
?
The sum of the two indicators is always
equal to
:
Therefore,
Please cite as:
Taboga, Marco (2021). "Indicator functions", Lectures on probability theory and mathematical statistics. Kindle Direct Publishing. Online appendix. https://www.statlect.com/fundamentals-of-probability/indicator-functions.
Most of the learning materials found on this website are now available in a traditional textbook format.