3
$\begingroup$

I am trying to figure out the word/operation to what is not in the intersection of two sets but is in their union.

How I am going about this now is $$(A \cup B) - (A \cap B)$$

Is there a better way to go about this?

$\endgroup$
4
  • $\begingroup$ B is the intersection? You mean &? Do you mean A,B as sets or as singletons? $\endgroup$
    – Asaf Karagila
    Jun 27, 2011 at 19:03
  • 8
    $\begingroup$ This is called the symmetric difference, BTW. But that's just a name. It's not clear from your question what "better" means, what kinds of sets you're working with, what kinds of operations you can do efficiently, etc. $\endgroup$ Jun 27, 2011 at 19:04
  • 3
    $\begingroup$ Are you sure you mean $\{A\}\cup\{B\}$ and $\{A\}\cap\{B\}$, and not $A\cup B$ and $A\cap B$? If you mean what you wrote, then you get either $\emptyset$ if $A=B$, and $\{A,B\}$ if $A\neq B$. If you did not mean to have the curly brackets, you want the symmetric difference, which is often denoted by $A\Delta B$. $\endgroup$ Jun 27, 2011 at 19:14
  • $\begingroup$ There are many alternative ways of writing the symmetric difference (when you don't have those curly brackets). E.g., for any two sets $A$ and $B$, $$(A\cup B)-(A\cap B) = (A-B)\cup(B-A) = (A\cap B^c)\cup (B\cap A^c).$$ $\endgroup$ Jun 27, 2011 at 20:50

2 Answers 2

10
$\begingroup$

$$(A \cup B) - (A \cap B)$$ Is called the symmetric difference and is often denoted by $$ A \Delta B $$

It is analogous to the logical "exclusive or" operation (as union is analogous to "or" and intersection is analogous to "and").

$\endgroup$
1
  • $\begingroup$ It's frequently shortened to xor (or XOR). $\endgroup$
    – Josh
    Jun 28, 2011 at 1:00
1
$\begingroup$

$(A \cap B^c)\cup (B\cap A^c)$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .