Sets Operations
Sets Operations
Introduction
Discrete Mathematics
Slides by Andrei Bulatov
Discrete Mathematics – Operations on Sets 12-2
Previous Lecture
Venn Diagrams
set
universe
B is a subset of A
B
A
Discrete Mathematics – Operations on Sets 12-4
Intersection
! Examples
{1,3,5,7} ∩ {2,3,4,5,6} = {3,5}
{Jan.,Feb.,Dec.} ∩ {Jan.,Feb.,Mar.} = {Jan.,Feb.}
{x | ∃y x=2y} ∩ {x | ∃y x=3y} = {x | ∃y x=6y}
Discrete Mathematics – Operations on Sets 12-5
Union
! Examples
{Mon,Tue,Wed,Thu,Fri} ∪ {Sat,Sun} = {Mon,Tue,Wed,Thu,Fri,Sat,Sun}
{1,3,5,7} ∪ {2,3,4,5,6} = {1,2,3,4,5,6,7}
Discrete Mathematics – Operations on Sets 12-6
A B
Symmetric Difference
AΔB
! Example
{Jan.,Feb.,Mar.} Δ {Dec.,Jan.,Feb.} = {Dec.,Mar.}
Discrete Mathematics – Operations on Sets 12-8
Complement
Difference
A–B
! {1,3,5} – {1,2,3} = {5}
! Clearly, = U – A.
Discrete Mathematics – Operations on Sets 12-11
Another Proof
! Another way to prove equalities for sets is to use the set builder
construction and some logic.
={x|x∉A∩B} by definition of complement
= { x | ¬(x ∈ A ∩ B) } by definition of does not belong symbol
= { x | ¬(x ∈ A ∧ x ∈ B) } by definition of intersection
= { x | ¬(x ∈ A) ∨ ¬(x ∈ B) } by De Morgan’s law
= { x | (x ∉ A) ∨ (x ∉ B) } by def. of does not belong symbol
= { x | (x ∈ ) ∨ (x ∈ ) } by definition of complement
={x|x∈ ∪ } by definition of union
=
Q.E.D.
Discrete Mathematics – Operations on Sets 12-13
¬ corresponds to complement
∨ corresponds to union ∪
∧ corresponds to intersection ∩
⊕ corresponds to symmetric difference Δ
0 (false) corresponds to the empty set ∅
1 (truth) corresponds to the universe U
Discrete Mathematics – Operations on Sets 12-14
A∪∅=A
A∩U =A Identity laws
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) Distributive laws
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
De Morgan’s laws
A ∩ (A ∪ B) = A Absorption laws
A ∪ (A ∩ B) = A
A∪ =U Complement laws
A∩ =∅
Discrete Mathematics – Operations on Sets 10-16
Homework