# How to find the subset of a characteristic function?

For example, given the characteristic function XA + XB - XA $$\cap$$ B where A and B and subsets of set S.

How to find the subset of the characteristic function?

Let $$f = \chi_A + \chi_B - \chi_{A \cap B}$$. Note that $$f(x) = 1$$ if and only if $$\chi_A(x) + \chi_B(x) = \chi_{A \cap B}(x) + 1$$ and, since each term is either $$0$$ or $$1$$, the latter happens if and only if the following cases holds:

• $$\chi_A(x) = 1$$, $$\chi_B(x) = 0$$ and $$\chi_{A \cap B}(x) = 0$$.

• $$\chi_A(x) = 0$$, $$\chi_B(x) = 1$$ and $$\chi_{A \cap B}(x) = 0$$.

• $$\chi_A(x) = \chi_B(x) = \chi_{A \cap B}(x) = 1$$.

Now, the first two cases just tell us that $$x$$ must be in $$A$$ or $$B$$ but not in both; and of course, the latter tell us that $$x$$ must be in both. The only way that this happens is that $$x$$ is in $$A \cup B$$ (think about it, there is no other situation).

So, we prove that $$f(x)=1$$ if and only if $$x \in A \cup B$$. Hence, $$f = \chi_{A \cup B}$$.

$$X_A=X_{A\cap B}+X_{A\setminus B}$$ and $$X_B=X_{A\cap B}+X_{B\setminus A}$$. Hence $$X_A+X_B-X_{A\cap B}=X_{A\setminus B}+X_{B\setminus A}+X_{A\cap B}=X_{A\cup B}$$