1
Sets

2
What is a set?
•
–
–
–
–
–
•
–
–
A set is a group of “objects”
People in a class: { Alice, Bob, Chris }
Classes offered by a department: { CS 101, CS 202, … }
Colors of a rainbow: { red, orange, yellow, green, blue, purple }
States of matter { solid, liquid, gas, plasma }
Sets can contain non-related elements: { 3, a, red, Bob }
Although a set can contain (almost) anything, we will most often use sets
of numbers
All positive numbers less than or equal to 5: {1, 2, 3, 4, 5}
A few selected real numbers: { 2.1, π, 0, -6.32, e }

3

4
The collection of persons living in Sorsogon is a
set.
Each person living in Sorsogon is an element of the set.
The collection of all Brgy. in Bulan is a set.
Each Barangay in Bulan is an element of the set.

5
The roster method of specifying a set consists
of surrounding the collection of elements with
braces.

6
For example the set of counting numbers from
1 to 5 would be written as
{1, 2, 3, 4, 5}.

7
A variation of the simple roster method uses the
ellipsis
( … ) when the pattern is obvious and the
set is large.
{1, 3, 5, 7, … , 9007} is the set of odd
counting numbers less than or equal to
9007.
{1, 2, 3, … } is the set of all counting
numbers.

8
Set builder notation has the general form
{variable | descriptive statement }.
The vertical bar (in set builder notation) is always read as
“such that”.
Set builder notation is frequently used when the roster
method is either inappropriate or inadequate.

9
Example:
{x | x < 6 and x is a counting number} is the set
of all counting numbers less than 6. Note this is
the same set as {1,2,3,4,5}.
{x | x is a fraction whose numerator is 1 and
whose denominator is a counting number }.
Set builder notation will become much more concise and precise as more
information is introduced.

10
Set properties 1
•
–
–
•
Order does not matter
We often write them in order because it is easier for humans to understand it
that way
{1, 2, 3, 4, 5} is equivalent to {3, 5, 2, 4, 1}
Sets are notated with curly brackets

11
Set properties 2
•
–
•
•
–
•
•
–
Sets do not have duplicate elements
Consider the set of vowels in the alphabet.
It makes no sense to list them as {a, a, a, e, i, o, o, o, o, o, u}
What we really want is just {a, e, i, o, u}
Consider the list of students in this class
Again, it does not make sense to list somebody twice
Note that a list is like a set, but order does matter and duplicate
elements are allowed
We won’t be studying lists much in this class

#### You've reached the end of your free preview.

Want to read all 35 pages?

- Winter '17