Discrete Structures Lecture 9
Discrete Structures Lecture 9
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}
A⋃B
B = {2,4,6,8}
=
{1,2,3,4,6,8}
• Let A = {x | x ∈ Z ˄ x is
B = {x |x ∈ Z
˄ x is odd} A ⋃ B
even}
=
Z
Intersection (example)
• Let A = {1,2,3}
B=
{2,4,6,8} A
∩B =
{2}
• Let A=Z
∈ Z ˄ x is
B = {x |x
odd}
A∩B
Disjoint
Sets
• Two sets are called disjoint if their intersection is
empty.
A = {x | x ∈ Z ˄ x is
B = {x |x ∈ Z
• Let
even}
˄ x is odd} A ∩ B = Ø
The Cardinality of the Union
• |A ⋃ B|
of Sets
=?
Solution:
• Let A = {1,2,3}
A⋃B=
B = {2,3,4}
{1,2,3,4} |A ⋃ B|
• |A| = 3 |B| = =4
3 ⋃ B| = |A| + |B| - |A ∩
• |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
A = { e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
U is the set of English alphabet
w, x, y, z }
A = { x | x ∈ Z ˄ x is even }
U is Z
Summary Set Operations
Operation Notation
Union A ⋃ B = {x | x ∈ A ˅ x ∈ B}
Intersection A ∩ B = {x | x ∈ A ˄ x ∈ B}
A - B = {x | x ∈ A ˄ x ∉ B}
A= x x∉A+
Difference
Complement (U - A)
Set Identities
A∪∅= Identity
A∩U=
A Laws
A∪U=
A Domination
A∩∅=
U Laws
∅
A∪A= Idempotent
A∩A=
A Laws
(A) =
A Complementation
A∪ A=
A Law
Complement
A∩A=
U Laws
Set Identities
A∪B=B∪
AA∩B=B
Commutative
Laws
∩A
Associative
A ∪ (B ∪ C) = (A ∪ B) Laws
∪ C A ∩ (B ∩ C) = (A
∩ B) ∩ C Absorption
Laws
A ∪(A ∩ B)
= A A ∩(A ∪
B) = A
Set Identities
A ∪B=A∩ De Morgan’s
BA Law
∩ B=A∪
B Distributive
Law
A ∩ (B ∪ C)
= (A ∩ B) ∪
(A ∩ C)
A ∪ (B ∩ C)
= (A ∪ B) ∩
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
• Show A ∪ (B ∩ C) = (C ∪
(example)
B) ∩ A
Solution:
=
A∪ A (B
∩ B∩∩C) By DeMorgan′s
C Law By DeMorgan
=A A∩∩ (C
B ∪∪ ′
s Law (By
C
B) = (C ∪ B) CommutativeLaw)
(By Commutative
∩A 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:
A B A∪ B A∩ B A-B
1 1 1 1 0
1 0 1 0 1
0 1 1 0 0
0 0 0 0 0
Membership
A ∩ (B ∪ C) = (A ∩ B) ∪ (A
∩ C)
Table
A ∪ (B ∩ C) = (A ∪ B) ∩ (A
∪ C)
B∩C A ∪ (B ∩ C) A ∪ B
A B C
Distributive LawA ∪ C (A ∪ B) ∩ (A ∪ 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
Proof by showing each set is a
subset of the other
∈
𝑥∈𝐶)(𝐴∩ 𝐵) 𝗏 (𝑥 ∈ (𝐴 Law Definition of
∩ 𝐶))
Distributive
𝑥 ∈ (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)
Intersection
𝑆𝑜, 𝐴 ∩𝐵 ∪ 𝐶 ⊆ 𝐴 ∪ 𝐴 ∩ 𝐶
Definition of Union
Exampl
• Show 𝐴 𝐵 ∪ 𝐶= 𝐴 ∩ 𝐵 ∪
e
∩ 𝐴∩𝐶
2:𝐴 ∩ 𝐵
Solution: ∪ ⊆𝐴∩
𝐴∩𝐶
Part
Ass𝑢𝑚𝑒
𝑥 ∈ 𝐴 ∩𝑥𝐵∈ 𝗏 (𝑥 𝐵
∈ ∪ 𝐶 𝐴 ∩ 𝐶)
Definition of𝐴Union
∩𝐵 ∪ 𝐴∩𝐶
𝑥𝑥∈∈𝐴𝐴˄˄(𝑥𝑥∈ ∈𝐵 𝐵𝗏 𝑥 𝗏 (𝑥 Distributive
∈𝐴˄𝑥 ∈ 𝐶)
Law
∈ 𝐶)
Definition of Intersection Definition of Union
𝑥 ∈ 𝐴 ˄ (𝑥
𝑆𝑜, 𝐴 ∈ 𝐵∪∪ 𝐴 ⊆ 𝐴 Intersection
Definition of
𝐶)
∩𝐵 𝐵∪∩ 𝐶=
𝐶 𝐴∩ ∩𝐵 𝐵∪𝐶
𝑥 ∈ 𝐴 ∩𝐴
𝑇ℎ𝑢𝑠, (𝐵∩∪ 𝐶) ∪ 𝐴∩𝐶
Exercise Questions
Chapter # 2
Topic # 2.2
Question # 1, 2, 3,4,5,6,15,16,17,18,
19,20,21,22,23,24,25