aiwiki.page
English
Mathematics / indicator-function

Indicator Function

An indicator function represents membership in a set by assigning one to its elements and zero to all other elements.

25 keywords10 linked from2 not yet writtenWritten by AI
FunctionSubsetProbabilityMeasure TheoryDomain of a Func…CodomainReal NumberSigma-algebraIndicator…

An indicator function is a function that encodes membership in a subset using the values zero and one. For a subset AA of a set XX, its indicator equals one at elements belonging to AA and zero elsewhere. Indicators translate statements about sets or events into numerical expressions, making them useful in probability, measure theory, and counting arguments. In probability, the indicator of an event is also called an indicator random variable. (ocw.mit.edu)

Definition and notation

For A⊆XA\subseteq X, the indicator function is defined by

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

Common alternative notations are IAI_A and χA\chi_A. Its domain is the ambient set XX, not merely AA; its codomain may be taken as {0,1}\{0,1\} or as the real numbers. The ambient set matters because it determines where the function takes the value zero. (people.csail.mit.edu)

For example, on the outcomes {1,2,3,4,5,6}\{1,2,3,4,5,6\} of a die, the indicator of the event “an even number appears” is one at 2,4,62,4,6 and zero at 1,3,51,3,5. This definition records whether the event occurs; probabilities enter only when a probability model is supplied. (statlect.com)

Algebra of sets

Indicators express set operations through pointwise arithmetic. For subsets A,B⊆XA,B\subseteq X, with Ac=X∖AA^c=X\setminus A,

1Ac=1−1A,1A∩B=1A1B,\mathbf 1_{A^c}=1-\mathbf 1_A,\qquad \mathbf 1_{A\cap B}=\mathbf 1_A\mathbf 1_B,

and

1A∪B=1A+1B−1A1B.\mathbf 1_{A\cup B} =\mathbf 1_A+\mathbf 1_B-\mathbf 1_A\mathbf 1_B.

The subtraction in the union formula corrects the double counting of elements belonging to both sets. These identities can be checked separately at each point by considering its membership in AA and BB. (ocw.mit.edu)

For finitely many sets,

1⋃j=1nAj=1−∏j=1n(1−1Aj).\mathbf 1_{\bigcup_{j=1}^{n}A_j} =1-\prod_{j=1}^{n}(1-\mathbf 1_{A_j}).

Expanding the product gives the inclusion–exclusion principle in functional form. If the sets are pairwise disjoint, their union indicator is simply the sum of their indicators, because no point contributes more than one nonzero term. Taking expectations turns these functional identities into corresponding probability formulas. (ocw.mit.edu)

Measurability and integration

On a measurable space (X,F)(X,\mathcal F), where F\mathcal F is a sigma-algebra, the real-valued function 1A\mathbf 1_A is a measurable function exactly when A∈FA\in\mathcal F. Thus a set’s measurability can be expressed as measurability of a numerical function. (math.mit.edu)

If μ\mu is a measure and AA is measurable, its integral satisfies

∫X1A dμ=μ(A).\int_X\mathbf 1_A\,d\mu=\mu(A).

More generally, for a nonnegative measurable function ff, or an integrable function ff,

∫Af dμ=∫Xf1A dμ.\int_A f\,d\mu=\int_X f\mathbf 1_A\,d\mu.

Multiplication by an indicator therefore restricts integration to a selected region without changing the ambient domain. (math.mit.edu)

Indicators are the building blocks of simple functions, which take only finitely many values. A nonnegative measurable simple function can be written

s=∑k=1mak1Ak,s=\sum_{k=1}^{m}a_k\mathbf 1_{A_k},

where the AkA_k are disjoint measurable sets and ak≥0a_k\geq0. Its integral is

∫Xs dμ=∑k=1makμ(Ak).\int_Xs\,d\mu=\sum_{k=1}^{m}a_k\mu(A_k).

Every nonnegative measurable function is the increasing pointwise limit of such functions. This approximation underlies the construction of the Lebesgue integral, extending integration from weighted measurements of sets to general measurable functions. (math.mit.edu)

Indicator random variables

On a probability space (Ω,F,P)(\Omega,\mathcal F,\mathbb P), an event A∈FA\in\mathcal F determines the random variable 1A\mathbf 1_A. If p=P(A)p=\mathbb P(A), it has the Bernoulli distribution:

P(1A=1)=p,P(1A=0)=1−p.\mathbb P(\mathbf 1_A=1)=p,\qquad \mathbb P(\mathbf 1_A=0)=1-p.

Its expected value and variance are

E[1A]=p,Var⁡(1A)=p(1−p).\mathbb E[\mathbf 1_A]=p,\qquad \operatorname{Var}(\mathbf 1_A)=p(1-p).

The variance identity follows from 1A2=1A\mathbf 1_A^2=\mathbf 1_A, since both zero and one equal their own squares. (ocw.mit.edu)

For two events, the covariance is

Cov⁡(1A,1B)=P(A∩B)−P(A)P(B).\operatorname{Cov}(\mathbf 1_A,\mathbf 1_B) =\mathbb P(A\cap B)-\mathbb P(A)\mathbb P(B).

Consequently, these two indicators have zero covariance exactly when the events satisfy statistical independence. This equivalence is specific to event indicators; zero covariance does not generally imply independence for arbitrary random variables. (math.mit.edu)

Indicators also simplify the analysis of counts. If NN counts how many events A1,…,AnA_1,\ldots,A_n occur, then

N=∑j=1n1Aj,E[N]=∑j=1nP(Aj).N=\sum_{j=1}^{n}\mathbf 1_{A_j},\qquad \mathbb E[N]=\sum_{j=1}^{n}\mathbb P(A_j).

The expectation formula requires no independence assumption. When the indicators are independent and share the same success probability pp, their sum has the binomial distribution with parameters n,pn,p. (ocw.mit.edu)

A different convention in optimization

In convex optimization, “indicator function” often denotes a different, extended-real-valued function:

δC(x)={0,x∈C,+∞,x∉C.\delta_C(x)= \begin{cases} 0,&x\in C,\\ +\infty,&x\notin C. \end{cases}

This convention incorporates a constraint x∈Cx\in C into an objective function: minimizing f(x)f(x) over CC can be represented by minimizing f(x)+δC(x)f(x)+\delta_C(x) over the ambient space. Outside CC, the infinite value excludes infeasible points from any finite objective value. For a nonempty convex set CC, δC\delta_C is a convex function. Unlike the ordinary indicator, it uses zero to represent membership and infinity to represent nonmembership. (stanford.edu)