### Theory:

Difference of two sets:
The difference of sets $$A$$ and $$B$$ is the set of elements which belong to $$A$$ but not to $$B$$. Symbolically, we write $$A – B$$ and read as "$$A$$ minus $$B$$".

Symbolically we write $$A-B=\{x:x\in A\ \mathrm{and}\ x\notin B\}$$ and $$B-A=\{x:x\notin A\ \mathrm{and}\ x\in B\}$$

Let $$A=\{2,\ 4,\ 6,\ 8\}$$, $$B=\{6,\ 8,\ 10,\ 12\}$$. Find $$A-B$$ and $$B-A$$.

$\begin{array}{l}A-B= \left\{2,\phantom{\rule{0.147em}{0ex}}4\right\}\\ \\ B-A\phantom{\rule{0.147em}{0ex}}=\left\{10,\phantom{\rule{0.147em}{0ex}}12\right\}\end{array}$

In the Venn diagram below $$A$$ and $$B$$ are represented.

In the Venn diagram below, the area in the yellow colour represents $$A - B$$.

In the Venn diagram below, the area in the yellow colour represents $$B - A$$.

Symmetric Difference of Sets:
The symmetric difference of two sets $$A$$ and $$B$$ is the set of union elements which belong to $$A$$ but not to $$B$$, and symbolically we write $$A – B$$ and read as "$$A$$ minus $$B$$". If it belong to $$B$$ but not to $$A$$, symbolically we write $$B – A$$ and read as "$$B$$ minus $$A$$". Symbolically we write $$(A–B)∪(B–A)$$. It is denoted by $$A Δ B$$.

Symbolically we write $$A\Delta B = \{x:x\in A-B\ \mathrm{or}\ x\in B-A\}$$.

$\begin{array}{l}A\phantom{\rule{0.147em}{0ex}}= \left\{2,\phantom{\rule{0.147em}{0ex}}4,\phantom{\rule{0.147em}{0ex}}6,\phantom{\rule{0.147em}{0ex}}8\right\},\phantom{\rule{0.147em}{0ex}}B=\left\{6,\phantom{\rule{0.147em}{0ex}}8,\phantom{\rule{0.147em}{0ex}}10,\phantom{\rule{0.147em}{0ex}}12\right\}.\\ \\ A–B\phantom{\rule{0.147em}{0ex}}= \left\{2,\phantom{\rule{0.147em}{0ex}}4\right\}\\ \\ B–A\phantom{\rule{0.147em}{0ex}}= \left\{10,\phantom{\rule{0.147em}{0ex}}12\right\}\\ \\ A\mathrm{\Delta }B\phantom{\rule{0.147em}{0ex}}= \left(A–B\right)\cup \left(B–A\right) = \left\{2,\phantom{\rule{0.147em}{0ex}}4\right\}\cup \left\{10,12\right\}\\ \\ \mathit{A\Delta B}\phantom{\rule{0.147em}{0ex}}= \left\{2,\phantom{\rule{0.147em}{0ex}}4,\phantom{\rule{0.147em}{0ex}}10,\phantom{\rule{0.147em}{0ex}}12\right\}.\end{array}$

In the Venn diagram below $$A$$ and $$B$$ are represented.

In the Venn diagram below, the area in the blue colour represents $$A Δ B$$.

Complement of a set:
Let $$U$$ be the universal set, and $$A$$ be a subset of $$U$$. Then the complement of $$A$$ is the set of all elements of $$U$$ which are not the elements of $$A$$. Symbolically, we write $$A′$$ to denote the complement of $$A$$ with respect to $$U$$.

Symbolically we write $$A^\prime = \{x: x\in U\ \mathrm{and}\ x\notin A\}$$. Obviously $$A^\prime=U-A$$.
$\begin{array}{l}U\phantom{\rule{0.147em}{0ex}}= \left\{1,\phantom{\rule{0.147em}{0ex}}2,\phantom{\rule{0.147em}{0ex}}3,\phantom{\rule{0.147em}{0ex}}4,\phantom{\rule{0.147em}{0ex}}5,\phantom{\rule{0.147em}{0ex}}6,\phantom{\rule{0.147em}{0ex}}7,\phantom{\rule{0.147em}{0ex}}8,\phantom{\rule{0.147em}{0ex}}9,\phantom{\rule{0.147em}{0ex}}10\right\},\\ A\phantom{\rule{0.147em}{0ex}}= \left\{1,\phantom{\rule{0.147em}{0ex}}3,\phantom{\rule{0.147em}{0ex}}5,\phantom{\rule{0.147em}{0ex}}7,\phantom{\rule{0.147em}{0ex}}9\right\}.\phantom{\rule{0.147em}{0ex}}\\ \\ A\prime = \left\{2,\phantom{\rule{0.147em}{0ex}}4,\phantom{\rule{0.147em}{0ex}}6,\phantom{\rule{0.147em}{0ex}}8,10\right\}\end{array}$

Note: The complement of a set $$A$$ can be looked upon, alternatively, as the difference between a universal set $$U$$ and the set $$A$$.

In the Venn diagram below, the area in the blue colour represents $$A'$$.

If $$A$$ and $$B$$ are two sets, then the complement of $$A$$ and $$B$$ are $$A' = U - A$$ and $$B' = U - B$$

In the Venn diagram below, the area in the blue colour represents $$A'$$.

In the Venn diagram below, the area in the blue colour represents $$B'$$.