# 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.

The truth table of ${\displaystyle p~\operatorname {XOR} ~q,}$ also written ${\displaystyle p+q\!}$ or ${\displaystyle p\neq q,\!}$ appears below:

 ${\displaystyle p\!}$ ${\displaystyle q\!}$ ${\displaystyle p~\operatorname {XOR} ~q}$ ${\displaystyle \operatorname {F} }$ ${\displaystyle \operatorname {F} }$ ${\displaystyle \operatorname {F} }$ ${\displaystyle \operatorname {F} }$ ${\displaystyle \operatorname {T} }$ ${\displaystyle \operatorname {T} }$ ${\displaystyle \operatorname {T} }$ ${\displaystyle \operatorname {F} }$ ${\displaystyle \operatorname {T} }$ ${\displaystyle \operatorname {T} }$ ${\displaystyle \operatorname {T} }$ ${\displaystyle \operatorname {F} }$

The following equivalents may then be deduced:

 ${\displaystyle {\begin{matrix}p+q&=&(p\land \lnot q)&\lor &(\lnot p\land q)\\[6pt]&=&(p\lor q)&\land &(\lnot p\lor \lnot q)\\[6pt]&=&(p\lor q)&\land &\lnot (p\land q)\end{matrix}}}$

## 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.