Skip to main content

Discrete Mathematics for Computing (Draft)

Section 2.2 Operations with Sets

In the previous section we were introduced to the notion of a set, its elements, the cardinality of a finite set, the notion of subsets, and also the notion of equality between sets. In this section, we’ll be introduced to four common operations on sets.
  • The complement of a set, denoted by \(A^c\) or \(A'\text{.}\)
  • The intersection between two sets, denoted by \(A\cap B\text{.}\)
  • The union between two sets, denoted by \(A\cup B\text{.}\)
  • The difference between two sets, denoted by \(A - B\text{.}\)
Given a set \(A\) in some universal set \(U\text{,}\) we can define the complement of \(A\) in \(U\) to be the collection of all elements which are in the universal set \(U\) but not in the set \(A\text{.}\) We denote the complement of the set \(A\) by \(A^c\) or \(A'\text{.}\)
Given two sets \(A\) and \(B\text{,}\) we can define the intersection between \(A\) and \(B\) as the collection of elements which are in both the set \(A\) and also the set \(B\text{.}\) We use the notation \(A\cap B\) to denote the intersection between \(A\) and \(B\text{.}\)

Checkpoint 2.2.1. Compute an Intersection.

Given two sets \(A\) and \(B\text{,}\) we can define the union between \(A\) and \(B\) as the collection of elements which are in at least on of the set \(A\) or the set \(B\text{.}\) We use the notation \(A\cup B\) to denote the union between \(A\) and \(B\text{.}\)

Checkpoint 2.2.2. Union and Intersection I.

Checkpoint 2.2.3. Union and Intersection II.

In addition to computing unions and intersections over pairs of sets, we can combine these operations to created new sets. Like in your prior exposure to arithmetic and algebra, parentheses can be used to dictate the order in which operations are to be evaluated. In the absence of parentheses, the complement is evaluated before unions and intersections. Then unions and intersections are evaluated from left to right.

Checkpoint 2.2.4. Combining Operations I.

Checkpoint 2.2.5. Combining Operations II.

Checkpoint 2.2.6. Combining Operations III.

Checkpoint 2.2.7. Combining Operations IV.

Now that you’ve mastered the union, the intersection, and the complement. Let’s see our last set operation, the set difference. Given two sets \(A\) and \(B\text{,}\) the set difference is denoted by \(A - B\text{,}\) and is the set consisting of all elements of \(A\) which are not elements of \(B\text{.}\) That is, to find the set \(A - B\text{,}\) we begin with all of the elements of \(A\) and remove any elements which also appear in \(B\text{.}\)
Need to write MyOpenMath problems to add in...