Mathwords logoMathwords

Exclusive or

Exclusive or

A disjunction for which either statement may be true but not both.

For example, the use of the word or in "This morning I can go to school or I can stay home" is exclusive. Either option may be true but not both.

Note: Mathematicians rarely use exclusive or. In math, or is understood to be inclusive unless stated otherwise.

Key Formula

PQ=(PQ)¬(PQ)P \oplus Q = (P \lor Q) \land \lnot(P \land Q)
Where:
  • PP = First logical statement (true or false)
  • QQ = Second logical statement (true or false)
  • \oplus = The exclusive or (XOR) operator
  • \lor = Inclusive or (true when at least one is true)
  • \land = And (true only when both are true)
  • ¬\lnot = Not (negation)

Example

Problem: Determine the truth value of the exclusive or statement: "The number 10 is even XOR the number 10 is divisible by 5."
Step 1: Identify each component statement. Let P = "10 is even" and Q = "10 is divisible by 5."
Step 2: Evaluate each statement. 10 is even (true). 10 is divisible by 5 (true).
P=T,Q=TP = T, \quad Q = T
Step 3: Apply the exclusive or rule. XOR is true only when exactly one statement is true. Here both P and Q are true.
PQ=TT=FP \oplus Q = T \oplus T = F
Answer: The exclusive or statement is false, because both component statements are true. XOR requires exactly one to be true, not both.

Another Example

Problem: Build the complete truth table for the exclusive or operation P ⊕ Q.
Step 1: List all four possible combinations of truth values for P and Q.
Step 2: When P is false and Q is false, neither is true, so the result is false.
FF=FF \oplus F = F
Step 3: When P is false and Q is true, exactly one is true, so the result is true.
FT=TF \oplus T = T
Step 4: When P is true and Q is false, exactly one is true, so the result is true.
TF=TT \oplus F = T
Step 5: When P is true and Q is true, both are true (not exactly one), so the result is false.
TT=FT \oplus T = F
Answer: The XOR truth table: F⊕F = F, F⊕T = T, T⊕F = T, T⊕T = F. The output is true in exactly the two cases where the inputs differ.

Frequently Asked Questions

What is the difference between XOR and OR?
Standard OR (inclusive or) is true when at least one of the statements is true, including the case where both are true. XOR (exclusive or) is true only when exactly one statement is true. They differ in just one row of the truth table: when both inputs are true, OR gives true while XOR gives false.
Is "or" in math exclusive or inclusive?
In mathematics, "or" is almost always inclusive. This means if someone writes "x>3x > 3 or xx is even," the statement is true even if both conditions hold at the same time. Exclusive or must be stated explicitly, for instance by writing "but not both" or using the XOR symbol \oplus.

Exclusive or (XOR) vs. Inclusive or (OR)

Both are disjunctions—logical operations combining two statements. Inclusive or (PQP \lor Q) is true whenever at least one of PP or QQ is true, so it is also true when both are true. Exclusive or (PQP \oplus Q) is true only when exactly one of PP or QQ is true, and false when both are true. In everyday English, "Would you like soup or salad?" typically implies exclusive or (choose one). In mathematics, "or" defaults to inclusive unless otherwise specified.

Why It Matters

Exclusive or is fundamental in computer science and digital electronics. XOR gates are key building blocks in circuits for arithmetic, error detection, and encryption. Understanding the distinction between inclusive and exclusive or also sharpens your logical reasoning in proofs and everyday problem solving.

Common Mistakes

Mistake: Assuming that "or" in a math problem means exclusive or, just because it often means that in everyday speech.
Correction: In mathematics, "or" is inclusive by default. A statement like "nn is prime or nn is odd" is true for n=3n = 3 even though both parts hold. Exclusive or must be explicitly stated.
Mistake: Thinking XOR is true when both statements are false, since neither "wins."
Correction: XOR requires exactly one true input. When both are false, the count of true statements is zero, not one, so XOR evaluates to false.

Related Terms

  • DisjunctionGeneral term for an "or" statement in logic
  • Inclusive orThe standard "or" used in mathematics
  • ConjunctionThe logical "and" operation
  • NegationThe logical "not" operation
  • Truth tableTool for listing all outcomes of logical operations
  • LogicBranch of math studying valid reasoning