No history yet

Introduction to Sets

What Is a Set?

In mathematics, a set is simply a collection of distinct objects. Think of it like a grocery list, a playlist of your favorite songs, or a box of crayons. Each object in the collection is an element, or member, of the set.

A set is a well-defined collection of distinct objects.

Two key ideas here are "well-defined" and "distinct." "Well-defined" means we can tell for sure whether an object belongs to the set or not. For example, "the set of tall people" is not well-defined because "tall" is subjective. However, "the set of people over 6 feet tall" is well-defined.

"Distinct" means no two elements in a set are the same. A set containing the numbers {1, 2, 3} is the same as the set {3, 2, 1, 1}. The order of elements doesn't matter, and duplicates are ignored.

How to Describe Sets

We use curly braces {} to denote a set. There are two common ways to describe what's inside them.

Roster Notation

noun

A method of defining a set by listing all of its elements, separated by commas.

This is the most straightforward method. You just list everything in the set. For example, if we have a set V that contains all the vowels in the English alphabet, we would write it like this:

V={a,e,i,o,u}V = \{a, e, i, o, u\}

The other method is called set-builder notation. This way defines a set by describing the properties its elements must have. It's especially useful for sets with many or infinite elements.

The format is {variable | a rule the variable must follow}.

The vertical bar | is read as "such that." So, for our set of vowels V, we could write:

V={xx is a vowel in the English alphabet}V = \{x \mid x \text{ is a vowel in the English alphabet}\}

This reads, "V is the set of all elements x, such that x is a vowel in the English alphabet." Both notations describe the exact same set. Here's another example comparing the two methods for a set E containing all positive even numbers less than 10.

NotationExample for Set E
RosterE = {2, 4, 6, 8}
Set-Builder`E = {x

Combining Sets

Just like we can add or subtract numbers, we can perform operations on sets. Let's look at three basic ones. For our examples, we'll use two sets, A and B.

A={1,2,3,4}andB={3,4,5,6}A = \{1, 2, 3, 4\} \quad \text{and} \quad B = \{3, 4, 5, 6\}

First up is the union. The union of two sets contains all the elements that are in either set, or both. The symbol for union is .

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

Notice that even though 3 and 4 are in both sets, they are listed only once in the union. Remember, sets only contain distinct elements.

Next is the intersection. The intersection of two sets contains only the elements that are in both sets. The symbol for intersection is .

AB={3,4}A \cap B = \{3, 4\}

The numbers 3 and 4 are the only elements that appear in set A and also in set B.

Finally, we have the difference. The difference A - B is the set of elements that are in A but not in B. You can think of this as taking set A and removing everything that is also in set B.

AB={1,2}A - B = \{1, 2\}

Note that the order matters here. B - A is a different operation. It gives you the elements in B that are not in A.

BA={5,6}B - A = \{5, 6\}

These basic concepts of sets and their operations are building blocks for many other areas of mathematics, logic, and computer science. Time to test your knowledge.

Quiz Questions 1/6

Which of the following collections is a well-defined set?

Quiz Questions 2/6

Which of the following sets is equal to the set {a,b,c}\{a, b, c\}?

Sets provide a precise language for grouping things together, which is a surprisingly powerful idea.