# Indicator function

The indicator function (also called characteristic function ) is a function in mathematics that is characterized by the fact that it only takes one or two function values. It makes it possible to grasp complex sets with mathematical precision and to define functions such as the Dirichlet function on them .

## definition

two-dimensional indicator function of a subset of a square

There are several spellings for the characteristic function in the literature. In addition to the means used here, the spellings and are also common. ${\ displaystyle \ chi _ {T}}$${\ displaystyle \ xi _ {T}}$${\ displaystyle \ mathbf {1} _ {T}}$

### Real-valued characteristic function

A basic set and a subset are given . The function defined by ${\ displaystyle X}$${\ displaystyle T \ subseteq X}$${\ displaystyle \ chi _ {T} \ colon X \ to \ {0,1 \}}$

${\ displaystyle \ chi _ {T} (x) = {\ begin {cases} 1, & {\ text {falls}} x \ in T, \\ 0, & {\ text {falls}} x \ notin T \ end {cases}}}$

is then called the characteristic function or indicator function of the set . The assignment provides a bijection between the power set and the set of all functions of into the set${\ displaystyle T}$${\ displaystyle {\ mathcal {P}} (X) \ to 2 ^ {X}, \, T \ mapsto \ mathrm {\ chi} _ {T},}$ ${\ displaystyle {\ mathcal {P}} (X)}$${\ displaystyle X}$${\ displaystyle \ {0.1 \}.}$

### Extended characteristic function

In the optimization, the characteristic function is partly defined as an extended function . Here the function is called defined by ${\ displaystyle \ chi _ {T} \ colon X \ to \ {0, + \ infty \}}$

${\ displaystyle \ chi _ {T} (x) = {\ begin {cases} 0, & {\ text {if}} x \ in T, \\ + \ infty, & {\ text {if}} x \ notin T \ end {cases}}}$

the characteristic function or indicator function of the set . It is a real function when it is not empty. ${\ displaystyle T}$${\ displaystyle T}$

### Partial characteristic function

When forming the partial characteristic function , the definition set is restricted to; in terms of partial functions , they can be described as follows: ${\ displaystyle T}$

${\ displaystyle \ chi _ {T} '\ colon X \ rightsquigarrow \ {0,1 \}, \; x \ mapsto {\ begin {cases} 1, & {\ text {if}} x \ in T, \ \ {\ text {undefined}} & {\ text {otherwise}}. \ end {cases}}}$

## Use of the different definitions

The real-valued characteristic function is often used in integration theory and stochastics , as it enables integrals of the function over the set to be replaced by integrals of over the basic set: ${\ displaystyle f}$${\ displaystyle T}$${\ displaystyle f \ cdot \ chi _ {T}}$

${\ displaystyle \ int _ {T} f \ left (x \ right) \ mathrm {d} x = \ int _ {X} f \ left (x \ right) \ cdot \ chi _ {T} \ left (x \ right) \ mathrm {d} x}$.

In this way, for example, case distinctions can often be avoided.

The extended characteristic function is used in optimization in order to restrict the function to sub-areas on which certain desired properties such as e.g. B. have convexity , or to model restriction sets.

The partial characteristic function is used in computability theory .

## Properties and calculation rules of the real-valued characteristic function

• The amount is clearly determined by its characteristic function. It applies${\ displaystyle T \ subset X}$
${\ displaystyle T = \ chi _ {T} ^ {- 1} (\ {1 \}) = \ {x \ in X \, | \, \ chi _ {T} (x) = 1 \}}$.
For thus follows from the equality of the equality of the quantities.${\ displaystyle S, T \ subset X}$${\ displaystyle \ chi _ {S} = \ chi _ {T}}$${\ displaystyle S = T}$
• The characteristic function of the empty set is the null function . The characteristic function of the basic set is the constant function with the value 1.${\ displaystyle \ chi _ {\ varnothing}}$${\ displaystyle \ chi _ {X}}$
• Let there be sets . Then applies to the intersection${\ displaystyle S, T \ subset X}$
${\ displaystyle \ chi _ {S \ cap T} = \ min (\ chi _ {S}, \ chi _ {T}) = \ chi _ {S} \ chi _ {T}}$
and for the union
${\ displaystyle \ chi _ {S \ cup T} = \ max (\ chi _ {S}, \ chi _ {T}) = \ chi _ {S} + \ chi _ {T} - \ chi _ {p } \ chi _ {T}}$.
For the difference amount is
${\ displaystyle \ chi _ {S \ setminus T} = \ chi _ {S} - \ chi _ {S} \ chi _ {T}}$.
In particular, applies to the complement ${\ displaystyle T ^ {\ mathsf {C}} = X \ setminus T}$
${\ displaystyle \ chi _ {T ^ {\ mathsf {C}}} = 1- \ chi _ {T}}$.

## Use to calculate expected value, variance and covariance

For a given probability space and event , the indicator function is a Bernoulli distributed random variable . In particular, applies to the expected value${\ displaystyle (\ Omega, {\ mathcal {F}}, \ mathrm {P})}$ ${\ displaystyle A \ in {\ mathcal {F}}}$${\ displaystyle \ chi _ {A} \ colon \ Omega \ rightarrow \ mathbb {R}}$

${\ displaystyle \ operatorname {E} (\ chi _ {A}) = \ operatorname {P} (A)}$

and for the variance

${\ displaystyle \ operatorname {Var} (\ chi _ {A}) = \ operatorname {P} (A) (1- \ operatorname {P} (A))}$.

The variance of thus assumes its maximum value in the case . ${\ displaystyle \ chi _ {A}}$${\ displaystyle {\ tfrac {1} {4}}}$${\ displaystyle \ operatorname {P} (A) = {\ tfrac {1} {2}}}$

If is additional , then applies to the covariance${\ displaystyle B \ in {\ mathcal {F}}}$

${\ displaystyle \ operatorname {Cov} (\ chi _ {A}, \ chi _ {B}) = \ operatorname {P} (A \ cap B) - \ operatorname {P} (A) \ operatorname {P} ( B)}$.

Two indicator variables are therefore uncorrelated if and only if the associated events are stochastically independent .

If there are any events, then there is the random variable ${\ displaystyle A_ {1}, A_ {2}, \ dotsc, A_ {n} \ in {\ mathcal {F}}}$

${\ displaystyle N = \ sum _ {i = 1} ^ {n} \ chi _ {A_ {i}}}$

the number of those events that have occurred. Because of the linearity of the expected value, the following then applies

${\ displaystyle \ operatorname {E} (N) = \ sum _ {i = 1} ^ {n} \ operatorname {P} (A_ {i})}$.

This formula also applies when the events are dependent. If they are also independent in pairs, then the Bienaymé equation applies to the variance

${\ displaystyle \ operatorname {Var} (N) = \ sum _ {i = 1} ^ {n} \ operatorname {Var} (\ chi _ {A_ {i}}) = \ sum _ {i = 1} ^ {n} \ operatorname {P} (A_ {i}) (1- \ operatorname {P} (A_ {i}))}$.

In the general case the variance can be calculated using the formula

${\ displaystyle \ operatorname {Var} (N) = \ sum _ {i, j = 1} ^ {n} \ operatorname {Cov} (\ chi _ {A_ {i}}, \ chi _ {A_ {j} }) = \ sum _ {i, j = 1} ^ {n} \ operatorname {P} (A_ {i} \ cap A_ {j}) - \ sum _ {i, j = 1} ^ {n} \ operatorname {P} (A_ {i}) \ operatorname {P} (A_ {j})}$

to be determined.

1. The term is also for the relation of identity or -Picture use and can easily lead to confusion.${\ displaystyle \ mathrm {1} _ {T}}$