# Intuition behind “Exclusive or”

I am trying to understand the intuition behind Exclusive or.

Why it is called exclusive or? Wikipedia says: it gains the name "exclusive or" because the meaning of "or" is ambiguous when both operands are true

Wait! why "or" is ambiguous when both operands are true? Or says nothing about ambiguation.

• "It is either black or white" is (usually) exclusive while "Either I'll dance or sing" is inclusive, fullstop. – Mauro ALLEGRANZA Feb 16 '18 at 12:20

"Or" is ambiguous in daily life. Some times when people say "or", the option of both is not considered a valid option ("Will you take the red pill or the blue pill?"). Some times it is ("Did you go to some fancy school, or are you just smart?"). You have to tell from the context, which means that the word itself has both meanings and is logically ambiguous.

In the field of logic, "or" has one and only one meaning, and that is that the option of both at the same time is considered valid. However, some times you need to express the idea of "either-or", where choosing one option excludes the other. Where the case of going with both is excluded. That is what exclusive or is for.

It is not mathematically ambiguous, but rather colloquially ambiguous.

Anne: Is your car red or blue?

Bob: Yes.

Anne: ...What?

Bob: My car is both red and blue.

"Or" is ambiguous in daily life

So says @Arthur (and so say many others). But interestingly, this isn't the majority view among linguists, as I understand it. And (even if it is a bit tangential to the OP's actual question), maybe it is worth saying a bit about why.

You need a bit of key background. A standard approach to explicating how we manage to interpret what we read or hear is that the overall message conveyed is a result of the interaction of two things, first the semantic content (the "literal meaning") of the sentence used, and second contextual and pragmatic clues.

Now it is agreed on all sides, as others have been emphasizing, that when a speaker asserts something of the form A or B, sometimes the intended message is A or B though not both and sometimes the intended message is A or B or both. But -- given the standard approach -- it just doesn't follow from this that "or" in English is semantically ambiguous. For it could be that the literal meaning of "or" is inclusive disjunction, and when the overall message is understood (and/or is intended to be understood) as being exclusive, that is relying on additional pragmatic or contextual features of the occasion of utterance.

Note for example that in the sort of cases typically invoked to supposedly illustrate the uses of exclusive "or", it would -- on the semantic story -- be contradicting yourself then allow for “both". But this is not usually the case.

I say, for example, "Either there will be a peace treaty or the war will drag on another year." It is common background knowledge that peace treaties and continued war don't usually go together, so you rather naturally hear my claim as giving you exclusive alternatives. But of course it would be entirely coherent, I wouldn't be contradicting myself, if I continued "and such is the fragility of the situation, maybe both." It doesn't seem that I'm changing the literal meaning of my original claim, but just cancelling a pragmatic implication.

Note again that 'either ... or' in English seems to have a uniform semantic negation, 'neither ... nor ...' (which couldn't be the negation if 'or' is exclusive). And so it goes.

Now I'm not saying that arguments such as these are decisive (we've only scratched the surface). But I am saying it needs theoretical argument to determine which of the following views is correct: (1) "or" in English has two different literal meanings, vs (2) the literal meaning of "or" is unambiguously inclusive disjunction, and when there are intimations of exclusive alternatives these are due to pragmatic/contextual features. It is not obvious just from our linguistic behaviour which is the correct theoretical account of what is going on.

I think the ambiguity stems from the fact that there is no Boolean equivalent. Obviously one could write $A \oplus B = A \overline{B}+B \overline{A}$ and rules of simplification involving addition, multiplication, and complementation do not apply to it.

For intuition you can consider set operations with respect to element membership:

For $a \land b$ look at the intersection $A \cap B$: $x \in A \cap B \implies x \in A \land x \in B$

For $a \lor b$ look at the union $A \cup B$: $x \in A \cup B \implies x \in A \lor x \in B$

For $a \oplus b$ look at the symmetric difference $A \Delta B$: $x \in A \Delta B \implies x \in A \oplus x\in B$

Alternatively consider negations of or and xor:

a or b: $$a \lor b=\neg(\neg(a \lor b))= \lnot (\lnot a \land \lnot b)$$

i.e a or b is equivalent to negation of not a and not b. Meaning atleast one of a,b is true.

a xor b: $$a \oplus b =\lnot(a \land b) \land \lnot(\lnot a \land \lnot b)= (\lnot a \lor \lnot b) \land (a \lor b)$$

Define $a=b$ as $\lnot (a \oplus b)$:

$$(a=b)= \lnot (a \oplus b) =(a \land b) \lor (\lnot a\land\lnot b)$$

Here is a truth table:

\begin{array}{cc|c|c|c|c} a&b&a \lor b & a \land b& a \oplus b & a=b\\ \hline True&True&True&True&False&True\\ \hline False&False&False&False&False&True\\ \hline True&False&True&False&True&False\\ \hline False&True&True&False&True&False\\ \end{array}

I actually think the language used in the Wikipedia entry is a bit confusing.

Because the English 'or' can be used in two different ways, we want to have some labels to make it clear which use of 'or' we are talking about, and thus we get the difference between the 'exclusive or' and the 'inclusive or'.

That's what the Wikipedia entry means when it says:

It gains the name "exclusive or" because the meaning of "or" is ambiguous when both operands are true

... but if you read this for the first time, I can see someone would be confused: it's 'ambiguous when both operands are true'? That seems to suggest that the potential (@PeterSmith is quite right that often there is no ambiguity when we use 'or' since often the context makes clear what is meant) ambiguity is dependent on the truth of the operands, i.e. that when, say, both operands are false we do know what use of the word 'or' we intended?! No, the latter is not the case, and the ambiguity of the sentence does not go away depending on the truth of the operands, even if the truth-value of the whole sentence can determined.

So, I think things could be phrased a little better and more clear on the Wikipedia entry.

In natural language, sometimes you would say "this or that", but implicity you're saying "not both". For example, "Is your mother dead or alive?". Unless your mother is Schrödinger's cat (which is not very likely), only one of them is true.

Other times, bot option might be possible. For example "Do you want coffee or or cookies?". Well, you might want both of them.

That difference between the uses of "or" is formalized as two different logical "or".