A set is an unordered group of items (called elements). For example, \(\{\text{cat}, \text{dog}, \text{fish}, \text{bird}\}\) is a set of animals, \(\{2,4,6,8,10\}\) is a set of even numbers, and \(\{a, b, c, d\}\) is a set of letters. Though sets are pretty simple data structures, they are important for understanding concepts in combinatorics, probability, and number theory.

If set \(P=\{2, 5, 6, 3, 7\}\) and set \(Q=\{1, 2, 3, 8, 9, 10\},\) which of the following Venn diagrams represents the relationship between the two sets?

Contents

Definition of a Set

A set is an unordered group of elements denoted by a sequence of items (separated by commas) between curly braces "\(\{\)" and "\(\}\)".

What does it mean to be unordered?

Sets are not organized in any particular way. For example, the set \(A = \{1,2,3,4,5\}\) appears to be the set of ordered numbers between 1 and 5, but this set is actually equivalent to \(B = \{2,3,1,5,4\}\). The order of elements in a set does not matter. Two sets are equal if they contain all of the same elements.

Repeated elements make no difference in a set. \(A = \{1,1,1,1\}\) is equal to \(B = \{1\}\). In fact, sets are generally not written to include repeated elements.

Which two sets are equivalent?

\(A = \{1,3,5,7,9\}\)

\(B = \{1,2,3,4,5,6\}\)

\(C = \{1,2,3,4,5\}\)

\(D = \{5,4,2,6,1,3\}\)

\(E = \{4,1,5,2,3,7\}\)

E and A
D and E
C and B
B and A
None are equivalent
B and D
A and C

Operations with Sets

There are several useful operations one can use to combine, compare, and analyze sets.

Union: The union of two sets, denoted \( \cup\) (which is called a cup), refers to the set of all the elements that are in at least one of the two sets. For example, \( \{1,2,3\} \cup \{3,4,5\} = \{1,2,3,4,5\}.\) In Boolean logic, union is expressed as a logical OR.

Intersection: The intersection of two sets, denoted \( \cap\) (which is called a cap), refers to the set of the elements that are in both sets. For example, \( \{1,2,3\} \cap \{3,4,5\} = \{3\}.\) In Boolean logic, intersection is expressed as a logical AND.

Complement (Absolute): Denoted \( ^c\), the absolute complement refers to the set of all the elements that are not in a set. If we consider the universal set, \(U\), as the set of all integers, \( \{ 1, 2, 3 \}^c \) would represent all integers except for 1, 2, and 3. In Boolean logic, complement is expressed as a logical NOT.

Complement (Relative): Relative complement, denoted \( \backslash \), refers to the set of elements that are in the first set but not in the second. For example, \( \{1,2,3\} \backslash \{3,4,5\} = \{1,2\}.\) Relative complement can also be expressed by the minus sign, thus \(\{1,2,3\}-\{3,4,5\}=\{1,2\}.\)

Symmetric Difference: Symmetric difference, denoted \( \triangle \), refers to the set of elements which are in one of the two sets but not both. For example, \( \{1,2,3\} \triangle \{3,4,5\} = \{1,2,4,5\}.\)

Set Laws

De Morgan's laws are useful for showing equivalencies, transforming, and simplifying logical expressions.

De Morgan's First Law: De Morgan's first law states that the complement of the union of two sets is the intersection of their complements. For two sets \(A\) and \(B:\) \((A \cup B)^c=(A)^c\cap (B)^c.\) In Boolean logic, De Morgan's First Law is expressed as: \(\overline{A + B} = \overline{A} * \overline{B}\)

De Morgan's Second Law: De Morgan's second law states that the complement of the intersection of two sets is the union of the complements. Specifically, \( (A \cap B)^c = A^c\cup B^c. \) In Boolean logic, De Morgan's Second Law is expressed as: \(\overline{A * B} = \overline{A} + \overline{B}\).

Use De Morgan's Second Law to determine \(A^c\cup B^c. \)

\(U = \{1,2,3,4,5,6,7,8,9\}\) where \(U\) is the set of all possible values for this problem.

\(A=\{2,5,7,3,1\}\).

\(B=\{9,8,7,5,2\}\).

De Morgan's Second Law is: \( (A \cap B)^c = A^c\cup B^c. \) Since we are looking for \(A^c\cup B^c \), we will first determine the left side of the equation, \( (A \cap B)^c\).

To find \( (A \cap B)^c\), determine \( (A \cap B)\).

\( (A \cap B)\) is the set of elements that are in both \(A\) and \(B\).

\( (A \cap B) = \{2,5,7\}\).

To find \( (A \cap B)^c\), compare the elements in \( (A \cap B)\) with the elements in \(U\), and the elements in \( (A \cap B)^c\) will be the elements that are in \(U\) but not in \( (A \cap B)\).

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

We know from De Morgan's Second Law that \(A^c\cup B^c \) = \( (A \cap B)^c\). In other words, elements that are not in both \(A\) and \(B\) must either be missing from \(A\) or \(B\) (or both).

Examine \( (A \cap B)^c = \{1,3,4,6,8,9\}\) for yourself to verify that elements in \( (A \cap B)^c\) are missing from either \(A\) or \(B\) or both.

In a class of \(150\) students, \(90\%\) love singing, \(86\%\) love dancing, \(80\%\) love acting and \(74\%\) love studying. Then what is the minimum number of students who love all the mentioned activities?

Terminology

Here are some important concepts and terms about sets.

Universal Set: Denoted \(U,\) a universal set is the set of all possible elements for a particular problem. For example, if a problem deals only with positive, nonzero integers, \(U = \{1,2,3,4, \dots\}\).

Empty/Null set: Denoted by \(\{\}\) or \(\phi\), a set is said to be null or empty if it does not contain any elements. For example, if \(A\) is the set of all integers \(x\) that satisfy \(x^2=7,\) then the set \(A\) has no elements, thus \(A=\phi.\)

Subsets: If every element of a set \(A\) is also a member of the set \(B,\) then we say that \(A\) is a subset of \(B.\) For example if \(A=\{1,2,3\}\) and \(B=\{5,4,3,2,1\}\) then \(A\) is a subset of \(B,\) or \(A \subset B.\) When two sets are equal, they are subsets of each other.

Cardinality: The cardinality of a set \(S,\) written as \(\lvert S\rvert,\) is the number of distinct elements in \(S.\) For example if \(A\) is the set of all the letters in "Mississippi", then \(A=\{m,i,p,s\},\) hence \(\lvert A\rvert=4.\)

Inclusion Exclusion Principle: The inclusion exclusion principle states that any two sets \(A\) and \(B\) satisfies \(\lvert A \cup B\rvert = \lvert A\rvert + \lvert B\rvert- \lvert A \cap B\rvert .\) In other words, elements that are in \(A\) AND \(B\) are the elements that are in \(A\) and in \(B\) but not in the set of elements that are in only \(A\) OR only in \(B\), since the elements in the union of two sets must be in both.

For this problem, the universal set \(U\) is \[ U = \{ 1,2,3,4,5,6,7,8,9,10 \} ,\] and its three subsets \( A, B \) and \(C\) are as follows: