Chapter2 - Part1 - Set
Chapter2 - Part1 - Set
(PART 1)
SETS
LEARNING OUTCOME
S = {a,b,c,d}
Order not important
S = {a,b,c,d} = {b,c,a,d}
Each distinct object is either a member or not; listing more than once does not
change the set.
S = {a,b,c,d} = {a,b,c,b,c,d}
Elipses (…) may be used to describe a set without listing all of the members
when the pattern is clear.
S = {a,b,c,d, ……,z }
ROSTER METHOD
V = {a,e,i,o,u}
Set of all odd positive integers less than 10:
O = {1,3,5,7,9}
Set of all positive integers less than 100:
S = {1,2,3,……..,99}
Set of all integers less than 0:
S = {…., -3,-2,-1}
SOME IMPORTANT SETS
S = {x | P(x)}
Example: S = {x | Prime(x)}
Positive rational numbers:
{{1,2,3},a, {b,c}}
{N,Z,Q,R}
SOME
THINGS TO
The empty set is different from a set
REMEMBER containing the empty set.
∅ ≠{∅}
SET EQUALITY
Definition: Two sets are equal if and only if they have the same elements.
Therefore if A and B are sets, then A and B are equal if and only if
{1,3,5} = {3, 5, 1}
{1,5,5,5,3,3,1} = {1,3,5}
SUBSETS
This is equivalent to
is true.
U
B
Venn Diagram A
SET CARDINALITY
Definition: The set of all subsets of a set A, denoted P(A), is called the power set
of A.
Example: If A = {a,b} then
P(A) = {ø, {a},{b},{a,b}}
If a set has n elements, then the cardinality of the power set is 2ⁿ.
TUPLES
The ordered n-tuple (a1,a2,…..,an) is the ordered collection that has a1 as its first
element and a2 as its second element and so on until an as its last element.
Two n-tuples are equal if and only if their corresponding elements are equal.
2-tuples are called ordered pairs.
The ordered pairs (a,b) and (c,d) are equal if and only if a = c and b = d.
René Descartes
(1596-1650)
CARTESIAN PRODUCT
Definition: The Cartesian Product of two sets A and B, denoted by
A × B is the set of ordered pairs (a,b) where a ∈ A and b ∈ B .
Example:
A = {a,b} B = {1,2,3}
A × B = {(a,1),(a,2),(a,3), (b,1),(b,2),(b,3)}
Suppose that A = {1, 2}, then a relation A x A i.e. from a set A to itself is called a
relation on A.
Find A3
CARTESIAN PRODUCT
What are the ordered pairs in the less than or equal to relation, which contains (a,
b) if a ≤ b, on the set {0, 1, 2, 3}?
𝐴={( 0 , 0 ) , ( 0 ,1 ) , ( 0 , 2 ) , ( 0 , 3 ) , ( 1 ,1 ) , ( 1 , 2 ) , ( 1 , 3 ) , ( 2 ,2 ) , ( 2 , 3 ) , ( 3 , 3 ) }
SET OPERATIONS
SECTION SUMMARY
Set Operations
Union
Intersection
Complementation
Difference
Set Identities
Proving Identities
Membership Tables
UNION
Definition: Let A and B be sets. The union of the sets A and B, denoted by A ∪ B,
is the set:
Solution: {3}
Example:What is? Venn Diagram for A ∩B
{1,2,3} ∩ {4,5,6} ?
U
Solution: ∅
A B
COMPLEMENT
Definition: If A is a set, then the complement of the A (with respect to U), denoted
by Ā is the set U - A
Ā = {x ∈ U | x ∉ A}
(The complement of A is sometimes denoted by Ac .)
Example: If U is the positive integers less than 100, what is the complement of {x |
x > 70}
Venn Diagram for Complement
Solution: {x | x ≤ 70} U
Ā
A
DIFFERENCE
U
A Venn Diagram for A − B
B
THE CARDINALITY OF THE UNION OF
TWO SETS
U
• Inclusion-Exclusion
A B
|A ∪ B| = |A| + | B| - |A ∩ B|
• Example: Let A be the math majors in your class and B be the CS majors. To count the
number of students who are either math majors or CS majors, add the number of math
majors and the number of CS majors, and subtract the number of joint CS/math majors.
REVIEW QUESTIONS
Example:
U = {0,1,2,3,4,5,6,7,8,9,10}
A = {1,2,3,4,5} B ={4,5,6,7,8}
U
What is ?
A B
Solution: {1,2,3,6,7,8}
Venn Diagram
SET IDENTITIES
Identity laws
Domination laws
Idempotent laws
Complementation law
Commutative laws
Associative laws
Distributive laws
SET IDENTITIES
De Morgan’s laws
Absorption laws
Complement laws
PROVING SET IDENTITIES
1) and
2)
Solution:
A B C
1 1 1 1 1 1 1 1
1 1 0 0 1 1 1 1
1 0 1 0 1 1 1 1
1 0 0 0 1 1 1 1
0 1 1 1 1 1 1 1
0 1 0 0 0 1 0 0
0 0 1 0 0 0 1 0
0 0 0 0 0 0 0 0
MEMBERSHIP TABLE EXAMPLE
A B C A B ( A B ) C A C BC (AC)(BC)
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
GENERALIZED UNIONS AND
INTERSECTIONS
We define:
These are well defined, since union and intersection are associative.
For i = 1,2,…, let Ai = {i, i + 1, i + 2, ….}. Then,
For any sets A, B, C Í U, by using the following diagram,
show that:
(A È B) Ç C = (A Ç B) È C.
1A
2 5
3 B
7 6
Region 3 is A Ç B Ç C 8
4
Region 7 is A Ç B Ç C
C
A È B comprises regions 2, 3, 5, 6, 7, 8 and C comprises of regions 4, 6, 7, 8.
Therefore, (A È B) Ç C comprises regions 6, 7, 8.
A = 1, 3, 4, 6, B = 1, 2, 4, 7, C = 1, 2, 3, 5 and A Ç B = 1, 4
Therefore, (A Ç B) È C = 1, 2, 3, 4, 5 is equal to (A È B) Ç C .
\ (A Ç B) È C = (A È B) Ç C.
Example:
Simplify the expression (A ÈB ) Ç C È B.
(A È B) Ç C È B Reasons
Therefore ,
A-B=AÇB Reasons
=AÈB DeMorgan’s Law
=AÈB Law of Double Complement
CLASS ACTIVITY
Note: Using bit strings to represent sets, it is easy to find complements of sets and
unions, intersections, and differences of sets .
COMPLEMENT OF A BIT
To find the bit string for the complement of a set from the bit string
for that set, simply change each 1 to a 0 and each 0 to 1, because x ∈
A if and only if x A.
Example:
The bit string for the set {1, 3, 5, 7, 9} (with universal set {1, 2, 3, 4, 5,
6, 7, 8, 9, 10}) is 10 1010 1010.
What is the bit string for the complement of this set?
Solution: The bit string for the complement of this set is obtained by
replacing 0s with 1s and vice versa.
Ans: 01 0101 0101 which corresponds to the set {2, 4, 6, 8, 10}.
UNION AND INTERSECTION OF TWO SET
To obtain the bit string for the union and intersection of two sets, perform bitwise
Boolean operations on the bit strings representing the two sets.
Example: The bit strings for the sets {1, 2, 3, 4, 5} and {1, 3, 5, 7, 9} are
11 1110 0000 and 10 1010 1010, respectively. Use bit strings to find the union and
intersection of these sets.
Solution:
The bit string for the union of these sets is
11 1110 0000 ∨ 10 1010 1010 = 11 1110 1010, which corresponds to the set {1, 2, 3, 4, 5,
7, 9}.
The bit string for the intersection of these sets is
11 1110 0000 ∧ 10 1010 1010 = 10 1010 0000, which corresponds to the set {1, 3, 5}.