In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, an indicator function or a characteristic function of a
subset
In mathematics, Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), 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 ...
of a
set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
is a
function
Function or functionality may refer to:
Computing
* Function key, a type of key on computer keyboards
* Function model, a structured representation of processes in a system
* Function object or functor or functionoid, a concept of object-oriente ...
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
In mathematics, the Dirichlet function is the indicator function 1Q or \mathbf_\Q of the set of rational numbers Q, i.e. if ''x'' is a rational number and if ''x'' is not a rational number (i.e. an irrational number).
\mathbf 1_\Q(x) = \begin
1 ...
is the indicator function of the
rational number
In mathematics, a rational number is a number that can be expressed as the quotient or fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (e.g. ). The set of all ration ...
s as a subset of the
real number
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every real ...
s.
Definition
The indicator function of a subset of a set is a function
defined as
The
Iverson bracket provides the equivalent notation,