In
mathematics, an indicator function or a characteristic function of a
subset
In mathematics, set ''A'' is a subset of a set ''B'' if all elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they are unequal, then ''A'' is a proper subset o ...
of a
set is a
function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , one has
if
and
otherwise, where
is a common notation for the indicator function. Other common notations are
and
The indicator function of is the
Iverson bracket of the property of belonging to ; that is,
:
For example, the
Dirichlet function is the indicator function of the
rational numbers as a subset of the
real number
In mathematics, a real number is a number that can be used to measurement, measure a ''continuous'' one-dimensional quantity such as a distance, time, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small var ...
s.
Definition
The indicator function of a subset of a set is a function
defined as
The
Iverson bracket provides the equivalent notation,