0% found this document useful (0 votes)
46 views16 pages

Sets Operations

The document discusses several common set operations including intersection, union, complement, difference, and symmetric difference. It also examines properties of these operations such as commutative, associative, distributive, absorption, identity, and De Morgan's laws that allow logical and algebraic manipulation of sets. Visual representations of sets using Venn diagrams are also introduced to help illustrate relationships between sets.

Uploaded by

moses mulenga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views16 pages

Sets Operations

The document discusses several common set operations including intersection, union, complement, difference, and symmetric difference. It also examines properties of these operations such as commutative, associative, distributive, absorption, identity, and De Morgan's laws that allow logical and algebraic manipulation of sets. Visual representations of sets using Venn diagrams are also introduced to help illustrate relationships between sets.

Uploaded by

moses mulenga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Operations on Sets

Introduction

Discrete Mathematics
Slides by Andrei Bulatov
Discrete Mathematics – Operations on Sets 12-2

Previous Lecture

! Sets and elements


! Subsets, proper subsets, empty sets
! Universe
! Cardinality
! Power set
Discrete Mathematics – Operations on Sets 12-3

Venn Diagrams

! Often it is convenient to visualize various relations between sets.


We use Venn diagrams for that.

set
universe

B is a subset of A
B
A
Discrete Mathematics – Operations on Sets 12-4

Intersection

! The intersection of sets A and B, denoted by A ∩ B, is the


set that contains those elements in both A and B.
! A ∩ B = { x | x ∈ A ∧ x ∈ B} B
A
A∩B

! 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

! The union of sets A and B, denoted by A ∪ B, is the set that


contains those elements that are either in A or in B.
! A ∪ B = { x | x ∈ A ∨ x ∈ B} B
A
A∪B

! 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

Disjoint Sets and Principle of Inclusion-Exclusion

! Sets A and B are said to be disjoint if A ∩ B = ∅.


Sets {Mon,Tue,Wed,Thu,Fri} and {Sat,Sun} are disjoint.
! Principle of inclusion-exclusion. For any finite sets A and B
|A∪B| = |A|+|B|-|A∩B|

A B

To count elements in A ∪ B we first count elements of A, then


elements of B. Elements of A ∩ B are counted twice, so, we
subtract the number of such elements
! If A and B are disjoint, then | A ∪ B | = | A | + | B |
Discrete Mathematics – Operations on Sets 12-7

Symmetric Difference

! The symmetric difference of sets A and B, denoted by A Δ B, is


the set that contains those elements that are either in A or in B, but
not in both.
! A Δ B = { x | x ∈ A ⊕ x ∈ B}
B
A

AΔB
! Example
{Jan.,Feb.,Mar.} Δ {Dec.,Jan.,Feb.} = {Dec.,Mar.}
Discrete Mathematics – Operations on Sets 12-8

Disjoint Sets and Symmetric Difference

! Theorem. Sets A and B are disjoint if and only if


A∪B = AΔB
! Proof.
Notice first that A Δ B ⊆ A ∪ B.
Suppose A and B are disjoint. To prove the equality, it suffices to
show that A ∪ B ⊆ A Δ B.
Take x ∈ A ∪ B. It belongs to A or B, but x ∉ A ∩ B, as the
intersection is empty. Therefore, x ∈ A Δ B.
We prove by contraposition. Assume A ∩ B ≠ ∅. Say x ∈ A ∩ B
Then x ∈ A ∪ B.
However, from x ∈ A ∩ B we conclude that x ∉ A Δ B.
Therefore, A ∪ B ≠ A Δ B.
Q.E.D.
Discrete Mathematics – Operations on Sets 12-9

Complement

! Let A be a set and U a universe, A ⊆ U. The complement of


A, denoted by , is the set that comprises all elements of U that
do not belong to A.
= { x | x ∈ U and x ∉ A } = { x | x ∉ A }

! Let the universe be the set of all integers, and A = { x | ∃y x=2y }


Then is the set of all odd numbers
! The universe is the Latin alphabet, A = { a,e,I,o,u,y }.
Then = { b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,z }.
Discrete Mathematics – Operations on Sets 12-10

Difference

! The difference of sets A and B (or relative complement of B in


A), denoted by A – B, is the set containing those elements that are
in A, but not in B.
A – B = { x | x ∈ A ∧ x ∉ B }.
B
A

A–B
! {1,3,5} – {1,2,3} = {5}
! Clearly, = U – A.
Discrete Mathematics – Operations on Sets 12-11

Laws of Set Theory

! Similar to logic connectives and formulas, expressions built from


set operations and sets also satisfy some laws.
! Theorem.

Proof. We will show that and


Prove that . Take x ∈ .
By the definition, x ∉ A ∩ B. Therefore, x ∉ A or x ∉ B.
Hence x ∈ or x ∈ . Thus, x ∈

Now we prove that . Take x ∈ .


By definition, x ∈ or x ∈ . Therefore, x ∉ A or x ∉ B.
This implies x ∉ A ∩ B. And, finally, x ∈ .
Q.E.D.
Discrete Mathematics – Operations on Sets 12-12

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

Sets and Logic

! If we look closer at the second proof, we notice that there is a very


tight connection between set operations and logic connectives

¬ 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

More Laws of Set Theory

A∪∅=A
A∩U =A Identity laws

A∪U =U Domination laws


A∩∅=∅
A∪A =A Idempotent laws
A∩A =A
Complementation law
A∪B =B∪A Commutative laws
A∩B =B∩A
A ∪ (B ∪ C) = (A ∪ B) ∪ C Associative laws
A ∩ (B ∩ C) = (A ∩ B) ∩ C
Discrete Mathematics – Operations on Sets 12-15

More Laws of Set Theory (cntd)

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

Exercises from the Book:


No. 1, 4, 6, 8bc, 16, 17bc (page 146 – 147)

You might also like