Simple way to write set of elements that are in either set but not both

1.7k Views Asked by At

Consider two sets $P$ and $P$'. I am trying to find the simplest notation denoting all elements that are in either $P$ or $P'$ but not both. I think this is $(P\cup P')\setminus (P\cap P')$. Is there any symbol in set notation already reserved for this operation?

2

There are 2 best solutions below

12
On

You're looking for the Symmetric Difference of two sets: $$P \triangle P'= \{x\mid (x \in P \lor x \in P') \land x \notin (P \cap P')\}$$

What you wrote is also, essentially, a definition of the symmetric difference of $P, P'$: $$P\triangle P' = (P\cup P')\setminus (P \cap P')$$


Note: sometimes $P\oplus P'$ is used to denote the symmetric difference of sets $P,P′$; however, this notation is used frequently in the context of boolean logic; $\oplus$ is used to denote the "exclusive or", between two propositions, e.g. $$p⊕q=(p∨q)∧¬(p∧q)$$ which means "either p holds, or else q holds, but it is never the case that $p \land q$." holds.

0
On

Along with what the other person said, in Boolean Algebra this is an XOR and is denoted by

$$ A \oplus B $$