In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements of the set to zero. The indicator function of a subsetA of a set X maps X to the two-element set if an element in X belongs to A, and if does not belong to A. It may be denoted as by or by The Dirichlet function, the indicator function of the rational numbers as a subset of the real numbers, is an example of an indicator function.