0% found this document useful (0 votes)
27 views27 pages

Unit#4 Set Theory

The document outlines the concepts of Set Theory as part of a lecture by Dr. Asif Sohail at the University of the Punjab. It covers various types of sets, set operations, and their notations, including finite and infinite sets, subsets, power sets, and Cartesian products. Additionally, it discusses Venn diagrams, set identities, and methods for proving set identities.

Uploaded by

bitf24a010
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)
27 views27 pages

Unit#4 Set Theory

The document outlines the concepts of Set Theory as part of a lecture by Dr. Asif Sohail at the University of the Punjab. It covers various types of sets, set operations, and their notations, including finite and infinite sets, subsets, power sets, and Cartesian products. Additionally, it discusses Venn diagrams, set identities, and methods for proving set identities.

Uploaded by

bitf24a010
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/ 27

GE-161

Discrete Structures

Unit 4:
Set Theory

Dr. Asif Sohail


University of the Punjab
Department of Information Technology, FCIT

Some of the slides are adapted from Fahad Hussain


https://fahadhussaincs.blogspot.com/
Lecture Outline Introduction
Set and Interval Notations
Commonly used sets (N, Z,
Q, R, C)
Finite and Infinite Sets
Cardinality of a Set
Empty or Null Set
Singelton or Unit Set
Equivalent and Equal Sets
Subset
Powerset
Universal Set
Cartesian Product -
Relation
Venn Diagram
Set Operations
Set Identities
2
Set Notation with
Sets
A set is an unordered collection of distinct
objects, called elements or members of the set.
We write a ∈ A to denote that a is an element
of the set A.
The notation a ∉ A denotes that a is not an
element of the set A.
There are the following ways to describe a set:
a) Verbal or written description
b) Roster Method or Listing/Tabular
c) Set Builder Notation
Conditional Statement:
a) Set of Integers between 3 and 8.
b) {4,5,6,7}
c) {x | x is a counting number between 3 and
8} OR
Sets
Some commonly used sets are given below:
N = {0, 1, 2, 3,…}, the set of all natural
numbers
Z = {…,−2,−1, 0, 1, 2,…}, the set of all
integers
Z+ = {1, 2, 3,…}, the set of all positive
integers
Z is the first letter of the German word for integers, Zahlen. It
stands for the set of all integers and should not be used as a
shorthand for the word integer.
Q = {p/q ∣ p ∈ Z, q ∈ Z, and q ≠ 0}, the set of
all rational numbers
R, the set of all real numbers
R+, the set of all positive real numbers
C, the set of all complex numbers.
Intervals Notation
Types of Sets
Finite Set: A set which contains a definite number of elements.
Example: S={ x | x∈N and 70>x>50}
Infinite Set: A set which contains infinite number of elements.
Example: S={ x | x∈N and x>10}
The cardinality of a finite set A, denoted by |A|, is the number of
(distinct) elements of A.
Example: Let S be the letters of the English alphabet. Then |S| = 26
Singleton or Unit Set: A set which contains only one element. A
singleton set is denoted by {s}.
Example: S={x|x∈N, 7<x<9} = {8}
Empty or Null Set: A set which contains no element. ∅ or {∅}?
Equivalent Sets: Sets with the same cardinalities.
Example: A={1,2,6} and B={16,17,22},
Equal Sets: Sets that contain the same elements.
Example: A={1,2,6} and B={6,1,2}
Types of Sets
Subset
A set X is a subset of set Y if every element of X is an element of set
Y. It is written as X⊆Y.
Example 1: X={1,2,3,4,5,6} and Y={1,2} Y⊆ X
Example 2: X={1,2,3} and Y={1,2,3} Improper subset
Proper Subset
“subset of but not equal to”.

A Set X is a proper subset of set Y (Written as X⊂Y) if every element


of X is an element of set Y and |X|<|Y|.
Example: X={1,2,3,4,5,6} and Y={1,2}.

Power set:
Given a set S, the power set of S is the set of all subsets of the set S.
The power set of S is denoted by (S).
Example: The power set of {0, 1, 2}
= {∅, {0}, {1}, {2}, {0, 1}, {0, 2}, {1, 2}, {0, 1, 2}}
Types of Set
Universal Set
It is a collection of all elements in a particular context or
application. All the sets in that context or application are
essentially subsets of this universal set. Universal sets are
represented as U.
Example: We may define U as the set of all animals on earth. In this
case, set of all mammals is a subset of U, set of all fishes is a subset
of U, set of all insects is a subset of U, and so on.

Cartesian Product
Let A and B be sets. The Cartesian product of A and B, denoted by
A × B, is the set of all ordered pairs (a, b), where a ∈ A and b ∈ B.
Hence,

Let A = {1, 2} and B = {a, b, c}, then the Cartesian product A × B is;
A × B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}.
Cartesian Product
• The Cartesian product of the sets A1, A2,…, An, denoted by A1 × A2
×⋯× An, is the set of ordered n-tuples (a1, a2,…, an), where ai
belongs to Ai for i = 1, 2,…, n.
• In other words,
A1 × A2 ×⋯× An = {(a1, a2,…, an) ∣ ai ∈ Ai for i = 1, 2,…, n}.
• Example: What is the Cartesian product A × B × C, where A = {0,
1}, B = {1, 2}, and C = {0, 1, 2}?
Relation
• A subset R of the Cartesian product A × B is called a relation
from the set A to the set B. The elements of R are ordered pairs,
where the first element belongs to A and the second to B. The set
A is called the domain of R and the set B is called its co-domain.
• For example, R = {(a, 0), (a, 1), (a, 3), (b, 1), (b, 2), (c, 0), (c, 3)} is
a relation from the set {a, b, c} to the set {0, 1, 2, 3}, and it is
also a relation from the set {a, b, c, d, e} to the set {0, 1, 3, 4).
• A relation need not contain a pair (x, y) for every element x of A.
Relation
• The objects of mathematics may be related in various ways.
• A set A may be said to be related to a set B if A is a subset of B, or if A is
not a subset of B, or if A and B have at least one element in common.
• A number x may be said to be related to a number y if x < y, or if x is a
factor of y, or if x2 + y2 = 1.
• Let A = {0, 1, 2} and B = {1, 2, 3} and let us say that an element x in A is
related to an element y in B if, and only if, x is less than y. Let us use the
notation x R y as a shorthand for the sentence “x is related to y.”
Relation
• R × R is the set of all ordered pairs (x, y) where both x and y are
real numbers. If horizontal and vertical axes are drawn on a
plane and a unit length is marked off, then each ordered pair in
R × R corresponds to a unique point in the cartesian plane.
Venn Diagrams
If sets A and B are represented as regions in the plane, relationships
between A and B can be represented by pictures, called Venn
diagrams, that were introduced by the British mathematician John
Venn in 1881.
Set Operation
Union of Sets: Union of Sets A and B is defined to be the set of all those elements which belong to A or B or
both and is denoted by A∪B.
A∪B = {x: x ∈ A or x ∈ B}
Example: Let A = {1, 2, 3}, B= {3, 4, 5, 6}
A∪B = {1, 2, 3, 4, 5, 6}.

|A ∪ B|=|A|+|B|−|A ∩ B|
Principle of inclusion–exclusion.

Intersection of Sets: Intersection of two sets A and B is the set of all those elements which belong to both A
and B and is denoted by A ∩ B.
A ∩ B = {x: x ∈ A and x ∈ B}
Example: Let A = {11, 12, 13}, B = {13, 14, 15}
A ∩ B = {13}.

Difference of Sets: The difference of two sets A and B is a set of all those elements which belongs to A but do
not belong to B and is denoted by A - B.
A - B = {x: x ∈ A and x ∉ B}
Example: Let A = {1, 2, 3, 4} and B = {3, 4, 5, 6}
then A - B = {3, 4} and B - A = {5, 6}
Set Operation
Complement of a Set: The Complement of a Set A is a set of all those elements of the
universal set which do not belong to A and is denoted by Ac.

Ac = U - A = {x: x ∈ U and x ∉ A} = {x: x ∉ A}


Example: Let U is the set of all natural numbers.
A = {1, 2, 3}
Ac = {all natural numbers except 1, 2, and 3}.

Symmetric Difference of Sets: The symmetric difference of two sets A and B is the
set containing all the elements that are in A or B but not in both and is denoted by A ⨁ B
i.e.

A ⨁ B = (A ∪ B) - (A ∩ B)
Example: Let A = {a, b, c, d}
B = {a, b, l, m}
A ⨁ B = {c, d, l, m}
Types of Set
Overlapping Sets: Two sets that have at least one common
element.
Example: A={1,2,6} and B={6,12,42}.
Disjoint Set
Two sets A and B are called disjoint sets if they do not have even
one element in common. Therefore, disjoint sets have the
following properties −
n(A∩B)=∅
n(A∪B)=n(A)+n(B)
Example: A={1,2,6} and B={7,9,14}
Set Identities
Methods of identity Proof
Venn diagrams can provide an informal proof for some identities,
such proofs should be formalized using one of the following three
methods:
1. Subset Method: Prove that each set (side of the identity) is a
subset of the other.
2. Set builder notation and propositional logic. Start with one side,
transform it into the other side using a sequence of steps by
applying an established identity.
3. Membership Tables: Verify that elements in the same
combination of sets always either belong or do not belong to
the same side of the identity. Use 1 to indicate it is in the set
and a 0 to indicate that it is not.
Proof of Second De Morgan Law
Set-Builder Notation: Second De Morgan Law
Membership Table: Second De Morgan Law
• To indicate that an element is in a set, a 1 is used; to indicate that
an element is not in a set, a 0 is used.
A B A’ B’
1 1 0 0 1 0 0
1 0 0 1 0 1 1
0 1 1 0 0 1 1
0 0 1 1 0 1 1
Proving Set Identities
Use a membership table to show that A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C).
Generalized Unions and Intersections
Set Notation with Quantifiers
• ∀x ∈ S(P(x)) denotes the universal quantification of P(x) over
all elements in the set S. i.e., ∀x(x ∈ S → P(x)).
• ∃x ∈ S(P(x)) denotes the existential quantification of P(x) over
all elements in S. i.e., ∃x(x ∈ S ∧ P(x)).
• The statement ∀x ∈ R(x2 ≥ 0) states that for every real number
x, x2 ≥ 0.
• The statement ∃x ∈ Z(x2 = 1) states that there exists an integer
x such that x2 = 1
• Given a predicate P, and a domain D, we define the truth set of
P to be the set of elements x in D for which P(x) is true. The
truth set of P(x) is denoted by {x ∈ D ∣ P(x)}.
• What are the truth sets of the predicates P(x), Q(x), and R(x),
where the domain is the set of integers and P(x) is “|x| = 1,”
Q(x) is “x2 = 2,” and R(x) is “|x| = x.”
Computer Representation of Sets
There are various ways to represent sets using a computer. One
method is to store the elements of the set in an unordered fashion.
However, if this is done, the operations of computing the union,
intersection, or difference of two sets would be time-consuming,
because each of these operations would require a large amount of
searching for elements. We will present a method for storing
elements using an arbitrary ordering of the elements of the
universal set. This method of representing sets makes computing
combinations of sets easy.
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} (Increasing or ascending order).
The bit string for a subset of odd integers in U, namely, {1, 3, 5, 7,
9}, is 10 1010 1010. (blocks of length four for easy reading.)
The bit string for a subset of all even integers in U is 01 0101 0101.
The bit string for a subset of all integers in U that do not exceed 5 is
11 1110 0000.
Multiset or Bag
• Multiset is an unordered collection of elements where an
element can occur multiple times. {a, a, a, b, b}
• The notation {m1 ⋅ a1, m2 ⋅ a2,…, mr ⋅ ar} denotes the multiset
with element ai occurring mi times
• The numbers mi ,i = 1, 2,…, r, are called the multiplicities of the
elements ai , i = 1, 2,…, r.
• The cardinality of a multiset is defined to be the sum of the
multiplicities of its elements.
• Let P and Q be multisets. The union of the multisets P and Q is the
multiset in which the multiplicity of an element is the maximum of its
multiplicities in P and Q.
• The intersection of P and Q is the multiset in which the multiplicity of an
element is the minimum of its multiplicities in P and Q.
• The difference of P and Q is the multiset in which the multiplicity of an
element is the multiplicity of the element in P less its multiplicity in Q
unless this difference is negative, in which case the multiplicity is 0.
• The sum of P and Q is the multiset in which the multiplicity of an
Multiset or Bag
Let P = {4 ⋅ a, 1 ⋅ b, 3 ⋅ c} and Q = {3 ⋅ a, 4 ⋅ b, 2 ⋅ d}
Find P ∪ Q, P ∩ Q, P − Q, and P + Q.
Solution:
P ∪ Q = {max(4, 3) ⋅ a, max(1, 4) ⋅ b, max(3, 0) ⋅ c, max(0, 2) ⋅ d}
= {4 ⋅ a, 4 ⋅ b, 3 ⋅ c, 2 ⋅ d},
P ∩ Q = {min(4, 3) ⋅ a, min(1, 4) ⋅ b, min(3, 0) ⋅ c, min(0, 2) ⋅ d}
= {3 ⋅ a, 1 ⋅ b, 0 ⋅ c, 0 ⋅ d} = {3 ⋅ a, 1 ⋅ b},
P − Q = {max(4 − 3, 0) ⋅ a, max(1 − 4, 0) ⋅ b, max(3 − 0, 0) ⋅ c, max(0
− 2, 0) ⋅ d}
= {1 ⋅ a, 0 ⋅ b, 3 ⋅ c, 0 ⋅ d} = {1 ⋅ a, 3 ⋅ c}, and
P + Q = {(4 + 3) ⋅ a, (1 + 4) ⋅ b, (3 + 0) ⋅ c, (0 + 2) ⋅ d}
= {7 ⋅ a, 5 ⋅ b, 3 ⋅ c, 2 ⋅ d}.

You might also like