Set Operations

Set operations include union, intersection, and difference.

To clarify the definitions of set operations, this page primarily uses Venn diagrams because they make understanding these operations easier. In graphical representation, concepts are much simpler compared to mathematical notation.

Union

Given two sets A and B, the union of A and B is the set containing all elements that are in set A, in set B, or in both.

the union of sets

The symbol for union is .

the notation for union

Any elements that are present in both sets are considered only once in the union set.

Union of multiple sets. To write the union of a family of sets, I can write $$ \bigcup_{i \in I} = \{ x \in A_i \:\: \text{for some}\:\: i \in I \} $$

How to calculate the union of two sets

In this practical example, I calculate the union of two sets A and B.

a practical example of calculating the union of two sets

Explanation. Set A consists of the elements { 2, 5, 6, 7, 8 } while set B consists of the elements { 1, 3, 4, 6, 7, 9 }. The union set consists of elements from both sets { 1, 2, 3, 4, 5, 6, 7, 8, 9 }. Elements present in both sets {6, 7} are considered only once in the union set.

Intersection

Given two sets A and B, the intersection of A and B is the set containing all elements common to both sets A and B.

the intersection between sets

The symbol for intersection is .

the notation for intersection

Two sets A and B are said to be disjoint sets when their intersection A⋂B is an empty set.

the case of disjoint sets

Intersection of multiple sets. To write the intersection among a family of sets, I can write $$ \bigcap_{i \in I} = \{ x \in A_i \:\: \forall i \in I \} $$

How to calculate the intersection of two sets

In this practical example, I calculate the intersection between two sets A and B.

example of calculating the intersection between sets

Explanation. The elements { 6, 7 } belong to both set A and set B. Therefore, the intersection set A⋂B consists of the elements { 6, 7 }.

Difference between sets

Given two sets A and B, the difference A-B is the set containing elements of set A that are not also in set B.

the difference between sets

The set difference A-B is also called the complement of B with respect to A.

the notation for the complement set

Note. The set difference A-B is also referred to as the relative complement of set A in set B. It includes all elements of A that are not also in B. It is often denoted as $$ A \text{ \ } B =\{ x \in A | x \notin B \} $$

How to calculate the difference between two sets

In this practical example, I calculate the difference between set A and B.

the difference between set A-B

Explanation. Set A consists of the elements {2, 5, 6, 7, 8}. The elements { 6, 7 } belong to both set A and set B. Therefore, they are removed from the complement set A-B {2, 5, 6, 7, 8}. For this reason, the complement set A-B consists only of the elements {2, 5, 8}.

Properties of Set Operations

Set operations adhere to the following properties: commutative, associative, distributive, and De Morgan's Laws.

  • Commutative Property

    A ∪ B = B ∪ A
    A ∩ B = B ∩ A

  • Associative Property

    A ∪ (B ∪ C) = (A ∪ B) ∪ C
    A ∩ (B ∩ C) = (A ∩ B) ∩ C

  • Distributive Property

    A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
    A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

  • De Morgan's Laws

    A - (B ∪ C) = (A - B) ∩ (A - C)
    A - (B ∩ C) = (A - B) ∪ (A - C)

 

 
 

Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

FacebookTwitterLinkedinLinkedin
knowledge base

Set