Course 1.1Lesson 1 of 3
A set is a collection in which it is clear what belongs. We write sets in roster form or in set-builder form, and we meet subsets, the empty set, intervals, union, intersection, difference and complement. For two finite sets, .
This lesson is free to read. Enroll free to keep your place and take the tests.
Try the code and the simulations beside the lesson.
Your class register is a list of names. The books in your bag are a collection of books. The vowels of the English alphabet are . In each case, you can say for sure whether something belongs to the collection or not.
A set is a collection of objects in which it is clear what belongs to it and what does not. The objects are called the elements (or members) of the set. We write sets with capital letters, and elements with small letters.
"The tall students of the class" is not a set, because people may not agree who is tall. "The students of the class with a height above " is a set.
Roster form. List all the elements between braces: . The order does not matter, and a repeated element counts once.
Set-builder form. Give the rule: . We read the colon as "such that".
Some sets have standard names:
| Symbol | Set |
|---|---|
| the natural numbers | |
| the integers | |
| the rational numbers, which are the numbers with | |
| the real numbers, all the points of the number line |
The empty set has no element. For example, . A set with one element is a singleton. A set is finite if we can count its elements, and infinite if we cannot. The number of elements of a finite set is written .
is a subset of , written , if every element of is also in . For example, . Three facts are always true:
How many subsets? To make a subset of a set with elements, we decide for each element: in or out. There are choices for each of the elements, so the number of subsets is
The set of all subsets of is called the power set . For there are subsets: , , , , , , and . All except itself are proper subsets, so there are of them.
Sets of real numbers between two ends are written as intervals. A round bracket leaves the end out. A square bracket keeps it.
We use intervals all the time for the domain and the range of a function. The symbol is not a number. It only says that the interval has no end.
Let be the universal set, the set of everything that we talk about.
| Operation | Symbol | Meaning |
|---|---|---|
| Union | the elements that are in , or in , or in both | |
| Intersection | the elements that are in both | |
| Difference | the elements that are in and not in | |
| Complement | the elements of that are not in |
If , the sets are disjoint.
Example. Let , and . Then , , , and .
De Morgan's laws. The complement of a union is the intersection of the complements, and the complement of an intersection is the union of the complements:
If we add and , the elements of are counted twice. So we take them away once:
Example. In a class of students, play cricket, play chess and play both. The number who play at least one game is . So students play neither.
Push the overlap up to the size of the smaller set. Then the smaller circle sits inside the larger one, and n(A ∪ B) is just the larger size.
Python has sets, with the same operations. This program finds the union, the intersection, the differences and the complement of two sets.
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
Every lesson is open to read. Enrolling also lets you:
Log in to join the discussion.
Loading…