0% found this document useful (0 votes)
8 views24 pages

Discrete Structures Lecture 9

Uploaded by

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

Discrete Structures Lecture 9

Uploaded by

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

Discrete Structures

Lecture - 9
Set
Operations
Set Operations

• Two sets can be combined in many different


ways.

• Set operations can be used to combine sets.


Unio
n
• Let A and B be sets.

• The union of A and B, denoted by A ⋃ B, is the set


containing those elements that are either in A or
in B, or in both.

• A ⋃ B = {x | x ∈ A ˅ x ∈ B}
Intersection

• Let A and B be sets.

• The intersection of A and B, denoted by A ∩ B, is


the set
containing those elements in both A and B.

• 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

• Let A and B be sets.

• The difference of A and B, denoted by A - B, is the


set containing those elements that are in A but
not in B. (also called complement of B with respect
to A).

• 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

• Let U be the universal set and A be a set.

• The complement of A, denoted by A, is the


complement
of A with respect to U (which is U - A).

•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 }

• Let A = { x | x ∈ Z ˄ x is odd } and

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

• Assume thatan element is a


member of one of the identities
• Then show it is a member of the other
Example
• Show 𝐴 ∩ 𝐵 ∪ 𝐶 = ∪ 𝐴∩𝐶
𝐴∩𝐵
Solution:
Part 1: 𝐴 ∩ 𝐵 ∪ 𝐶⊆ ∪ 𝐴 ∩ 𝐶
𝐴∩𝐵
Ass𝑢𝑚𝑒 𝑥 ∈ 𝐴 ∩ 𝐵 ∪ 𝐶
𝑥 ∈ 𝐴 ˄ (𝑥 ∈ 𝐵 ∪ 𝐶
)
Definition of

𝑥∈𝐴˄𝑥 (𝑥∈∈𝐵𝐵 𝗏 𝑥 𝗏 (𝑥 Definition


∈ 𝐴 ˄ 𝑥 of Union
Intersection


𝑥∈𝐶)(𝐴∩ 𝐵) 𝗏 (𝑥 ∈ (𝐴 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

You might also like