08
  • Introduction
  • 8.1
  • 8.2
  • 8.3
  • 8.4
  • 8.5
  • 8.6
  • 8.7
  • 1. Introduction

    Whether we realise it or not we come across sets, in one form or another, on an almost daily basis. It may be the modules you are studying on your course, or the groceries that you bought in the supermarket last night, or even the teams that qualified for the last 16 of the Champions League in season 2018/19! These are all examples of sets.

    This unit presents an introduction to sets starting with some basic definitions and an overview of the different ways in which sets are represented. The concept of a subset is introduced and conditions for the equality of sets are given. Operations on sets such as union, intersection and complement are described with the aid of Venn diagrams. We then discuss further set operations including partitions and Cartesian products before briefly considering computer representation of sets. The unit closes with a look at the union and intersection of intervals of the real number line when these intervals are represented as sets.

    If required further resources can be found at:

    📹 Intersection and union of sets

  • 2. Sets and elements

    The branch of mathematics known as set theory was introduced by the German mathematician George Cantor in the late 19th century.

    A set is a collection of unordered objects and these objects are called elements or members of the set. We usually denote a set by an upper case letter and members of the set by a lower case letter.

    If $x$ is an element of a set $S$ we write

    $x \in S$

    and read this as,

    “$x$ is a member of $S$” or “$x$ is in $S$” or “$x$ is contained in $S$”.

    If an element $x$ is not in a set $S$ we write

    $x \notin S$

    and read this as,

    “$x$ is not a member of $S$” or “$x$ is not in $S$” or “$x$ is not contained in $S$”.

    2.1. Representation of sets

    There are two main ways to represent sets, referred to as roster form and predicate or set-builder form.

    2.1.1. Roster form

    This method lists the elements of the set, enclosed in curly brackets, separated by commas.

    Example 1

    (i). Sometimes it is possible to list all the elements of the set.

    Let $S$ be defined as the set of all positive integers less than 10. We can write

    $S = \{1, 2, 3, 4, 5, 6, 7, 8, 9\}$.

    (ii). In some cases, while we could in theory list all the elements of the set, because of the size of the set it is not really feasible to do so.

    Let $S$ be defined as the set of all positive integers less than 1000. We can write

    $S = \{1, 2, 3, \cdots , 999\}$.

    Note here that, as there is a clear pattern, an ellipsis (three dots) is used to account for all the unlisted elements between 4 and 998 inclusive.

    (iii). The previous two cases are examples of finite sets as they contain a finite number of elements. We now consider representing an infinite set, such as the set of all positive integers. We can do this in the following way

    $S = \{1, 2, 3, \cdots \}$.

    Note that although we cannot write down all the elements of this set as there is a clear pattern we can use an ellipsis.

    End of Example 1

    2.1.2. Predicate form

    In many cases, especially when dealing with large or infinite sets, it is more convenient to use set builder notation to state a property that the elements of the set must satisfy. For example, in predicate form we write

    $S = \{x:P(x)\}$.

    where $P(x)$ is a predicate, and we read this as, “$S$ is the set of all $x$ such that $P(x)$”. Some text books use the symbol ‘$\mid$’ rather than the colon, ‘:’, but whichever of the two is used we read it as “such that”.

    Example 2

    (i). Define the set

    $S = \{1,2,3, \cdots, 999\}$

    We use set builder notation to write

    $S = \{x : x \;\text{is an integer and}\; 0 < x < 1000 \}$.

    and read as “$S$ is the set of all $x$, such that $x$ is a positive integer and $x$ is less than 1000”.

    (ii). Define the set $D$ as

    $D = \{x : x^2 - 4x + 3 = 0\}$

    Here $D$ consists of the numbers which solve the equation,

    $x^2 - 4x + 3 = 0$

    The solutions to this equation are $x = 1$ and $x = 3$, so we can write $D = \{1, 3\}$

    End of Example 2

    2.2. Equality of sets

    Two sets $A$ and $B$ are equal, written $A = B$, if and only if they contain the same elements or neither contains any elements.

    Example 3

    (i). let $A = \{1,2,3 \},\; B = \{3, 1, 2 \}$ and $C = \{1,2,3,1,1,2,3\}$.

    $A = B$ as the order in which elements appear does not matter.
    $B = C$ as duplication does not matter and additional copies of elements may be removed.

    Hence, ordering and repetition are irrelevant and so $A = B = C$

    (ii). Let $X = \{w, x, y \}$ and $Y = \{w, x, y, z \}$.

    Here $X$ and $Y$ do not contain exactly the same elements and so we say that $X$ is not equal to $Y$ and write $X \neq Y$.

    (iii). Let $A = \{1, 3 \},\; B = \{1,6/2,9/3,3,1\},\; C = \{x : x^2 - 4x + 3 = 0 \}.$

    We have $A = B = C$ as all three sets contain only the elements $1$ and $3$. Recall from Example 2 that $D = \{1, 3\}$ .

    End of Example 3

    2.3. Commonly used sets

    Some sets appear so often, especially in mathematics, that special symbols have been introduced to describe them.

    Example 4

    (i). Integers: $\mathbb{Z} = \{0, \pm \;1, \pm \;2, \cdots\} $

    (ii). Whole Numbers: $\mathbb{W} = \{0, 1, 2 , \cdots\}$

    (iii). Natural Numbers: $\mathbb{N} = \{1, 2, 3, \cdots\}$

    (iv). Rational Numbers: $\mathbb{Q} = \{\frac{p}{q} : p, q \in \mathbb{Z}, q \neq 0 \} $

    (v). Real Numbers: $\mathbb{R} \ \{x : x \in \mathbb{Q} \cup \mathbb{I} \}$, i.e. any rational or irrational number.

    (vi). Irrational Numbers: $\mathbb{I} = \{x : x \in \mathbb{R}, x \notin \mathbb{Q}\}$, e.g $\sqrt{2}, \sqrt{3},e , \pi$
    i.e. numbers that cannot be expressed as a ratio of integers.

    (vii). Integers modulo $m$: $\mathbb{Z}_m = \{0, 1, 2, \cdots , m - 1\}$

    (vii). Complex Numbers: $\mathbb{C} = \{z = a + ib : a,b \in \mathbb{R}, i = \sqrt{-1}\}$

    End of Example 4

    2.4. The universal and empty sets

    The universal set, usually denoted by $U$, is the set of all elements under consideration.

    Example 5

    (i). Suppose we are only concerned with vowels in the English language then the universal set in this case is

    $U = \{a, e, i, o, u\}$.

    (ii). If we are working in two dimensions then the universal set consists of all points in the $xy$-plane.

    End of Example 5

    The empty set

    The empty set, or null set as it is also known, is the set with no elements and is denoted by $\oslash$ or $\{ \;\}$.

    Example 6

    (i). Consider the set of natural numbers that are less than 1.

    $S = \{n \in \mathbb{N} : n < 1 \}$.

    There is no natural number that satisfies this condition and so $S = \oslash$.

    (ii). The set of months with 25 days is an empty set.

    (iii). A very important point to note is that the following are not equal,

    $\{0\}, \; \oslash, \; \{\oslash \}$ and $0$.

    Here the first three are all sets while the fourth is an element. The first set contains one element, i.e. the number zero, the second set is the empty set containing no elements and the third set contains the empty set.

    End of Example 6

    2.5. Subsets and proper subsets

    Let $A$ and $B$ be two sets. A set $A$ is called a subset of $B$ if every element of $A$ is also an element of $B$. Note that a subset allows for the possibility that the two sets are equal, i.e. $A = B$. We write

    $A \subseteq B$

    and read as, “$A$ is a subset of $B$” or “$A$ is contained in $B$”.

    Example 7

    (i). Let $A = \{2, 5, 7\}$ and $B = \{2, 3, 5, 7, 9 \}$.

    Since all the elements of $A$ are contained in $B$, we have that $A$ is a subset of $B$, i.e. $A \subseteq B$

    (ii). Let $X = \{2, 3, 5, 7, 9 \}$ and $Y = \{2, 3, 5, 7, 9\}$.

    Here $X = Y$ and so $X$ is a subset of $Y$, i.e. $X \subseteq Y$, (also $Y \subseteq X $).

    End of Example 7

    Note

    (i). Any set $S$ is a subset of itself, i.e. $S \subseteq S$.

    (ii). The empty set is a subset of every set, i.e. $\oslash \subseteq S$.

    (iii). Two sets $A$ and $B$ are equal if $A$ is a subset of $B$, $A \subseteq B$, and $B$ is a subset of $A$, $B \subseteq A$. See Example 7(ii).

    Let $A$ and $B$ be two sets. A set $A$ is called a proper subset of $B$ if every element of $A$ is also an element of $B$ and $A \neq B$. We write

    $A \subset B$

    and read as, “$A$ is a proper subset of $B$”.

    Example 8

    Let $A = \{2, 4, 7 \}$ and $B =\{2, 3, 5, 7, 9\}$.

    Since all the elements of $A$ are contained in $B$ and $A \neq B$, we have that $A$ is a proper subset of $B$, i.e. $A \subset B$.

    A proper subset can only contain some of the elements in the original set.

    End of Example 8

  • 3. Venn diagrams

    A Venn diagram may be used to provide a pictorial representation of the relationship between sets. To draw a Venn diagram we first sketch a rectangle whose interior represents the universal set. Other sets are generally represented by circles and are enclosed by the rectangle.

    Example 9

    Let the universal set, $U$ be the set of all positive integers , i.e.

    $U = \{1, 2, 3, \dots \}$

    and define $A = \{2, 5, 7 \}$ and $B = \{2, 3, 5, 7, 9\}$.

    Venn Diagram Example 1
    Venn diagram showing $A \subseteq B$

    As we saw in Example 7(i) all the elements of $A$ are in $B$, i.e. $A$ is a subset of $B$, and so we draw the circle representing $A$ completely inside the circle representing $B$.

    End of Example 9

  • 4. Operations on sets

    This section describes the important operations that are used to combine two, or more, sets.

    4.1. Union of sets

    The union of two sets $A$ and $B$, denoted $A \cup B$, is the set of all elements which are members of $A$ or $B$ (or both). Symbolically the union of $A$ and $B$ is

    $A \cup B = \{x : x \in A \;\text{or}\; x \in B \}$.

    Venn Diagram Example 2
    Venn diagram showing $A \cup B$

    Example 10

    Let $A= \{0, 2, 5, 7\},\; B = \{3, 7, 8, 9 \}$ and $C = \{1, 2, 3, 4, 5, 6\}$.

    (i). $A \cup B = \{0, 2, 3, 5, 7, 8, 9\}$.

    (ii). $A \cup C = \{0, 1, 2, 3, 4, 5, 6, 7\}$.

    (iii). $B \cup C = \{1, 2, 3, 4, 5, 6, 7, 8, 9 \}$.

    (iv). $A \cup B \cup C = \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9 \}$.

    Note that we do not need parenthesis when dealing only with the union of sets, i.e.

    $A \cup B \cup C = (A \cup B)\cup C = A \cup(B \cup C)$, etc.

    End of Example 10

    4.2. Intersection of sets

    The intersection of two sets $A$ and $B$, denoted $A \cap B$, is the set of all elements which are members of $A$ and also of $B$. Symbolically the intersection of $A$ and $B$ is

    $A \cap B = \{x : x \in A \; \text{and} \;x \in B\}$.

    Venn Diagram Example 3
    Venn diagram showing $A \cap B$

    Example 11

    Let $A = \{a, b , e, f\}, \;B = \{a, c, d, f, g \}$ and $C = \{g, w, x, y \}$.

    (i). $A \cap B = \{a, f \}$

    (ii). $A \cap C = \oslash$

    (iii). $B \cap C = \{g \}$

    (iv). $A \cap B \cap C = \oslash$.

    Note that we do not need parenthesis when dealing only with the intersection of sets, i.e.

    $A \cap B \cap C = (A \cap B)\cap C = A \cap (B \cap C)$. etc.

    End of Example 11

    4.3. Complement of a set

    The complement of a set $A$, denoted $A^c$ , is the set of all elements which are not members of $A$.

    Symbolically the complement of $A$ is

    $A^c = \{x \in U : x \notin A\}$.

    Venn Diagram Example 3
    Venn diagram showing $A^c$

    Example 12

    Let $U = \{1, 2, 3, 4, 5, 6, 7, 8 ,9 \}$ and $A = \{2, 5, 7 \}$

    (i). $A^c = \{1, 3, 4, 6, 8, 9 \}$

    (ii). $A \cap A^c = \oslash$

    (iii). $A \cup A^c = U$

    (iv). $(A^c)^c = \{1, 3, 4, 6, 8, 9\}^c = \{2, 5, 7 \} = A$.

    End of Example 12

    4.4. Difference of two sets

    The difference of two sets $A$ and $B$, denoted $A - B$ or $A \setminus B$, is the set of all elements in $A$ that are not in $B$.

    Note that $A - B$ is read as, “$A$ minus $B$” or “$A$ not $B$”.

    $A - B$ is also called the relative complement of $B$ with respect to $A$.

    Symbolically the difference of $A$ and $B$ is

    $A - B = \{x : x \in A \;\text{and}\; x \notin B \}$.

    Venn Diagram Example 4
    Venn diagram showing $A - B$

    Example 13

    Let $A = \{0, 1, 2, 3, 6 ,7, 8\}$ and $B = \{3, 7, 8, 9 \}$.

    (i). $A - B = \{0, 1, 2, 6 \}$

    (ii). $B - A = \{ 9 \}$

    (iii). $(A - B) \cap B = \oslash$

    (iv). $(B - A)\cap A = \oslash$.

    End of Example 13

  • 4.5. Symmetric difference of two sets

    The symmetric difference of two sets $A$ and $B$, denoted $A \oplus B$, is the set of all the elements which are in $A$ or $B$ but not in both.

    $A \oplus B = \{x : x \in A \;\text{or}\; x \in B \;\text{but not both} \}$.

    Venn Diagram Example 5
    Venn diagram showing $A \oplus B$

    Example 14

    Let $A = \{0, 1, 2, 3, 6, 7, 8 \}$ and $B = \{3, 7, 8, 9\}$

    (i). Show that $A \oplus B = (A \cup B) - (A \cap B)$

    $A \oplus B = \{0, 1, 2, 6, 9 \}$

    $A \cup B = \{0, 1, 2, 3, 6, 7, 8, 9\}$ and $A \cap B = \{3, 7, 8\}$.

    $(A \cup B) - (A \cap B) = \{0, 1, 2, 3, 6, 7, 8, 9 \} - \{3, 7, 8\}$

    $= \{0, 1, 2, 6, 9\}$

    Hence $A \oplus B = (A \cup B) - (A \cap B)$.

    (ii). Show that $A \oplus B = (A - B)\cup(B - A)$

    $A \oplus B = \{0, 1, 2, 6, 9\}$

    $A - B = \{0, 1, 2, 6\}$ and $B - A = \{9\}$

    $(A - B)\cup(B - A) = \{0, 1, 2, 6, 9\}$.

    Hence$A \oplus B = (A - B)\cup(B - A)$.

    End of Example 14

    4.6. Disjoint sets

    Two sets $A$ and $B$ are said to be disjoint if they do not have any elements in common, i.e. their intersection is empty, $A \cap B = \oslash$.

    A and B are disjoint sets Example
    $A$ and $B$ are disjoint sets

    A collection of sets, $A_1, A_2, \cdots, A_n$, is said to be mutually disjoint, or pairwise disjoint, if every pair from the collection is disjoint, i.e.

    If $Ai \neq Aj$ then $Ai \cap Aj = \oslash$.

    Example 15

    The sets

    $A_1 = \{0, 4\}, \; A_2 = \{1, 5, 6\}, \; A_3 = \{2, 7\} \; A_4 = \{3\}$

    are mutually disjoint as

    $ A_1 \cap A_2 = \oslash, \;\; A_1 \cap A_3 = \oslash, \;\; A_1 \cap A_4 = \oslash,$

    $ A_2 \cap A_3 = \oslash, \;\; A_2 \cap A_4 = \oslash, \;\; A_3 \cap A_4 = \oslash$.

    End of Example 15

    4.7. Partition of a set

    A partition of a set $S$ is a collection of non-empty subsets, $A_1, A_2, \dots, A_n$, that are mutually disjoint and their union equals the entire set $S$. The diagram shows a rectangular set $S$, partitioned into four mutually disjoint subsets whose union equals $S$.

    Partition of a Set Example
    $S = A_1 \cup A_2 \cup A_3 \cup A_4$.

    Example 16

    Let $S = \{0, 1, 2, 3, 4, 5, 6, 7\}$. One possible partition of $S$ is,

    $A_1 = \{0, 4\}. \;\; A_2 = \{1, 5, 6\}, \;\; A_3 = \{2, 7\} \;\; A_4 = \{3 \}$.

    Note that the subsets are mutually disjoint and their union is equal to the set $S$ :

    (i). $A_1 \cap A_2 = \oslash, \;\; A_1 \cap A_3 = \oslash, \;\; A_1 \cap A_4 = \oslash,$

    $A_2 \cap A_3 = \oslash, \;\; A_2 \cap A_4 = \oslash, \;\; A_3 \cap A_4 = \oslash .$

    (ii). $A_1 \cup A_2 \cup A_3 \cup A_4 = S$.

    End of Example 16

    Example 17

    Let $A = \{0, 1, 2, 3, 6, 7, 8\}, \;\; A_1 = \{3, 8\}, \;\; A_2 = \{0, 2, 6\}$ and $A_3 = \{1, 7\}$.

    Is $\{A_1, A_2, A_3\}$ a partition of $A$?

    Solution

    Yes, $\{A_1, A_2, A_3\}$ is a partition of $A$ since $A = A_1 \cup A_2 \cup A_3$ and $A_1, A_2$ and $A_3$ are mutually disjoint.

    End of Example 17

  • 5. Set Identities

    Let $A$, $B$ and $C$ be subsets of a universal set $U$. The following table provides a list of set identities and for each identify we specify its dual. The dual law is obtained by replacing: $\cap$ by $\cup, \; \cup$ by $\cap, \oslash$ by $U$ and $U$ by $\oslash$.

    Name Law Dual
    Commutative $A \cup B = B \cup A$ $A \cap B = B \cap A$
    Associative $A \cup (B \cup C) = (A \cup B) \cup C$ $A \cap (B \cap C) = (A \cap B) \cap C$
    Distributive $A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ $A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$
    Idempotent $A \cup A = A$ $A \cap A = A$
    Identity $A \cup \oslash = A$ $A \cap \oslash = A$
    Domination $A \cup U = U$ $A \cap \oslash = \oslash$
    Absorption $A \cup (A \cap B) = A$ $A \cap (A \cup B) = A$
    Complement $A \cup A^c = U$ $A \cap A^c = \oslash$
    Involution $(A^c)^c = A$ $A = (A^c)^c$    (self dual)
    0/1 $\oslash^c = U$ $U^c = \oslash$
    De Morgan $(A \cup B)^c = A^c \cap B^c$ $(A \cap B)^c = A^c \cup B^c$

    We now present a few more examples and look at using membership tables to prove identities are equal.

    Example 18

    Define the universal set $U = \{0, 1, 2, 3, 4, 5, 6, 7, 8, 9\}$ and the sets

    $A = \{1, 3, 6, 8\}, \;\; B = \{0, 3, 5, 6, 9\}, \;\; C = \{2, 4, 6, 8\}$.

    Determine each of the following.

    (i). $A \cup B$        (ii). $A \cap C$ (iii). $A \cup B \cup C$.

    (iv). $A \cap B^c$     (v). $(A \cap B^c) \cup C$     (vi). $(B \cup C)^c \cap C$

    (vii). Show that de Morgan’s law, $(A \cup B)^c = A^c \cap B^c$ holds for sets $A$ and $B$.

    (viii). Show that de Morgan’s law, $(A \cap B)^c = A^c \cup B^c$ holds for sets $A$ and $B$.

    Solution

    (i). $A \cup B = \{1, 3, 6, 8\}\cup\{0, 3, 5, 6, 9\} = \{0, 1, 3, 5, 6, 8, 9\}$.

    (ii). $A \cap C = \{1, 3, 6, 8 \}\cap \{2, 4, 6, 8\} = \{6, 8\}$

    (iii). $A \cup B \cup C = \{1, 3, 6, 8\}\cup\{0, 3, 5, 6, 9\}\cup\{2, 4, 6, 8\}$

    $= \{0, 1, 2, 3, 4, 5, 6, 8, 9\}$.

    (iv). $B^c = \{1, 2, 4, 7, 8\}$

    $A \cap B^c = \{1, 3, 6, 8\}\cap\{1, 2, 4, 7, 8\} = \{1, 8\}$

    (v). $(A \cap B^c)\cup C$

    $= \{1, 8\} \cup \{2, 4, 6, 8\} = \{1, 2, 4, 6, 8\}$

    (vi). $(B \cup C)^c \cap C$

    $B \cup C = \{0, 3, 5, 6, 9\}\cup\{2, 4, 6, 8\} = \{0, 2, 3, 4, 5, 6, 8, 9\}$

    $(B \cup C)^c = \{0, 2, 3, 4, 5, 6, 8, 9\}^c = \{1, 7\}$

    $(B \cup C)^c \cap C = \{1, 7\}\cap\{2, 4, 6, 8\} = \oslash$.

    (vii). $(A \cup B)^c = \{0, 1, 3, 5, 6, 8, 9\}^c = \{2, 4, 7\}$.

    We have $A^c = \{0, 2, 4, 5, 7, 9\}, \;\; B^c = \{1, 2, 4, 7, 8\}$.

    Then $A^c \cap B^c = \{2, 4, 7\}$.

    Hence $(A \cup B)^c = A^c \cap B^c$ as required.

    (viii). $(A\cap B)^c = \{3, 6\}^c = \{0, 1, 2, 4, 5, 7, 8, 9\}$

    We have $A^c = \{0, 2, 4, 5, 7, 9\}, \;\; B^c = \{1, 2, 4, 7, 8\}$.

    Then $A^c \cup B^c = \{0, 1, 2, 4, 5, 7, 8, 9\}$.

    Hence $(A \cap B)^c = A^c \cup B^c$ as required.

    End of Example 18

    Example 19

    Use membership tables to prove de Morgan’s Law,

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

    Solution

    In a membership table we create a column for each set $A$ and $B$ and assign a ‘$1$’ if an element belongs to a given set and a ‘$0$’ otherwise. Then for the set combination we are interested in we assign a ‘$0$’ or ‘$1$’ depending on whether or not the element belongs to the combination .

    Here we first create a table for $(A \cup B)^c$ and compare this with the table we will generate for $A^c \cap B^c$. If the final columns of the tables are equal then the identity has been proved.

    In the first row of the table below we have assigned a ‘$1$’ to both $A$ and $B$ so that the element is a member of both sets. By the rule for union of sets, the element is then a member of the set $A \cup B$ and so a ‘$1$’ is assigned to the appropriate cell. As the element is in $A \cup B$ it cannot be a member of $(A \cup B)^c$ and so we assign a ‘$0$’ to the final column of the first row. We continue in this way until all four rows have been completed.

    $A$ $B$ $A \cup B$ $(A \cup B)^c$
    1 1 1 0
    1 0 1 0
    0 1 1 0
    0 0 0 1

    Now create a table for $A^c \cap B^c$

    $A$ $B$ $A^c$ $B^c$ $A^c \cap B^c$
    1 1 0 0 0
    1 0 0 1 0
    0 1 1 0 0
    0 0 1 1 1

    The final (rightmost) columns of the two tables are identical thereby proving the identity,

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

    End of Example 19

  • 6. Cardinality of a set

    The cardinality of a finite set $A$, denoted $\mid A \mid$ , is the number of elements in $A$.

    Example 20

    (i). If $A = \{2, 5, 7\}$ the cardinality of $A$, $\mid A \mid = 3$.

    (ii). If $B = \{a, b, c, \cdots ,x, y, z\}$, letters in the English alphabet, $\mid B \mid = 26$.

    (iii). If $S = \oslash$, the empty set, then $\mid S \mid = 0$.

    End of Example 20

    6.1. Cardinality of the union of sets

    (i). If $A$ and $B$ are two disjoint sets they have no elements in common. When we form the union of $A$ and $B$ we combine the sets into a single set $A \cup B$ whose cardinality is simply the sum of the cardinality of $A$ and cardinality of $B$.

    Hence, for disjoint sets

    $\mid A \cup B \mid = \mid A \mid + \mid B \mid$.

    Cardinality of the union of sets Example

    Example 21

    Let $A = \{1, 2, 3\}$ and $B = \{5, 7, 8, 9\}$.

    The cardinality of $A$, $\mid A \mid = 3$ and the cardinality of $B$, $\mid B \mid = 4$.

    The sets $A$ and $B$ are disjoint so,

    $\mid A \cup B \mid = \mid A \mid + \mid B\, \mid$

    $= 3 + 4$

    $= 7$.

    It is easy to check that in this case

    $A \cup B = \{1, 2, 3, 5, 7, 8, 9\}$ and clearly $\mid A \cup B \mid = 7$.

    (ii). If however, $A$ and $B$ are not disjoint sets it is not quite so straightforward to calculate the cardinality of their union.

    Example 21

    The Venn diagram shows that by forming $\mid A \mid + \mid B\, \mid$ we actually count the number of elements in the intersection twice, i.e. once in $\mid A\, \mid$ and once in $\mid B\, \mid$. Hence, $\mid A \cap B\, \mid$ must be subtracted from $\mid A \mid + \mid B \,\mid$.

    If $A$ and $B$ are not disjoint sets then

    $\mid A \cup B \mid = \mid A \mid + \mid B \mid - \mid A \cap B\, \mid$.

    End of Example 21

    Example 22

    Let $A = \{1, 2, 3\}$ and $B = \{2, 3, 4, 5\}$.

    $\mid A \cup B \mid = \mid A \mid + \mid B \mid - \mid A \cap B \,\mid$

    $= 3 + 4 - 2$

    $= 5$

    It is easy to check that in this case

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

    and so

    $\mid \,A \cup B \mid\, = 5$.

    End of Example 22

    Example 23

    Suppose we have three intersecting finite sets, $A$, $B$ and $C$ as shown in the Venn diagram.

    Example 23

    We want to calculate the cardinality of $A \cup B \cup C$.

    From the Venn diagram

    $\mid A \cup B \cup C \mid = \mid A \mid + \mid B \mid + \mid C \mid$ (1)

    $- \mid A \cap B \mid - \mid A \cap C \mid - \mid B \cap C \mid$ (2)

    $+ \mid A \cap B \cap C \mid$. (3)

    Notes

    In forming $\mid A \cup B \cup C$ the following has occurred:
    at (1) we have counted the number of elements in each of $A \cap B, \; A \cap C$ and $B \cap C$ twice, so this must be removed once at (2).
    at (1) we have counted the number of elements in $A \cap B \cap C$ three times and then at (2) we have removed the number of elements in $A \cap B \cap C$ three times. We must therefore add back the number of elements in $A \cap B \cap C$ at (3).

    End of Example 23

  • 7. Power set

    The set of all subsets of a set $A$ is called the power set of $A$ and is denoted by $P(A)$, or $2^A$ . For some arbitrary set $A$, the number of subsets of $A$ is $2^{\mid A \mid}$, where $\mid A \mid$ is the cardinality of $A$.

    Example 24

    If $A = \{a, b, c\}$ the power set of $A$ contains, $2^{\mid A \mid} = 2^3 = 8$ elements. We have
    Subsets with zero elements: $\oslash$ (the empty set)
    Subsets with one element: $\{ a \}, \{ b \}, \{ c \}$
    Subsets with two elements: $\{ a, b \}, \{ a, c \}, \{ b, c \}$
    Subsets with three elements: $\{ a, b, c \} = A$.

    Therefore in this case,

    $P(A)=\{\{a\}, \{b\},\{c\},\{a, b\}, \{a, c\}, \{b, c\}, \{a, b, c\}, \oslash\}$.

    End of Example 24

    We continue with our work on sets next week beginning with Cartesian products of sets before briefly considering computer representation of sets. The unit closes with a look at the union and intersection of intervals of the real number line when these intervals are represented as sets.

School of Computing, Engineering and Built Environment