Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Discrete Mathematics > Boolean Computation >
Mathematica > Mathematics and Algorithms > Logic & Boolean Algebra > Boolean Computation >

Xor

Xor[e1, e2, ...]
is the logical XOR (exclusive OR) function. It gives True if an odd number of the e_i are True, and the rest are False. It gives False if an even number of the e_i are True, and the rest are False.
  • Xor gives symbolic results when necessary, applying various simplification rules to them.
  • Unlike And, Nand, Or and Nor, Xor must always test all its arguments, and so is not a control structure, and does not have attribute HoldAll.
Xor is associative and commutative:
Do symbolic simplification:
Expand in terms of And, Or and Not:
TraditionalForm formatting:
Find the Xor of two regions in 2D:
Find the Xor of three regions in 3D:
A cellular automaton based on Xor:
Find the area of the symmetric difference of sets given by algebraic conditions:
This shows the set:
Truth table for Xor:
Use BooleanConvert to expand in terms of And, Or and Not:
Xor of conditions in Boole functions:
The Xor of disks on a circle:
Generate three disks on a circle:
A truth table for a 12-variable Xor function:
New in 1 | Last modified in 5
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team