Indicator function
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 to zero. That is, if A is a subset of some set X, then the indicator function of A is the function 1 A {\displaystyle \mathbf {1} _{A}} defined by 1 A ( x ) = 1 {\displaystyle \mathbf {1} _{A}\! (x)=1} if x ∈ A , {\displaystyle x\in A,} and 1 A ( x ) = 0 {\displaystyle \mathbf {1} _{A}\!