This site is supported by donations to The OEIS Foundation.

# Exclusive disjunction

Exclusive disjunction, also known as logical inequality or symmetric difference, is an operation on two logical values, typically the values of two propositions, that produces a value of true just in case exactly one of its operands is true.

An exclusive disjunction of propositions $p$ and $q$ may be written in various ways.  Among the most common are these:

• $p~\mathrm {xor} ~q$ • $p~\Delta ~q$ • $p\neq q$ • $p+q$ A truth table for $p+q$ appears below:

 $p$ $q$ $p+q$ $\mathrm {F}$ $\mathrm {F}$ $\mathrm {F}$ $\mathrm {F}$ $\mathrm {T}$ $\mathrm {T}$ $\mathrm {T}$ $\mathrm {F}$ $\mathrm {T}$ $\mathrm {T}$ $\mathrm {T}$ $\mathrm {F}$ The exclusive disjunction of two variables belongs to the family of minimal negation operators.  Thus, we have the following equivalents:

• $p+q$ • $\nu (p,q)$ • ${\texttt {(}}p{\texttt {,}}q{\texttt {)}}$ A logical graph for $p+q$ is shown below:

The traversal string of this graph is ${\texttt {(}}p{\texttt {,}}q{\texttt {)}}.$ The proposition $p+q$ may be taken as a Boolean function $f(p,q)$ having the abstract type $f:\mathbb {B} \times \mathbb {B} \to \mathbb {B} ,$ where $\mathbb {B} =\{0,1\}$ is interpreted in such a way that $0$ means $\mathrm {false}$ and $1$ means $\mathrm {true} .$ A Venn diagram for $p+q$ indicates the region where $p+q$ is true by means of a distinctive color or shading.  In this case the region is two single cells, as shown below:

## Document history

Portions of the above article were adapted from the following sources under the GNU Free Documentation License, under other applicable licenses, or by permission of the copyright holders.