Set Operations

Download as PDF

Welcome to the world of sets! Just like you can add or subtract numbers, you can perform actions on groups of objects, or sets. This lesson will teach you the core set operations—union, intersection, and complement—that form the building blocks for logic, probability, and computer science.

Set Operations — an original Algebra911 reference diagram defining set operations and a worked example.
Set Operations: A Complete Guide to Union, Intersection, and Complement

What Are Set Operations?

Set operations are actions that manipulate, combine, or compare sets to create new sets. Before we dive into the operations, let's quickly recap what a set is. In mathematics, a set is simply a collection of distinct objects, called elements. For example, the set of primary colors can be written as C = {red, yellow, blue}.

Think of set operations as the 'verbs' for sets. While numbers have operations like addition and multiplication, sets have their own unique actions. The three most fundamental set operations are:

  • Union (∪): Combining all elements from two or more sets into one.
  • Intersection (∩): Finding only the elements that sets have in common.
  • Complement ('): Identifying all elements that are not in a particular set, relative to a larger universal set.

These operations allow us to precisely define relationships between groups and are essential tools in fields ranging from database searches to analyzing statistical data.

What is the Union of Sets (∪)?

The union of two sets is a new set that contains all the elements from both of the original sets. The key word here is 'or'. An element is in the union if it is in the first set, or in the second set, or in both. The symbol for union is a 'U'-like shape: .

Imagine you have a playlist of rock songs and your friend has a playlist of pop songs. The union of your two playlists would be a single, larger playlist containing every song from both, without any duplicates. If a song is on both playlists, it only appears once in the combined list.

For any two sets A and B, their union is defined as:
AB={xxA or xB}

This notation reads: "The set of all elements x such that x is an element of A or x is an element of B."

Example 1

Let set A={1,3,5,7} and set B={2,3,4,5}. Find the union of A and B, written as AB.

Solution:

  1. Start by listing all the elements from set A: 1,3,5,7.
  2. Next, list all the elements from set B: 2,3,4,5.
  3. Combine these two lists into a single set. Remember, each element should only appear once. The elements 3 and 5 are in both sets, but we only write them down once in our final answer.
  4. Arrange the elements in order for clarity.

So, AB={1,2,3,4,5,7}.

How Do You Find the Intersection of Sets (∩)?

The intersection of two sets is a new set that contains only the elements that are present in both of the original sets. The key word here is 'and'. An element is in the intersection only if it is in the first set and in the second set. The symbol for intersection is an upside-down 'U': .

Think about two friends comparing their book collections. The intersection would be the small pile of books that they both own. It's their common ground.

For any two sets A and B, their intersection is defined as:
AB={xxA and xB}

This notation reads: "The set of all elements x such that x is an element of A and x is an element of B."

What if two sets have no elements in common? Their intersection is the empty set, which is written as or {}. Sets with an empty intersection are called disjoint sets.

Example 2

Let set P={circle, square, triangle, rectangle} and set Q={triangle, rhombus, square, trapezoid}. Find the intersection of P and Q, written as PQ.

Solution:

  1. Look at the elements in set P: circle, square, triangle, rectangle.
  2. Look at the elements in set Q: triangle, rhombus, square, trapezoid.
  3. Identify which elements appear in both lists.
  4. 'circle' is only in P.
  5. 'square' is in both P and Q.
  6. 'triangle' is in both P and Q.
  7. 'rectangle' is only in P.
  8. 'rhombus' and 'trapezoid' are only in Q.

The common elements are 'square' and 'triangle'.

So, PQ={square, triangle}.

Understanding the Complement of a Set (A')

The complement of a set contains all the elements that are not in that set. But not in it compared to what? To define a complement, we first need to establish a Universal Set, usually denoted by U. The universal set is the set of all possible elements we are considering for a particular problem.

The complement of a set A, written as A (or sometimes Ac or A¯), is the set of all elements in the universal set U that are not in A. Think of it as 'everything else' in the context of the problem.

For a set A within a universal set U, the complement of A is:
A={xxU and xA}

This reads: "The set of all elements x such that x is in the universal set U and x is not an element of A."

Example 3

Let the universal set be U={0,1,2,3,4,5,6,7,8,9} (the set of single-digit whole numbers). Let set V be the set of vowels in the word 'mathematics', so V={a, e, i}. Wait, this doesn't make sense! The elements of V are not in U. Let's restart with a proper example.

Let the universal set be U={0,1,2,3,4,5,6,7,8,9}. Let set M be the set of multiples of 3 in U. So, M={3,6,9}. Find the complement of M, written as M.

Solution:

  1. Identify the universal set: U={0,1,2,3,4,5,6,7,8,9}.
  2. Identify the set we are working with: M={3,6,9}.
  3. Find all the elements that are in U but are not in M.
  4. We go through U element by element: 0 is not in M. 1 is not in M. 2 is not in M. 3 is in M. 4 is not in M. 5 is not in M. 6 is in M. 7 is not in M. 8 is not in M. 9 is in M.
  5. Collect all the elements that were not in M.

So, M={0,1,2,4,5,7,8}.

What is the Difference Between Sets (A - B)?

The difference between two sets, written as AB or AB, is the set of elements that are in A but not in B. You can think of this as 'starting with set A and removing everything that is also in set B'.

It's important to note that the order matters! AB is generally not the same as BA. This operation is not commutative.

The difference of set A and set B is defined as:
AB={xxA and xB}

Interestingly, the set difference can also be defined using intersection and complement: AB=AB. This means the elements that are in A AND are NOT in B.

Let's use the sets from Example 1: A={1,3,5,7} and B={2,3,4,5}.

  • To find AB, we start with all elements of A and remove any that are also in B. The elements 3 and 5 are in both. So we remove them from A. This leaves us with AB={1,7}.
  • To find BA, we start with all elements of B and remove any that are also in A. Again, 3 and 5 are in both. So we remove them from B. This leaves us with BA={2,4}.

As you can see, ABBA.

How Can Venn Diagrams Visualize Set Operations?

Venn diagrams are a powerful way to visualize the relationships between sets and the results of set operations. In a Venn diagram, sets are represented by circles (or other shapes). The circles are enclosed within a rectangle, which represents the universal set U.

The way the circles overlap and are shaded shows the outcome of an operation:

OperationDescription of Shaded Area
Union: ABThe entire area of both circle A and circle B is shaded. It represents everything belonging to either set.
Intersection: ABOnly the overlapping portion of the two circles is shaded. This small lens shape represents what the sets have in common.
Complement: AThe entire area outside of circle A but still inside the universal rectangle is shaded. It's everything in the universe except for A.
Difference: ABThe area of circle A that does not overlap with circle B is shaded. It's what's unique to A when compared to B.

Using these diagrams can make complex problems involving multiple sets much easier to understand. For example, the region representing (AB)C can be found by first visualizing the union of A and B, and then finding where that combined shape overlaps with circle C.

What Are Common Mistakes with Set Operations?

When first learning set operations, students often make a few common errors. Being aware of these pitfalls can help you avoid them.

  1. Confusing Union (∪) and Intersection (∩): This is the most frequent mistake. Remember: Union is like a cup that holds everything from both sets. Intersection is the narrow overlap between them.
  2. Listing Duplicates in a Union: When you find AB, if an element is in both A and B, it should only be listed once in the final set. Sets are collections of distinct elements. For example, {1,2}{2,3}={1,2,3}, not {1,2,2,3}.
  3. Forgetting the Universal Set (U) for Complements: The complement A is meaningless without a defined universal set U. The answer for A is completely dependent on what's in U. Always identify U first.
  4. Assuming Set Difference is Commutative: Remember that AB is not the same as BA. The order matters greatly. Always start with the first set and remove elements found in the second.
  5. Misinterpreting the Empty Set (∅): If AB=, it doesn't mean something is wrong. It simply means the sets are disjoint—they have no elements in common. The empty set is a valid and important result.

Set Operations: A Quick Summary

Here is a quick reference table to help you remember the key set operations. Use this as a study guide!

OperationSymbolKey PhraseMeaning
UnionA or BCreates a new set with all elements from both sets.
IntersectionA and BCreates a new set with only the elements common to both sets.
ComplementA or AcNot ACreates a new set with all elements in the universal set U that are not in set A.
DifferenceABA but not BCreates a new set with elements from set A after removing any that are also in set B.

Frequently Asked Questions

What is the main difference between union and intersection?

The main difference is the condition for including an element. For a union (∪), an element is included if it's in set A OR set B (or both). For an intersection (∩), an element is only included if it's in set A AND set B.

What is a universal set and why is it important?

The universal set, denoted by U, is the set of all possible elements being considered in a specific problem. It's crucial for the complement operation, as the complement of a set A (A') consists of all elements in U that are not in A.

Can the intersection of two sets be empty?

Yes. If two sets have no elements in common, their intersection is the empty set, written as ∅ or {}. Such sets are called disjoint sets.

Is A - B the same as B - A?

No, they are generally not the same. A - B contains elements that are in A but not in B, while B - A contains elements that are in B but not in A. This means the set difference operation is not commutative.

Do you list an element twice in a union if it's in both sets?

No. A fundamental property of sets is that they contain distinct elements. Even if an element appears in both sets, it is only listed once in their union.

What does the symbol ∈ mean?

The symbol ∈ means 'is an element of'. For example, the statement 3 ∈ {1, 2, 3, 4} is true because 3 is an element of that set. The symbol ∉ means 'is not an element of'.

How are set operations used in real life?

Set operations are used constantly in computer science and data analysis. Search engines use intersection to find web pages that contain 'all' of your search words. Databases use union to combine results from different queries.