Sets and Set Notation | Free Discrete Mathematics Lesson (4 College Credits) | UPI Study

UPI Study › Courses › Discrete Mathematics › Free lessons › Lesson 2.1 Free with a free account

Sets and Set Notation

Discrete Mathematics · Chapter 2: Set Theory and FunctionsSection 2.1 · lesson 9 of 878 min · free with a free account

← Tautologies and ContradictionsNext lesson: The Universal Set and Subsets →

Earn 4 college credits for Discrete MathematicsRecommended for credit by NCCRS · Math 230 · self-paced · one payment, lifetime access

In this lesson

Membership - the single question set theory is built on.

  • Define a set, its elements, and membership
  • Write sets in roster and set-builder notation
  • Name the 4 standard number sets and how they nest
  • Recognize the empty set, singletons, and set equality

Transcript

Everything said in the video, section by section (1,240 words). Read along, or search it.

Set Theory and Functions

Sets and Set Notation

Chapter two turns the tools of formal logic toward collections of objects. It starts with the most basic notion of all, the set. This section defines what a set is, how to write one down, and how to tell whether something belongs to it. We'll also meet the four standard number sets, the empty set, and what it means for two sets to be equal.

The Opening Problem

Is This Username Banned?

A content-moderation system for a social platform keeps a list of permanently banned usernames. Root, admin, test, and guest. Whenever a new account is created, the system asks one question. Is this proposed username a member of the banned collection, or not? That single question, membership, is the entire foundation on which set theory is built.

Definition

Sets, Elements, and Membership

A set is an unordered collection of distinct objects, called its elements, or members. A set is fully determined by which objects it contains. Not by the order they're listed in, and not by how many times an object is mentioned. If x is an element of a set S, we write x is in S, using the element symbol. If it isn't, we write x is not in S. Against the banned set B, admin is in B is true. alice one two three is in B is false. There's no middle ground. No username is halfway a member. Two features are easy to overlook. First, a set has no order. Root and admin, and admin and root, are the same set. Second, a set has no duplicates. Listing root twice doesn't create two copies. That set still has two usernames, not three.

2 Notations

Roster and Set-Builder

There are two ways to write a set down. Roster notation lists the elements explicitly inside braces, separated by commas. It's direct and unambiguous for small, finite sets, like the banned usernames. Set-builder notation states a property the elements must satisfy. It's read as the set of all x such that P of x is true. The vertical bar reads such that. Some sources use a colon instead. This course uses the bar. Here's one set written both ways. In roster form, zero, two, four, six, eight, ten. In set-builder form, the set of natural numbers x such that x is even and x is at most ten.

Checking the Example

Same Set, 2 Descriptions

It's worth checking that these really are the same set, rather than taking it on faith. The set-builder condition admits zero, two, four, six, eight, and ten. Each is a natural number, each is even, and each is at most ten. It excludes every other natural number. One, three, five, seven, and nine fail the even requirement. Twelve, fourteen, and beyond fail the at-most-ten requirement. So the two descriptions admit exactly the same six values. The notation is a choice of convenience, not a property of the set. And set-builder notation is the only practical option once a set is infinite. All the even natural numbers, with no upper bound, can't be written as a roster. No finite list extended with dots is precise. But set-builder notation states the defining property exactly.

Standard Number Sets

4 Sets Worth a Symbol

Four number sets recur so often that they get standard symbols, written in a double-struck, or blackboard bold, typeface. The natural numbers are the counting numbers together with zero. Zero, one, two, three, and so on. Some sources leave zero out. This course includes it. The integers are the naturals together with their negatives. The rational numbers are every number expressible as a ratio of two integers, a over b, where b isn't zero. And the real numbers are every number on the number line. That includes every rational number, and every irrational one, such as the square root of two, and pi.

Where They Show Up

Declaring What Kind of Number

These sets show up wherever a system has to declare what kind of number a value may be. An array index must be a natural number. There's no element at index minus three, or index two and a half. A ledger balance is typically an integer number of cents. Debits need negative values, but fractional cents aren't meaningful. A currency field stored as a fixed-precision decimal is really a rational number, a ratio of integers. And a temperature or voltage reading is naturally a real number, since it varies continuously. Notice that every natural number is also an integer. Every integer is also rational, because n is n over one. And every rational number is also real.

Figure 2.1.1

The Number Sets, Nested

This figure shows the four number sets, nested inside one another. Every natural number sits inside the integers, every integer inside the rationals, and every rational inside the reals. Minus five and one hundred sit in the integer band, because they aren't natural numbers. Three quarters and minus two thirds sit in the rational band, because they aren't integers. And the square root of two and pi sit in the outermost band, because they can't be written as a ratio of two integers at all. The formal name for this kind of relationship, and its compact notation, come in section two point two.

Table 2.1.1

All Infinite - Only 2 Listable

This table summarizes the four sets. All four are infinite. But only the naturals and the integers can even be partially written in roster form, using an ellipsis. The rationals and the reals have no useful roster form at all. For them, set-builder notation isn't merely convenient. It's necessary.

Empty and Singleton Sets

Zero Members Is Still a Set

The empty set, written with a slashed circle or a pair of empty braces, is the set containing no elements at all. It's still a set, a collection with zero members. It isn't the absence of a set. A singleton set contains exactly one element, such as the set containing five. The singleton and the number five are different kinds of object. One is a set with one member. The other is that member. A moderation queue with no pending reports is modeled as the empty set, not as the absence of a queue. The system still has a well-defined collection to check against. It's simply empty. And a queue holding exactly one report is a singleton, distinct from the report itself, in the same way the set containing five is distinct from five.

Set Equality

Exactly the Same Elements

Two sets A and B are equal exactly when they contain precisely the same elements. For every object x, x is in A if and only if x is in B. Order and repeated listing play no role, since neither changes which elements a set contains. Compare one, two, three with three, two, one, two. Every element of the first appears in the second, and every element listed in the second is one, two, or three. So they're equal. The repeated two doesn't add a fourth element. Now compare one, two, three with one, two, three, four. Four is in the second set, but not the first. The test fails in one direction, so the sets aren't equal.

Takeaways

A Set Is Its Elements

To summarize. A set is determined only by which elements it contains. Order and repetition are irrelevant. Roster notation works for small, finite sets. Set-builder notation is required once a set is infinite. The natural numbers, integers, rationals, and reals nest inside one another. The empty set is a set with zero elements, and a singleton is a different kind of object from its one element. Two sets are equal exactly when membership matches in both directions. Here's something to think about. Is the empty set the same object as the set containing the empty set? Using the definition of equality, explain why not. Ask how many elements each one contains.

About Discrete Mathematics at UPI Study

Discrete Mathematics (Math 230) is a self-paced online course of 87 video lessons in 13 chapters, from logic and proof to counting, probability, graph theory and trees. It carries a NCCRS credit recommendation for 4 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Why take it here

Why students take Discrete Mathematics with UPI Study

The math behind computer scienceDiscrete Mathematics is the mathematics of computer science: logic, proofs, sets, counting, probability and graphs underpin algorithms, data structures, cryptography and databases. Completing it now lets you qualify for those courses at your university.
Credit at a fraction of the priceThe same 4 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Discrete Mathematics carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Sets and Set Notation

What is a set in discrete math, and what does it mean to be an element of a set?
A set is an unordered collection of distinct objects, called its elements or members. Membership is all-or-nothing: if x is in S, write x \in S, otherwise x \notin S. Order and repeats do not matter, so \{\text{root}, \text{admin}\} and \{\text{admin}, \text{root}, \text{root}\} are the same set with two elements.
What is the difference between roster notation and set-builder notation?
Roster notation lists the elements inside braces, while set-builder notation states a property the elements must satisfy. For example, \{0,2,4,6,8,10\} and \{x \in \mathbb{N} \mid x \text{ is even and } x \le 10\} describe the same set. Set-builder notation is needed for infinite sets, such as all even natural numbers, that cannot be listed exactly.
What are the four standard number sets and how do they nest?
The four standard sets are the natural numbers \mathbb{N}, integers \mathbb{Z}, rationals \mathbb{Q}, and reals \mathbb{R}. They nest as \mathbb{N} \subseteq \mathbb{Z} \subseteq \mathbb{Q} \subseteq \mathbb{R}. Every natural number is an integer, every integer n is rational because n = n/1, and every rational is real. This course counts 0 as a natural number.
How do you tell whether two sets are equal, and is the empty set the same as the set containing the empty set?
Two sets are equal exactly when they have the same elements: x \in A if and only if x \in B for every x. So \{1,2,3\} equals \{3,2,1,2\}, but not \{1,2,3,4\}. The empty set \varnothing has zero elements, while \{\varnothing\} has one element, so by this test they are not equal.

About the Discrete Mathematics course

How many college credits is Discrete Mathematics?
Discrete Mathematics (Math 230) carries a NCCRS credit recommendation for 4 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Discrete Mathematics cost and what is included?
$250, paid once, with lifetime access: all 87 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Discrete Mathematics take?
It is self-paced with no deadlines. The 87 lessons total about 13 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 4 credits in Discrete Mathematics.

87 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Discrete Mathematics
4 credits · NCCRS
Enroll →