Professional Documents
Culture Documents
06 - Sets
06 - Sets
Sets
Lecture 6
Phyela Mbewe
LIS Department
University of Zambia
Overview
➢ Defining Sets
➢ Common Sets in math
➢ Special sets
➢ Venn Diagrams
➢ Subsets
➢ Cardinality
➢ Power set
➢ Set operations
• Set complement
• Laws of set operations
ICT 2021 2
Defining Sets [2]
▪ Defining a set:
1. Listing its elements
Example - 𝑃 = { 1, 2, 3, 4, 5, 6, 7, 8}
note: ellipses (…) can be used to represent a set with a large number of
elemets P = 1, 2, 3, 4, … 50
ICT 2021 3
Defining Sets
▪ Sets:
➢ An unordered collection of objects which have some common
property. The objects are referred to as elements
𝑆 = {𝑎, 𝑏, 𝑐, 𝑥, 𝑦, 𝑧}
note: 𝑧, 𝑏, 𝑐, 𝑎, 𝑦, 𝑥 would be describing the same set (unordered)
ICT 2021 4
Common Sets in math
1. Natural numbers
ℕ = { 1, 2, 3, … }
2. Integers
ℤ = { … , −2, −1, 0, 1, 2, … }
3. Positive Integers
ℤ+ = { 1, 2, 3, 4, … }
4. Rational Numbers
𝑝
ℚ = { | 𝑝 ∈ ℤ, 𝑞 ∈ ℤ, 𝑞 ≠ 0}
ICT 2021
𝑞
5
Common Sets in math
5. Real numbers
denoted by letter ℝ
➢ A set of all rational numbers and irrational numbers
note: irrational numbers include numbers with a non-terminating
decimal, e.g. 𝟐 1.4142 … , 𝝅 (3.14159 … )
ICT 2021 6
Special sets
▪ The universal set
➢ set of all objects in a given scenario
➢ denoted by 𝑼
ICT 2021 7
Venn Diagram
➢ Visual representation of a set
ICT 2021 8
Subsets
▪ A subset:
➢ A set (set B) whereby every element in the set belongs to another set
(set A)
➢ denoted using 𝐁 ⊆ 𝐀
- show that ∀ 𝒙 𝒙 ∈ ∅ → 𝒙 ∈ 𝑨
ICT 2021 10
Subset – Properties [2]
2. Any set S is a subset of itself
ICT 2021 11
Subset – Properties [3]
3. Proper subset
➢ Set B is a proper subset of set A if 𝑩 ⊆ 𝑨 and 𝑩 ≠ 𝑨
proper subset
i) is B a proper subset of A?
ii)
ICT 2021 is C a proper subset of A? 12
Cardinality
➢ When the number of elements in a set is finite, the cardinality of a set
is the number of elements in the set
For example
𝑨 = 𝟐, 𝟑, 𝟓
𝑨 =𝟑
|∅ | = 𝟎
ICT 2021 13
Power set
➢ For a set S, the power set of S is the set of all subsets of S
➢ Denoted by P(S)
note: not to be confused with predicates,
in set theory P(S) means the power set of S
➢ Let 𝑆 = 𝑎, 𝑏, 𝑥
➢ 𝑃 𝑆 = ∅, 𝑎 , 𝑏 , 𝑥 , 𝑎, 𝑏 , 𝑎, 𝑥 , 𝑏, 𝑥 , 𝑎, 𝑏, 𝑥
ICT 2021 14
Power set [2]
Example 2 - power set of S
➢ Let 𝑆 = 1, 2
➢ 𝑃 𝑆 = ∅, 1 , 2 , 1,2
Example
➢ if 𝑆 = 1, 2, 3
➢ 𝑷 𝑺 =𝟖
ICT 2021 15
Cartesian Product
➢ For sets S and T, the Cartesian product of S and T is the set of all
ordered pairs (𝑠, 𝑡), whereby 𝒔 ∈ 𝑺 𝐚𝐧𝐝 𝐭 ∈ 𝑻
➢ denoted as 𝑺 × 𝑻
also defined as 𝑺 × 𝑻 = 𝒔, 𝒕 𝒔 ∈ 𝑺 }𝑻 ∈ 𝒕 ٿ
Example
note: 𝑺 × 𝑻 ≠ 𝑻 × 𝑺
withICTordered
2021 pairs, in general, 𝑎, 𝑏 ≠ (𝑏, 𝑎) 16
Cartesian Product [2]
▪ Cardinality of the Cartesian product:
➢ 𝑆 × 𝑇 = 𝑆 × |𝑇|
Example
➢ Let 𝑆 = 1, 2 and T = x, y, z
➢ 𝑆 × 𝑇 = 1, 𝑥 , 1, 𝑦 , 1, 𝑧 , 2, 𝑥 , 2, 𝑦 , 2, 𝑧
➢ 𝑆 = 2, 𝑇 = 3, 𝑆 × 𝑇 =3 ×2
ICT 2021 17
Set operations
▪ Union
➢ Union of A and B is a set which contains elements in set A, set B, or in both
➢ denoted as 𝑨 ∪ 𝑩
ICT 2021 18
Set operations [2]
▪ Intersection
➢ Intersection of A and B is a set which contains elements that are in
both A and B
➢ denoted as 𝑨 ∩ 𝑩
ICT 2021 19
Set operations [3]
▪ Set difference
➢ Set difference of A and B is a set which contains elements that are in
A but not in B
➢ denoted as 𝑨 − 𝑩
𝐴′
➢ Complement Properties:
• 𝑨 ∩ 𝑨′ = ∅
ICT 2021 • 𝑨 ∪ 𝑨′ = 𝑼 22
Laws of set operations
1. Commutative law:
➢ 𝑨 ∪ 𝑩=𝑩 ∪𝑨
➢ 𝑨 ∩𝑩=𝑩∩𝑨
2. Associative law:
➢ 𝑨 ∪ 𝑩 ∪𝑪 = 𝑨 ∪𝑩 ∪𝑪
➢ 𝑨∩ 𝑩 ∩𝑪 = 𝑨∩𝑩 ∩𝑪
ICT 2021 23
Laws of set operations [2]
3. Distributive law
➢ 𝐴 ∪ 𝐵∩𝐶 = 𝐴 ∪𝐵 ∩ 𝐴 ∪𝐶
➢ 𝐴 ∩ 𝐵 ∪ 𝐶 = 𝐴 ∩ 𝐵 ∪ (𝐴 ∩ 𝐶)
3. De Morgan’s law
➢ (𝐴 ∪ 𝐵)′ = 𝐴′ ∩ 𝐵′
➢ (𝐴 ∩ 𝐵)′ = 𝐴′ ∪ 𝐵′
Compare with propositions
ICT 2021 24
Laws of set operations - Exercise
➢ Given that
𝑈 = 1,2,3,4,5,6,7,8,9 ,
𝐴 = 1,4, 5,7 B = {1,2, 5,6, 7,8,9} C = {2,3,4,5,7}
ICT 2021 25