Characteristic function (indicator function)

The function that records membership in a set by 0/1 values.
Characteristic function (indicator function)

Let XX be a set and let AXA\subseteq X. The characteristic function (or indicator function) of AA is the function 1A:X{0,1}\mathbf{1}_A:X\to\{0,1\} defined by

1A(x):={1,xA,0,xA. \mathbf{1}_A(x):= \begin{cases} 1,& x\in A,\\ 0,& x\notin A. \end{cases}

Indicator functions convert set membership questions into algebraic statements and are a standard device in integration and measure theory (e.g., simple functions are finite linear combinations of indicators).

Examples:

  • If X=RX=\mathbb{R} and A=[0,1]A=[0,1], then 1A(x)=1\mathbf{1}_A(x)=1 for x[0,1]x\in[0,1] and 00 otherwise.
  • If A=A=\varnothing, then 1A\mathbf{1}_A is the constant-00 function on XX.
  • If A=QRA=\mathbb{Q}\subseteq\mathbb{R}, then 1Q\mathbf{1}_{\mathbb{Q}} is 11 on rationals and 00 on irrationals (a classical highly discontinuous function).