Skip to main content

Operations Examples

Basic Set Operations

1. Union (A ∪ B)

The union of two sets AA and BB is the set of all elements that are in AA OR BB OR both.

Example:
A = {1, 2, 3}, B = {3, 4, 5}

AB={1,2,3,4,5}A \cup B = \{1, 2, 3, 4, 5\}

2. Intersection (A ∩ B)

The intersection is the set of elements common to both AA AND BB.

Example:
A = {1, 2, 3},, B = {3, 4, 5}

AB={3}A \cap B = \{3\}

3. Difference (A - B)

The difference is the set of elements in AA but not in BB.

Example:
A = {1, 2, 3}, B = {3, 4, 5}

AB={1,2}A - B = \{1, 2\}

BA={4,5}B - A = \{4, 5\}

4. Symmetric Difference (A △ B)

The symmetric difference is the set of elements in either AA or BB, but not in both.

Example:
A = {1, 2, 3}, B = {3, 4, 5}

AB={1,2,4,5}A \triangle B = \{1, 2, 4, 5\}

5. Complement (A′ or Aᶜ)

The complement of AA is the set of all elements not in AA, relative to a universal set UU.

Example:
Let U = {1, 2, 3, 4, 5}, A={2,4}A = \{2, 4\}

A=UA={1,3,5}A' = U - A = \{1, 3, 5\}

6. Subsets

A set AA is a subset of BB (ABA \subseteq B) if every element of AA is also in BB.

Example:
A={1,2}A = \{1, 2\}, B={1,2,3}B = \{1, 2, 3\}

ABA \subseteq B

7. Powerset (P(A))

The powerset of AA is the set of all subsets of AA.

Example:
A={a,b}A = \{a, b\}

P(A)={,{a},{b},{a,b}}\mathcal{P}(A) = \{\varnothing, \{a\}, \{b\}, \{a, b\}\}


Each operation helps us analyze relationships between sets, such as finding common elements (intersection), combining sets (union), or exploring all possible groupings (powerset).