DM - 7 Sets
DM - 7 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 an not 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
12
-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.
13
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.
14
FIGURE 1
Venn Diagram for the Set of Vowels
15
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
17
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
18
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
24
Super Set
Quick Examples
• Is {1,2,3}? Yes!
• Is {1,2,3}? No!
• Is {,1,2,3}? Yes!
• Is {,1,2,3}? Yes!
26
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. No 4. No
27
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,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