Discrete Structures Lecture 9
Discrete Structures Lecture 9
(Discrete Mathematics)
Fall 2016
Lecture - 9
Set Operations
Set Operations
• A ⋃ B = {x | x ∈ A ˅ x ∈ B}
Intersection
• A ∩ B = {x | x ∈ A ˄ x ∈ B}
Union (example)
• Let A = {1,2,3}
B = {2,4,6,8}
A ⋃ B = {1,2,3,4,6,8}
• Let A = {x | x ∈ Z ˄ x is even}
B = {x |x ∈ Z ˄ x is odd}
A⋃B =Z
Intersection (example)
• Let A = {1,2,3}
B = {2,4,6,8}
A∩B ={2}
• Let A = Z
B = {x |x ∈ Z ˄ x is odd}
A ∩ B = {x |x ∈ Z ˄ x is odd}
Disjoint Sets
• Let A = {x | x ∈ Z ˄ x is even}
B = {x |x ∈ Z ˄ x is odd}
A∩B =Ø
The Cardinality of the Union of Sets
• |A ⋃ B|=?
Solution:
• Let A = {1,2,3}
B = {2,3,4}
A ⋃ B = {1,2,3,4}
• |A| = 3 |B| = 3 |A ⋃ B|=4
• |A ⋃ B| = |A| + |B| - |A ∩ B|
Difference
• A - B = {x | x ∈ A ˄ x ∉ B}
Difference (example)
• Let A = {1,2,3}
B = {2,4}
A – B = {1,3}
• Let A = Z
B = { x | x ∈ Z ˄ x is odd }
A – B = { x | x ∈ Z ˄ x is even }
Complement
•A= x x∉A+
Complement (example)
• Let A = { a, b, c, d } and
U is the set of English alphabet
A = { e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z }
Operation Notation
Union A ⋃ B = {x | x ∈ A ˅ x ∈ B}
Intersection A ∩ B = {x | x ∈ A ˄ x ∈ B}
Difference A - B = {x | x ∈ A ˄ x ∉ B}
Complement (U - A) A= x x∉A+
Set Identities
A∪∅=A Identity Laws
A∩U=A
A ∪ (B ∪ C) = (A ∪ B) ∪ C Associative Laws
A ∩ (B ∩ C) = (A ∩ B) ∩ C
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) Distributive Law
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
How to Prove a Set Identity
• Four methods:
• Use the basic set identities
• Use membership tables
• Prove each set is a subset of each other
• Use set builder notation and logical equivalences
Set Identities (example)
• Show A ∪ (B ∩ C) = (C ∪ B) ∩ A
Solution:
A ∪ (B ∩ C)
=A∩ B∩C By DeMorgan′ s Law
= A∩ B∪C By DeMorgan′ s Law
= A ∩ (C ∪ B) (By CommutativeLaw)
= (C ∪ B) ∩ A (By Commutative Law)
What is a membership table
• Membership tables show all the combinations of sets an
element can belong to
• 1 means the element belongs, 0 means it does not
• Consider the following membership table:
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
Proof by showing each set is a subset of the
other
Part 1: 𝐴 ∩ 𝐵 ∪ 𝐶 ⊆ 𝐴 ∩ 𝐵 ∪ 𝐴 ∩ 𝐶
Ass𝑢𝑚𝑒 𝑥 ∈ 𝐴 ∩ 𝐵 ∪ 𝐶
𝑥 ∈ 𝐴 ˄ (𝑥 ∈ 𝐵 ∪ 𝐶 ) Definition of Intersection
𝑥 ∈ 𝐴 ˄ (𝑥 ∈ 𝐵 ˅ 𝑥 ∈ 𝐶) Definition of Union
𝑥 ∈ 𝐴 ˄ 𝑥 ∈ 𝐵 ˅ (𝑥 ∈ 𝐴 ˄ 𝑥 ∈ 𝐶) Distributive Law
𝑥 ∈ (𝐴 ∩ 𝐵) ˅ (𝑥 ∈ (𝐴 ∩ 𝐶)) Definition of Intersection
𝑥 ∈ (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶) Definition of Union
𝑆𝑜, 𝐴∩ 𝐵∪𝐶 ⊆ 𝐴∩𝐵 ∪ 𝐴∩𝐶
Example
• Show 𝐴 ∩ 𝐵 ∪ 𝐶 = 𝐴 ∩ 𝐵 ∪ 𝐴 ∩ 𝐶
Solution:
Part 2: 𝐴 ∩ 𝐵 ∪ 𝐴 ∩ 𝐶 ⊆ 𝐴 ∩ 𝐵 ∪ 𝐶
Ass𝑢𝑚𝑒 𝑥 ∈ 𝐴 ∩ 𝐵 ∪ 𝐴 ∩ 𝐶
𝑥 ∈ 𝐴 ∩ 𝐵 ˅ (𝑥 ∈ 𝐴 ∩ 𝐶 ) Definition of Union
𝑥 ∈ 𝐴 ˄ 𝑥 ∈ 𝐵 ˅ (𝑥 ∈ 𝐴 ˄ 𝑥 ∈ 𝐶) Definition of Intersection
𝑥 ∈ 𝐴 ˄ (𝑥 ∈ 𝐵 ˅ 𝑥 ∈ 𝐶) Distributive Law
𝑥 ∈ 𝐴 ˄ (𝑥 ∈ 𝐵 ∪ 𝐶) Definition of Union
𝑥 ∈ 𝐴 ∩ (𝐵 ∪ 𝐶) Definition of Intersection
𝑆𝑜, 𝐴∩𝐵 ∪ 𝐴∩𝐶 ⊆𝐴∩ 𝐵∪𝐶
𝑇ℎ𝑢𝑠, 𝐴∩ 𝐵∪𝐶 = 𝐴∩𝐵 ∪ 𝐴∩𝐶
Proof by set builder notation and logical
equivalences
Chapter # 2
Topic # 2.2
Question # 1, 2, 3,4,5,6,15,16,17,18,
19,20,21,22,23,24,25