DM 5 Sets
DM 5 Sets
DM 5 Sets
Sets
Course Code: CSC 1204 Course Title: Discrete Mathematics
Lecture Outline
2.1 Sets
• Definition of Set
• Representation of a Set
• Different Types of Sets
• Standard Numerical Sets
• -Notation
• Venn diagram
• Equal Set, Subset, Proper Subset, Cardinality of a Set, Super
Set, Power Set, Ordered n-tuples, Cartesian Product of Sets
4
Sets
Sets
Representation of a Set
{1, 2, 3} is the set containing elements “1” and “2” and “3.”
{1, 1, 2, 3, 3} = {1, 2, 3} since repetition is irrelevant.
{1, 2, 3} = {3, 2, 1} since sets are unordered (order of elements
does NOT matter)
{0,1, 2, 3, …} is a way we denote an infinite set (in this case, the
natural numbers).
= {} is the empty set, or the set containing no elements.
A = { a, 2, Fred, New York } ==> Although elements are usually
same type, but they may be of different types
9
-Notation
• The Greek letter “” (epsilon) is used to denote that an object is an element of
a set. When crossed out “” denotes that the object is not an element.”
Example: 3 S reads: “3 is an element of the set S ”.
3 S reads: “3 is not an element of the set S ”.
• Q: Which of the following are true:
1. 3 R
2. -3 N
3. -3 R
4. 0 Z+
5. x, xR x2 = - 5
14
-Notation
Answers:
1. 3 R. True: 3 is a real number.
2. 3 N. False: natural numbers don’t contain
negatives.
3. 3 R. True: 3 is a real number.
4. 0 Z+. True: 0 is NOT a positive integer.
5. x xR x2 = 5 . False: square of a real number is
non-negative, so can’t be 5.
15
Venn diagram
• Sets can be represented graphically using Venn diagrams.
• In Venn diagrams, the universal set U, which contains all the
objects under consideration, is represented by a rectangle.
Note: the universal set varies depending on which objects are of interest
• Inside the rectangle,
Circles or other geometrical figures are used to represent sets.
Sometimes points are used to represent the particular elements of the
set.
• Venn diagrams are often used to indicate the relationships
between sets.
16
FIGURE 1
Venn Diagram for the Set of Vowels
17
Equal Set
Subset
• Definition 4: The set A is a subset of B if and only if
every element of A is also an element of B.
• We use the notation A B to indicate that A is a subset
of the set B.
• A B if and only if the quantification
x(x A x B) is true
• Note: Every non-empty set S is guaranteed to have at
least two subsets, the empty set and the set S itself,
that is S and S S
19
Subset
Theorem 1: For every non-empty set S,
(1) S, and
(2) S S
• Note: If AB and BA, then A=B
• Sets may have other sets as members
A = {, {a}, {b}, { a, b} }
B = { x | x is a subset of the set {a ,b } }
Note: These two sets above are equal, that is, A = B
• Note : In the above example, {a} A, but a A
20
Proper Subset
Cardinality of a Set
Cardinality of a Set
Answers
• Example 9: Let A be the set of odd positive integers less than 10.
Then |A| = 5
• Example 10: Let A be the set of letters in the English alphabet.
Then |A| = 26
• Example 11: Because null set has no elements, it follows that, |
| = 0
• Examples:
• The cardinality of the set {} is 1, i.e., |{}| = 1
• If B = {3,3,3,3,3}, |B| = 1
• If C = { , {}, {,{}} }, | C | = 3.
• If S = {0,1,2,3,…}, |S| is infinite
26
Super Set
Quick Examples
• Is {1,2,3}? Yes!
• Is {1,2,3}? No!
• Is {,1,2,3}? Yes!
• Is {,1,2,3}? Yes!
28
The empty set is a subset of every set. This is because every element in the
empty set is also in set A. Of course, there are no elements in the empty set,
but every single one of those zero elements is in A.
The empty set is not an element of every set. It may be an element of some
sets; for example, the set 1,2,{},51,2,{},5 has the empty set as one of its
elements. However, the set 1,2,3,51,2,3,5 does not contain the empty set as an
element. In particular, the empty set is not an element of itself, for the simple
reason that the empty set has no elements at all.
29
Quiz: Yes/No?
1. Is {x} {x}?
2. Is {x} {x,{x}}?
3. Is {x} {x,{x}}?
4. Is {x} {x}?
Answer: 1. Yes 2. Yes 3. Yes 4. No
30
Power Set
Ordered n-tuples
Ordered n-tuples
Ordered n-tuples
Example:
Cartesian Product of Three Sets
• Question: If A = {1,2}, B = {3,4}, C = {5,6,7}, what is A B C ?
• Solution:
A B C = { (1,3), (1,4), (2,3),(2,4)} {5,6,7}
= { (1,3,5), (1,3,6), (1,3,7),(1,4,5), (1,4,6), (1,4,7),
(2,3,5), (2,3,6), (2,3,7), (2,4,5), (2,4,6), (2,4,7) }
Practice @ Home