Return to SmartTutor selection page Core 5 - Formal Logic Return to Learning Center home page
Tell us what you think about this tutorial! Take the survey.

LOGIC MAIN PAGE

LOGICAL OPERATORS

Sample sentences
AND operator
IF/THEN operator
NOT operator
OR operator
XOR operator

RULES OF LOGIC

Chain Rule
Conjunctive Addition
Contrapositive
DeMorgan's Law
Disjunctive Addition
Disjunctive Inference
Disjunctive Infer. (XOR)
Double Negation
Modus Ponens
Modus Tollens
Mutual Exclusion
Simplification

VALIDITY PROOFS

2-step
3-step
4-step
5-step or more
Bad Argument

XOR Operator

The logical operator XOR (symbolized XOR) is called the exclusive disjunction.

It is used to join two statements to assert that exactly one of the statements is true, but not both. XOR is exclusive. Here is an example:

The new baby is a boy or a girl.

It is essential not to confuse the XOR, described here, with the inclusive OR. In the example given above, there are only two possibilities: The new baby can be a boy, or it can be a girl. It cannot be a boy and a girl at the same time. This is the exclusive nature of XOR: It asserts that only one statement in an expression is true, thereby excluding the other one.

In formal logic, we can replace the two statements with the letters p and q (we can use any other letters that we want to). So, let the statement "The new baby is a boy" be p and let the statement "The new baby is a girl" be q.

Now we can rewrite our example in the formal way:

p XOR q: "The new baby is a boy or a girl."

This is a logical expression. In this expression, p and q are called exclusive disjuncts.

 

Truth table for XOR

A truth table lists truth values (that is, either true or false) for every possible combination of component values in a logical expression.

In order to build a truth table for XOR, we need to consider the simplest example of an exclusive disjunction:

p XOR q: "The new baby is a boy or a girl."

In formal logic, p and q (called exclusive disjuncts) can take on two possible values: true or false. How many combinations of p and q can we come up with? The answer is four. Let us list all the possible combinations:

1. p is true and q is true
2. p is true and q is false
3. p is false and q is true
4. p is false and q is false

We know that an exclusive disjunction is true when exactly one disjunct is true. There are two cases in which this is valid -- it's the second and the third cases. Now we can build a truth table. We are using T for true and F for false.

p
q
p XOR q
T
T
F
T
F
T
F
T
T
F
F
F

As you read the table, you will notice that when p is true and q is true, the entire expression is true. When p is true and q is false, the entire expression is false, and so on.

 

Commutativity of Exclusive Disjunction

We can write p XOR q or q XOR p -- these two expressions are equivalent. It's the same as the phrase "My balance is positive or it's zero" is completely equivalent to "My balance is zero or it's positive."

 

Rules of Exclusive Disjunction

These are links to specific rules pertinent to the XOR operator.

Mutual Exclusion
Disjunctive Inference (XOR)

 

See also

OR operator