0% found this document useful (0 votes)
29 views

Tutorial 4

The document discusses various concepts related to binary relations, including definitions of equivalence relations, partitions, and properties such as reflexivity, symmetry, and transitivity. It also covers Warshall's algorithm for finding transitive closures and the characteristics of functions and permutations. Additionally, it introduces the concept of partially ordered sets and the notion of comparable elements within those sets.

Uploaded by

Himanshu Saini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Tutorial 4

The document discusses various concepts related to binary relations, including definitions of equivalence relations, partitions, and properties such as reflexivity, symmetry, and transitivity. It also covers Warshall's algorithm for finding transitive closures and the characteristics of functions and permutations. Additionally, it introduces the concept of partially ordered sets and the notion of comparable elements within those sets.

Uploaded by

Himanshu Saini
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CS-102: Discrete Structures Tutorial #4

binary relation a subset of 𝐴 × 𝐵 • If 𝒫is a partition on A and a relation R on A


from A to B is defined as 𝑎𝑅𝑏 if and only if 𝑎 and 𝑏 are
relation on A a binary relation from A to itself (i.e., a subset members of the same block, then R is an
of 𝐴 × 𝐴) equivalent relation. R is called the equivalence
Dom(R) set of elements in A that is related to some Equivalence relation determined by 𝒫
element in set B. relation • If R is an equivalence relation on A and 𝒫 the
Ran(R) set of elements in B that is related to some determined by a collection of all distinct relative sets R(a) for a
element in set A. Partition in A, then 𝒫 is a partition of A and R is the
R-relative set If R is a relation from A to B and 𝑥 ∈ 𝐴 and 𝑦 ∈ equivalence relation determined by 𝒫. Sets R(a)
𝑥, 𝑅(𝑥) 𝐵 , 𝑅(𝑥) = {𝑦 ∈ 𝐵 | 𝑥𝑅𝑦} are traditionally called equivalence classes of R.
Matrix of a If R is a relation from A to B, |𝐴| = 𝑚 and A/R is the quotient set of A that is constructed
relation, 𝑀𝑅 |𝐵| = 𝑛; 𝑀𝑅 = [𝑚𝑖𝑗 ] is defined by 𝑚𝑖𝑗 = from and determines R
1 𝑖𝑓 (𝑎, 𝑏) ∈ 𝑅 1 ≤ 𝑖 ≤ 𝑚 If R is an equivalence relation on A, then the set
{ R(a) or [a]R 𝑅(𝑎) is traditionally called the equivalence
0 𝑖𝑓 (𝑎, 𝑏) ∉ 𝑅 1 ≤ 𝑖 ≤ 𝑛
Partition or a collection of pair-wise disjoint nonempty (equivalence class class. i.e. the set of all elements of A that are
Quotient Set of a subsets of A, that have A as their union. i.e. A of a with respect equivalent to a
non-empty set A partition or a quotient set of a non empty set A is to R) [a]m (congruence class modulo m): the set of
the collection 𝒫 of non-empty subsets of A such integers congruent to a modulo m
that – If R and S are relations on a non-empty set A
(a) each element of A belongs to one of the • 𝑅−1 , inverse relation of R means
subsets in 𝒫 and (𝑏, 𝑎) ∈ 𝑅−1 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑜𝑓 (𝑎, 𝑏) ∈ 𝑅
(b) if 𝐴1 and 𝐴2 are distinct elements of • 𝑅̅ , complement of relation R means
𝒫 then 𝐴1 ∩ 𝐴2 = ∅. (𝑎, 𝑏) ∈ 𝑅̅ 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑖𝑓 (𝑎, 𝑏) ∉ 𝑅
directed graph or Pictorial representation of a relation. A set of • 𝑎(𝑅 ∩ 𝑆)𝑏 means 𝑎𝑅𝑏 𝑎𝑛𝑑 𝑎𝑆𝑏
digraph elements called vertices and ordered pairs of • 𝑎(𝑅 ∪ 𝑆)𝑏 means 𝑎𝑅𝑏 𝑜𝑟 𝑎𝑆𝑏
these elements, called edges. • 𝑎(𝑅 ∪ 𝑆)𝑏 means 𝑎𝑅𝑏 𝑜𝑟 𝑎𝑆𝑏
loop an edge of the form (𝑎, 𝑎) • 𝑎(𝑅 ⊕ 𝑆)𝑏 means
path of length n a finite sequence 𝑎, 𝑥1 , 𝑥2 , … , 𝑥𝑛−1 , 𝑏 𝑎(𝑅 ∪ 𝑆)𝑏 − 𝑎(𝑅 ∩ 𝑆)𝑏
from a to b in a ∋ 𝑎𝑅𝑥1 , 𝑥1 𝑅 𝑥2 , … , 𝑥𝑛−1 𝑅 𝑏 • if R and S are equivalence relations so is
relation 𝑅∩𝑆
𝑥𝑅𝑛 𝑦 (R a there is a path of length n from x to y in R
Operations on • 𝑀𝑅∩𝑆 = 𝑀𝑅 ∧ 𝑀𝑆
relation on A) 𝑀𝑅𝑛 = 𝑀𝑅 ⨀𝑀𝑅 ⨀ … 𝑀𝑅 (n factors) relations • 𝑀𝑅∪𝑆 = 𝑀𝑅 ∨ 𝑀𝑆
𝑥𝑅∞ 𝑦 (connecti- some path exists in R from 𝑥 to 𝑦
vity relation of R) i.e. 𝑅∞ = 𝑅 ∪ 𝑅2 ∪ 𝑅3 ∪ … • 𝑀𝑅−1 = (𝑀𝑅 )𝑇
𝑅∗ (reachability the relation consisting of those ordered pairs • 𝑀𝑅̅ = 𝑀 ̅̅̅̅
𝑅
relation of R) (𝑎, 𝑏) such that there is a path from 𝑎 𝑡𝑜 𝑏, i.e. • 𝑆 ◦ 𝑅 (S following R), i.e. composition of R
𝑎𝑅∞ 𝑏 B or a=b and S; 𝑀𝑆◦𝑅 = 𝑀𝑅 ⨀𝑀𝑆
reflexive a relation R on A is reflexive if (𝑎, 𝑎) ∈ 𝑅 for • If R is a relation from 𝐴 𝑡𝑜 𝐵 and 𝑆 a relation
all 𝑎 ∈ 𝐴 . R is not reflexive if ∃𝑎 ∈ 𝐴 , ∋ from 𝐵 𝑡𝑜 𝐶, and 𝐴1 is any subset of 𝐴, then
(𝑎, 𝑎) ∉ 𝑅. (𝑆 ◦ 𝑅)(𝐴1 ) = 𝑆(𝑅(𝐴1 )) ;
irreflexive a relation R on A is irreflexive if (𝑎, 𝑎) ∉ 𝑅 for (𝑆 ◦ 𝑅)−1 = 𝑅−1 ◦ 𝑆 −1
all 𝑎 ∈ 𝐴. R is not irreflexive if ∃𝑎 ∈ 𝐴 , ∋ • If 𝐴, 𝐵, 𝐶 𝑎𝑛𝑑 𝐷 are sets, R a relation from
(𝑎, 𝑎) ∈ 𝑅 A to B, S¸ a relation from B to C and T a relation
symmetric a relation R on A is symmetric if whenever (a, from C to D, then 𝑇 ◦ (𝑆 ◦ 𝑅) = (𝑇 ◦ 𝑆) ◦ 𝑅;
b) ∈ R then (b, a) ∈ R. R is not symmetric if • In general, 𝑆 ◦ 𝑅 ≠ 𝑅 ◦ 𝑆
∃(𝑎, 𝑏) ∈ 𝑅 , ∋ (𝑏, 𝑎) ∉ 𝑅 If a binary relation 𝑅 on 𝐴 does not possess a
antisymmetric a relation R on A is antisymmetric if whenever desired property, then appropriate related pairs
(𝑎, 𝑏) ∈ 𝑅 and (𝑏, 𝑎) ∈ 𝑅 then 𝑎 = 𝑏. i.e. may be added to R until the desired property is
whenever, if 𝑎 ≠ 𝑏, then (𝑎, 𝑏) ∉ achieved. The smallest relation 𝑅1 on 𝐴 that
𝑅 𝑜𝑟 (𝑏, 𝑎) ∉ 𝑅. R is not antisymmetric if contains 𝑅 and possess the desired property, if
∃ 𝑎 𝑎𝑛𝑑 𝑏 𝑖𝑛 𝐴 , 𝑎 ≠ 𝑏 and both (𝑎, 𝑏) ∈ such a relation 𝑅1 exists, is called the closure of
𝑅 𝑎𝑛𝑑 (𝑏, 𝑎) ∈ 𝑅. R with respect to the property in question.
transitive a relation R on A is transitive if whenever Closure Reflexive closure of a relation R on theset A is
(𝑎, 𝑏) ∈ 𝑅 and (𝑏, 𝑐) ∈ 𝑅 then (𝑎, 𝑐) ∈ 𝑅. A 𝑅 ∪ ∆, where ∆= {(𝑎, 𝑎)|𝑎 ∈ 𝐴}.
relation R is NOT transitive if there exists a, b The symmetric closure of a relation R on the set
and c in A (𝑎, 𝑏) ∈ 𝑅 and (𝑏, 𝑐) ∈ 𝑅 but A is 𝑅 ∪ 𝑅−1 .
(𝑎, 𝑐) ∉ 𝑅. If such a, b, and c does not exist, the where 𝑅−1 = {(𝑏, 𝑎)|(𝑎, 𝑏) ∈ 𝑅}.
R is transitive. The transitive closure of a relation is the
equivalence a reflexive, symmetric, and transitive relation connectivity relation formed from the relation
relation i.e. 𝑅∞ is the transitive closure of R.
equivalence If 𝒫is a partition on set A and R a relation on A
relation is defined as 𝑎𝑅𝑏 if and only if a and b are the
determined by a members of the same block, then R is an
partition equivalence relation.
equivalent If R is an equivalence relation, 𝑎 is equivalent to
𝑏 if 𝑎𝑅𝑏

CS-102: Discrete Structures Page 1 Tutorial 4: Relations, Functions and Matrices


Warshall’s Warshall’s algorithm for finding the transitive A permutation of a finite set that is not the identity or a cycle can be
algorithm closure of relation R on a set A, gives a procedure written as a product of disjoint cycles.
to compute each matrix 𝑊𝑘 from the previous Transposition a cycle of length 2
matrix 𝑊𝑘−1 , starting with the matrix 𝑀𝑅 = 𝑊0 Every permutation of a finite set with at least two elements can be
and proceeding one step at a time till in 𝑛 steps written as a product of transpositions.
𝑀𝑅∞ is computed; where 𝑛 = |𝐴|. Product of The product of
If 𝑊𝑘 = [𝑡𝑖𝑗 ] and 𝑊𝑘−1 = [𝑠𝑖𝑗 ], then 𝑡𝑖𝑗 = 1 if permutations • two even permutations is even
and only if • two odd permutation is even
• 𝑠𝑖𝑗 = 1 𝑜𝑟 • an even and an odd permutation is odd
• 𝑠𝑖𝑘 = 1 𝑎𝑛𝑑 𝑠𝑘𝑗 = 1 Period of p if p is a permutation of set A, then the period
1 ≤ 𝑖 ≤ 𝑛, 1 ≤ 𝑗 ≤ 𝑛, 1 ≤ 𝑘 ≤ 𝑛 of p is the smallest integer, 𝑘 ∋ 𝑝𝑘 = 1𝐴
If R and S are equivalence relations on A, (𝑅 ∪ 𝑆)∞ is the smallest n-ary relation on a subset of A1× A2 × · · ·×An
equivalence relation on 𝐴 containing both 𝐴 and 𝐵 A1,A2, . . . , An
Function if A and B are non-empty sets, a function, f from join a function that combines n-ary relations that
A to B, which is denoted by 𝑓: 𝐴 → 𝐵, is a agree on certain fields
relation from A to B ∋ ∀𝑎 ∈ 𝐷𝑜𝑚(𝑓), Partial order on a relation that is reflexive, anti-symmetric and
f(a)contains only one element of B. set: transitive, traditionally represented by ≤
Identity function, 1𝐴 : 1𝐴 (𝑎) = 𝑎 Partially ordered set set together with a partial order, (𝐴, ≤)
Special types of Everywhere defined function, or poset A
functions 𝑓: 𝐴 → 𝐵 𝑤𝑖𝑡ℎ 𝐷𝑜𝑚(𝑓) = 𝐴 Comparable If (𝐴, ≤) is a poset, the elements 𝑎, 𝑏 ∈ 𝐴 are
One-to-one (injective) function, elements in a poset said to be comparable if 𝑎 ≤ 𝑏 or 𝑏 ≤ 𝑎
𝑓: 𝐴 → 𝐵 𝑤𝑖𝑡ℎ 𝑎 ≠ 𝑎′ 𝑖𝑚𝑝𝑙𝑖𝑒𝑠 𝑓(𝑎) ≠ 𝑓(𝑎′ ) Linearly ordered partially ordered set in which every pair of
Onto (surjective) function, set: elements is comparable
𝑓: 𝐴 → 𝐵 𝑤𝑖𝑡ℎ 𝑅𝑎𝑛(𝑓) = 𝐵 Dual of a the poset (𝐴, ≥), where ≥ denotes the inverse
Bijection: one-to-one and onto function poset (𝐴, ≤) of ≤
One-to-one correspondence: onto, one-to-one, Hasse diagram: Convenient representation of a Poset that
everywhere defined function completely describes the associated partial
𝑓: 𝐴 → 𝐵 is invertible if 𝑓 −1 is a function order.
Let 𝑓: 𝐴 → 𝐵 𝑏𝑒 𝑎 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛. Then ➢ Theorem: If A and B are posets, then A × B is a poset
• 𝑓 −1 is a function from 𝐵 → 𝐴 if and only of 𝑓 with the product partial order
is one-to-one • Topological If 𝐴 is a poset with partial order ≤, we
• If 𝑓 −1 is a function, then 𝑓 −1 is also one to sorting sometimes need to find a linear order ≺ for the
one set A that will merely be an extension of the
given partial order in the sense that 𝑖𝑓 𝑎 ≤ 𝑏,
• 𝑓 −1 is everywhere defined if and only if 𝑓 is
then 𝑎 ≺ 𝑏. The process of constructing a
onto
linear order such as ≺ is called topological
• 𝑓 −1 is onto if and only if 𝑓 is everywhere
sorting.
defined
• isomorphism of If (𝐴, ≤) and (𝐴′ , ≤′ ) are posets and 𝑓 ∶ 𝐴 →
𝑖𝑓 𝑓: 𝐴 → 𝐵. Then posets: 𝐴′ a one-to-one correspondence between 𝐴
• 1𝐵 ∘ 𝑓 = 𝑓; and 𝐴′ . The function f is called an
• 𝑓 ∘ 1𝐴 = 𝑓 isomorphism from (𝐴, ≤) to (𝐴′ , ≤′ ) if, for
𝑖𝑓 𝑓: 𝐴 → 𝐵 is invertible, (i.e. a one-to-one any 𝑎, 𝑏 ∈ 𝐴, 𝑎 ≤ 𝑏 if and only if 𝑓 (𝑎) ≤
correspondence between A and B) 𝑓 (𝑏).
• 𝑓 −1 ∘ 𝑓 = 1𝐴 If 𝑓 ∶ 𝐴 → 𝐴 is an isomorphism, we say that
• 𝑓 ∘ 𝑓 −1 = 1𝐵 (𝐴, ≤) and (𝐴′ , ≤′ ) are isomorphic posets.
Composition of
Functions Let 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐴 be functions such • Maximal For the poser (𝐴, ≤), an element 𝑎 ∈ 𝐴
that 𝑔 ∘ 𝑓 = 1𝐴 and 𝑓 ∘ 𝑔 = 1𝐵 , then 𝑓 is a one- (minimal) element (𝑏 ∈ 𝐴 ) is called a maximal (minimal)
to-one correspondence between A and B, 𝑔 is a of a poset: element of A, if there is no element 𝑐 ∈ 𝐴 ∋
one-to-one correspondence between B and A and 𝑎 < 𝑐 (𝑐 < 𝑏)
each is the inverse of the other. ➢ Theorem: A finite nonempty poset has at least one
If 𝑓: 𝐴 → 𝐵 and 𝑔: 𝐵 → 𝐴 be invertible. maximal element and at least one minimal
Then 𝑔 ∘ 𝑓 is invertible and (𝑔 ∘ 𝑓)−1 = 𝑓 −1 ∘ element.
𝑔−1 • Greatest (least) For the poser (𝐴, ≤), an element 𝑎 ∈ 𝐴
Permutation A bijection from set A to itself. element of a poset (𝑏 ∈ 𝐴 ) is called a greatest (least) element of
Function A: A, if 𝑥 ≤ 𝑎, ∀𝑥 ∈ 𝐴 (𝑏 ≤ 𝑥, ∀𝑥 ∈ 𝐴)
Cyclic if (𝑏1 , 𝑏2 , … , 𝑏𝑟 ) are distinct elements of set 𝐴 = ➢ Theorem: A poset has at most one greatest element and
permutation or {𝑎1 , 𝑎2 , … , 𝑎𝑛 }, 𝑟 ≤ 𝑛 , the permutation p at most one least element.
cycle of length r defined as 𝑝(𝑏1 ) = 𝑏2 , 𝑝(𝑏2 ) = 𝑏3 … , 𝑝(𝑏𝑟 ) = • Upper (lower) element 𝑎 ∈ 𝐴 such that 𝑏 ≤ 𝑎 (𝑎 ≤ 𝑏)
𝑏1 𝑝(𝑥) = 𝑥 𝑖𝑓 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∉ (𝑏1 , 𝑏2 , … , 𝑏𝑟 ) is bound of subset B of for all b ∈ B
called a cyclic permutation of length r, denoted poset A:
by (𝑏1 , 𝑏2 , … , 𝑏𝑟 ) • Least upper bound element a ∈ A such that a is an upper (lower)
(greatest lower bound of B and 𝑎 ≤ 𝑎′ (𝑎′ ≤ 𝑎), where 𝑎′
bound) of subset B is any upper (lower) bound of B
of poset A:

CS-102: Discrete Structures Page 2 Tutorial 4: Relations, Functions and Matrices


I: Product Sets and Quotient Sets
2.9. Given 𝐴 = {1,2,3,4,5,6,7} and
1.1 If 𝐴 = {𝑎 |𝑎 𝑖𝑠 𝑎 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟} and 𝐵 = {1,2,3,4},
𝑅 = {(1,2), (1,4), (2,3), (2,5), (3,6), (4,7)}. Compute the
sketch each of the following in the Cartesian Plane:
restriction of R to B for the subset of A given by
(a) 𝐴 × 𝐵 (b) 𝐵 × 𝐴
𝐵 = {1,2,4,5}
1.2. List all the possible partitions of the set 𝐴 = {𝑎, 𝑏, 𝑐}
2.10. If S is the product set {1, 2, 3} × {𝑎, 𝑏}. How many
1.3. Given = {0, 3, 6, 9, 12, 15, … . } . What are the relations are there on S?
partitions of B containing: -
(a) two infinite series. 2.11. Given R is relation whose digraph is given below,
(b) three infinite series. draw the digraph of 𝑅 2 and also list 𝑀𝑅2 and 𝑀𝑅∞ .

II: Relations and Digraphs


2.1. If 𝐴 = {1, 2, 3, 4, 5} and R is a relation on A defined
as aRb if and only if 𝑎 ≤ 𝑏. Find the domain, range, matrix
and digraph of R.

2.2. If 𝐴 = {1, 2, 3, 4, 8} and R is a relation on A defined 2.12. Given R is a relation on set A, whose digraph is given
as aRb if and only if 𝑎 + 𝑏 ≤ 9. Find the domain, range, below. If 𝜋1 : 1, 7, 5 and 𝜋2 : 5, 6, 7, 4, 3 ; find the
matrix and digraph of R. composition 𝜋2 ∘ 𝜋1 .

2.3. If 𝐴 = 𝑍 + and R is the relation defined by 𝑎 𝑅 𝑏 if and


only ∃ 𝑎, 𝑘 ∈ 𝑍 + so that 𝑎 = 𝑏 𝑘 , (k depends on a and b).
Which of the following belong to R?
(a) (4, 16) (b) (1, 7) (c) (8, 2) (d) (3, 3) (e) (2, 8)
(f) (2, 32)
2.13. Given 𝐴 = {1, 2, 3, 4} and R is a relation on A.
2.4. Given 𝐴 = {1,2,3,4,5,6} and R is a relation on A Determine whether R is reflexive, irreflexive, symmetric,
defined as aRb if and only if 𝑎 𝑖𝑠 𝑎 𝑚𝑢𝑙𝑡𝑖𝑝𝑙𝑒 𝑜𝑓 𝑏. Find anti-symmetric or transitive: -
the R relative sets: - (a) 𝑅 = {(1, 1), (2,2), (3,3)}
(a) R(3) (b) R(6) (c) R({2,4,6}) (b) R = {}

2.5. Given 𝐴 = ℝ, the set of real numbers. Give a 2.14. Given 𝐴 = 𝑍 + and R is a relation on A defined as
description of the relation R specified by the shaded aRb if and only if 𝑎 = 𝑏 𝑘 for some 𝑘 ∈ 𝑍 + (i.e. a is an
region. exponent of b). Determine whether R is reflexive,
irreflexive, symmetric, anti-symmetric or transitive.

2.15. Let 𝐴 = {1, 2, 3} and R be a relation on A, whose


matrix is given below. Determine whether R is an
equivalence relation.
1 0 0
𝑀𝑅 = [0 1 1]
0 1 1
2.6. Given 𝐴 = {1, 2, 3, 4} and R is a relation on A with
1 1 0 1 2.16. Let R be a relation on A whose digraph is given
0 1 1 0 below. Determine whether R is an equivalence relation.
𝑀𝑅 = [ ]. What is the relation R? Also draw
0 0 1 1
1 0 0 0
its digraph.

2.7. Find the relation determined the digraph given below


along with the matrix 𝑀𝑅 .
2.17. If { {𝑎, 𝑏, 𝑐}, {𝑑, 𝑒}, {𝑓}} is a partition of the set 𝐴 =
{𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓} determine the corresponding equivalence
relation.

2.18. Let = {𝑎, 𝑏, 𝑐} ; 𝐵 = {1,2,3} ; R and S be relations


from A to B. 𝑅 = {(𝑎, 1), (𝑏, 1), (𝑐, 2), (𝑐, 3)}
2.8. List the in-degree and out-degree of each vertex of the 𝑆 = {(𝑎, 1), (𝑎, 2), (𝑏, 1), (𝑏, 2)}. Determine ̅𝑅, 𝑅 ∩ 𝑆,
digraph of Q.2.7. 𝑅 ∪ 𝑆 and 𝑆 −1.

CS-102: Discrete Structures Page 3 Tutorial 4: Relations, Functions and Matrices


2.19. Let R and S be relations on set A whose digraphs are 2.28. Compute the partition of A that corresponds to the
given below. Determine ̅𝑅, 𝑅 ∩ 𝑆, 𝑅 ∪ 𝑆 and 𝑆 −1 . equivalence relation found in Q.28.

III: Functions
3.1. Let A=B=C=ℝ, the set of real numbers and let : 𝐴 →
𝐵 , 𝑓: 𝐵 → 𝐶 be defined by 𝑓(𝑎) = 𝑎 + 1 and 𝑔(𝑏) =
𝑏 2 + 2. Find: -
2.20. Let 𝐴 = {1,2,3} ; 𝐵 = {𝑎, 𝑏, 𝑐, 𝑑} and R and S be (a) (𝑔 ∘ 𝑓)(𝑥) (b) (𝑓 ∘ 𝑔)(𝑥)
relation from set A to set B, whose matrices are given
below. Determine ̅𝑆, 𝑅 ∩ 𝑆, 𝑅 ∪ 𝑆 and 𝑅 −1. 3.2. For a non-empty set A, if |𝐴| = 𝑛
1 1 0 1 0 1 1 0 (a) How many functions are there from A to A.
𝑀𝑅 = [0 0 0 1] 𝑀𝑆 = [1 0 0 1] (b) How many bijections are there from A to A.
1 1 1 0 1 1 0 0
3.3. For a non-empty sets A and B, if |𝐴| = |𝐵| = 𝑛 and
2.21. Let 𝐴 = {2,3,6,12} and let R and S be relations on A 𝑓: 𝐴 → 𝐵 is an everywhere defined function, show that the
defined by aRb if and only if 2|(𝑎 − 𝑏) and aSb if and only following three statements are equivalent: -
if 3|(𝑎 − 𝑏)I respectively. (a) f is one to one.
(a) Determine ̅𝑆, 𝑅 ∩ 𝑆, 𝑅 ∪ 𝑆 and 𝑅 −1. (b) f is onto.
(b) Does (2,3) ∈ 𝑆 ∘ 𝑅 ? (a) f is a one-to-one correspondence.

2.22. Which properties of relation on a set A are preserved 3.4. Given ℝ is the set of real numbers, which of the
by composition? following functions 𝑓: ℝ → ℝ are permutations of ℝ.
(a) f is defined by 𝑓(𝑎) = 𝑎 − 1
2.23. Let 𝐴 = { 𝑎, 𝑏, 𝑐, 𝑑, 𝑒} and let 𝑀𝑅 and 𝑀𝑆 (b) f is defined by 𝑓(𝑎) = 𝑎2
respectively, be the matrices of the relations R and S on A (c) f is defined by 𝑓(𝑎) = 𝑎3
as given below. Compute 𝑀𝑅∘𝑅 , 𝑀𝑅∘𝑆 , 𝑀𝑆∘𝑅 and 𝑀𝑆∘𝑆 . (d) f is defined by 𝑓(𝑎) = 𝑒 𝑎
1 0 1 1 1 1 0 0 1 0
0 1 1 0 0 1 0 1 0 0 3.5. If 𝐴 = {1, 2, 3, 4, 5, 6} ,
𝑀𝑅 = 1 0 0 1 0 ; 𝑀𝑆 = 1 0 1 0 0 1 2 3 4 5 6
1 0 1 0 0 0 1 1 1 1 𝑝1 = ( )
3 4 1 2 6 5
[0 1 1 1 1] [1 0 0 0 1] 1 2 3 4 5 6
𝑝2 = ( )
2 3 1 5 4 6
2.24. Let R be a relation from sets A to B and let S and T 1 2 3 4 5 6
𝑝3 = ( )
be relations from sets B to C. Prove or disprove: - 6 3 2 5 4 1
(a) (𝑆 ∪ 𝑇) ∘ 𝑅 = (𝑆 ∘ 𝑅) ∪ (𝑇 ∘ 𝑅) Compute (a) 𝑝−1 (b) 𝑝3 ∘ 𝑝1 (c) (𝑝2 ∘ 𝑝1 ) ∘ 𝑝3
(b) (𝑆 ∩ 𝑇) ∘ 𝑅 = (𝑆 ∘ 𝑅) ∩ (𝑇 ∘ 𝑅)
3.6. If 𝐴 = {1, 2, 3, 4, 5, 6, 7, 8} ,
2.25. Let 𝐴 = { 𝑎, 𝑏, 𝑐} and (a) compute the product (3,5,7,8) ∘ (1,3,2)
𝑅 = {(𝑎, 𝑎), (𝑎, 𝑏), (𝑏, 𝑐), (𝑎, 𝑐), (𝑐, 𝑎), (𝑐, 𝑏)} .
(a) Compute the Matrix 𝑀𝑅∞ of the transitive closure of R (b) compute the product (2,6) ∘ (3,5,7,8) ∘ (2,5,3,4)
by using the formula 𝑀𝑅∞ = 𝑀𝑅 ∨ (𝑀𝑅 )2⨀ ∨ (𝑀𝑅 )3⨀.
1 2 3 4 5 6 7 8
(b) Compute the transitive closure of R by using (c) write the permutation ( )
Warshall’s Algorithm. 6 5 7 8 4 3 2 1
as a product of disjoint cycles.
2.26. Let 𝐴 = { 𝑎, 𝑏, 𝑐, 𝑑} and let R be a relation on A 1 2 3 4 5 6 7 8
whose matrix is given below. Find the matrix of the (d) Is the permutation ( ) odd
6 5 7 8 4 3 2 1
transitive closure using Warshall’s Algorithm. or even?
0 0 0 1
1 0 0 1 (e) Find the period of the permutation
𝑀𝑅 = [ ]
0 1 0 1 1 2 3 4 5 6
𝑝=( )
0 0 1 0 2 4 3 1 5 6

2.27. Let 𝐴 = { 𝑎, 𝑏, 𝑐, 𝑑} and let R and S be relations on A IV: Partial Order and Partially Ordered Sets
whose matrices are given below. Compute the matrix of 4.1. Determine whether the relation R is a partial order
the smallest relation containing R and S. Also list the on set A
elements of this relation. (a) 𝐴 = 𝑍 𝑎𝑛𝑑 𝑎𝑅𝑏 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑖𝑓 𝑎 = 2𝑏.
1 0 0 0 0 1 1 0 0 0 (b) 𝐴 = 𝑍 𝑎𝑛𝑑 𝑎𝑅𝑏 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑖𝑓 𝑏 2 |𝑎.
0 1 1 0 0 1 1 0 0 0 (c) 𝐴 = 𝑍 𝑎𝑛𝑑 𝑎𝑅𝑏 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑖𝑓 𝑎 = 𝑏 𝑘
𝑀𝑅 = 0 1 1 0 0 ; 𝑀𝑆 = 0 0 1 0 0 𝑓𝑜𝑟 𝑠𝑜𝑚𝑒 𝑘 ∈ 𝑍 + . Note that k depends on 𝑎 and 𝑏.
0 0 0 1 1 0 0 0 1 0 (d) 𝐴 = ℝ 𝑎𝑛𝑑 𝑎𝑅𝑏 𝑖𝑓 𝑎𝑛𝑑 𝑜𝑛𝑙𝑦 𝑖𝑓 𝑎 ≤ 𝑏.
[0 0 0 1 1] [0 0 0 0 1]
CS-102: Discrete Structures Page 4 Tutorial 4: Relations, Functions and Matrices
4.2. Draw the Hasse Diagram of the relation R on the 4.10. Determine all maximal and minimal elements of
following sets: - the posets given below: -
(a) 𝐴 = {1, 2, 3, 4}, (a) 𝐴 = {𝑥|𝑥 𝑖𝑠 𝑎 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑎𝑛𝑑 0 < 𝑥 ≤ 1}
𝑅 = {(1, 1), (1, 2), (2, 2), (2, 4), (1, 3), with the usual partial order ≤.
(3, 3), (3, 4), (1, 4), (4, 4)}.
(b) 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒}, (b) 𝐴 = {2, 3, 4, 6, 8, 24, 48} with the partial order of
divisibility.
𝑅 = {(𝑎, 𝑎), (𝑏, 𝑏), (𝑐, 𝑐), (𝑎, 𝑐), (𝑐, 𝑑),
(𝑐, 𝑒), (𝑎, 𝑑), (𝑑, 𝑑), (𝑎, 𝑒), (𝑏, 𝑐), (𝑏, 𝑑), (𝑏, 𝑒), (𝑒, 𝑒)}. 4.11. Determine the maximal, minimal, least and
greatest elements (if they exist) of the poset, whose Hasse
4.3. Describe the ordered pairs in the relation determined
diagram is given in Fig 3.
by the Hasse diagram on the set 𝐴 = {𝑎, 𝑏, 𝑐, 𝑑}given in
Figs. 1(a) and 1(b). d h j

b c f i

a e g
Fig.3

4.12. Determine the least and greatest elements (if they


4.4. Determine the Hasse diagram of the relation R on exist) of the posets given below: -
𝐴 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} whose matrix, 𝑀𝑅 is given below. (a) 𝐴 = {𝑥|𝑥 𝑖𝑠 𝑎 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑎𝑛𝑑 0 < 𝑥 < 1}
with the usual partial order ≤.
1 0 1 1 1
0 1 1 1 1 (b) 𝐴 = {𝑥|𝑥 𝑖𝑠 𝑎 𝑟𝑒𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑎𝑛𝑑 0 ≤ 𝑥 ≤ 1}
𝑀𝑅 = 0 0 1 1 1 with the usual partial order ≤.
0 0 0 1 0
[0 0 0 0 1] (c) 𝐴 = {2, 4, 6, 8, 12, 18, 24, 36, 72} with the partial
order of divisibility.
4.5. For the following, consider the partial order of
divisibility on the set A. Draw the Hasse diagram of the (d) 𝐴 = {2, 3, 4, 6, 8, 24, 36} with the partial order of
poset and determine which posets are linearly ordered. divisibility.
(a) A = {1, 2, 3, 5, 6, 10, 15, 30} 4.13. If A is a poset with Hasse diagram as given in
(b) A = {2, 4, 8, 16, 32} Fig.4 and B={4,5,6}. Find (if they
(c) A = {3, 6, 12, 36, 72} exist): -
(d) A = {1, 2, 3, 4, 5, 6, 10, 12, 15, 30, 60}
(a) all upper bounds of B,
4.6. Let 𝐵 = {2, 3, 6, 9, 12, 18, 24} and let 𝐴 = 𝐵 × 𝐵.
Define the following relation on 𝐴: (𝑎, 𝑏) ≺ (𝑎′, 𝑏′) if (b) all lower bounds of B,
and only if 𝑎 | 𝑎′ and 𝑏 ≤ 𝑏′ , where ≤ is the usual partial (c) the least upper bound of B,
order. Show that ≺ is a partial order. Fig.4
(d) the greatest lower bound of B.
4.7. Let A = {1, 2, 3, 5, 6, 10, 15, 30} and consider the
partial order ≤ of divisibility on A. That is, define 𝑎 ≤ 𝑏 4.14. Let R be a partial order on a finite set A. Describe
to mean that 𝑎 | 𝑏. Let 𝐴′ = 𝑃(𝑆), where 𝑆 = {𝑒, 𝑓, 𝑔}, how to use the matrix 𝑀𝑅 to find the least and greatest
be the poset with partial order ⊆. Show that (𝐴, ≤) and elements of 𝐴 if they exist.
(𝐴′, ⊆) are isomorphic. 4.15. Let 𝐴 = {𝑎|𝑎 ∈ 𝑍 + 𝑎𝑛𝑑 2 ≤ 𝑎 ≤ 100} with the
4.8. Let 𝐴 = {1, 2, 4, 8} and let ≤ be the partial order of partial order of divisibility.
divisibility on 𝐴. Let 𝐴′ = {0, 1, 2, 3} and let ≤ be the
(a) How many maximal elements does (𝐴, ≤) have?
usual relation “𝑙𝑒𝑠𝑠 𝑡ℎ𝑎𝑛 𝑜𝑟 𝑒𝑞𝑢𝑎𝑙 𝑡𝑜” on integers. Show
that (𝐴, ≤) and (𝐴′, ≤) are isomorphic posets. (b) How many minimal elements does (𝐴, ≤) have?
4.9. For each of the posets whose Hasse diagram is given (c) Determine the largest subset of A that is a linear
in Figs 2(a) and 2(b), list the set of largest pair of elements order under divisibility.
that are incomparable to one another.
4.16. Let ∗ be a binary operation on a set 𝐴, and suppose
that ∗ satisfies the following properties ∀𝑎, 𝑏, 𝑐 ∈ 𝐴.
(a) 𝑎 = 𝑎 ∗ 𝑎 Idempotent property
(b) 𝑎 ∗ 𝑏 = 𝑏 ∗ 𝑎 Commutative property
(c) 𝑎 ∗ (𝑏 ∗ 𝑐) = (𝑎 ∗ 𝑏) ∗ 𝑐 Associative property
Define a relation ≤ on 𝐴 by 𝑎 ≤ 𝑏 if and only if
𝑎 = 𝑎 ∗ 𝑏. Show that (𝐴, ≤) is a poset, and for all 𝑎, 𝑏 in
𝐴, 𝐺𝐿𝐵(𝑎, 𝑏) = 𝑎 ∗ 𝑏.

CS-102: Discrete Structures Page 5 Tutorial 4: Relations, Functions and Matrices


Solution
Partial Order and Partially Ordered Sets
4.6. (𝑎, 𝑏) ≺ (𝑎, 𝑏) since 𝑎 | 𝑎 and 𝑏 ≤ 𝑏. Thus ≺ is
reflexive.
Suppose (𝑎, 𝑏) ≺ (𝑐, 𝑑) and (𝑐, 𝑑) ≺ (𝑎, 𝑏). Then 𝑎 | 𝑐
and 𝑐 | 𝑎. This means 𝑐 = 𝑘𝑎 = 𝑘(𝑚𝑐) and for 𝑎 and 𝑐
in 𝐵, 𝑘𝑚 = 1 implies 𝑘 = 𝑚 = 1. Hence 𝑎 = 𝑐.
Also, 𝑏 ≤ 𝑑 and 𝑑 ≤ 𝑏 so 𝑏 = 𝑑. Thus ≺ is
antisymmetric.
Suppose (𝑎, 𝑏) ≺ (𝑐, 𝑑) and (𝑐, 𝑑) ≺ (𝑒, 𝑓). Then 𝑎 | 𝑐
and 𝑐 | 𝑒. Hence 𝑐 = 𝑘𝑎 and 𝑒 = 𝑚𝑐 = 𝑚(𝑘𝑎) thus
𝑎|𝑒 . Also 𝑏 ≤ 𝑑 and 𝑑 ≤ 𝑓 yields 𝑎 ≤ 𝑓. Thus ≺ is
transitive.

4.7, 4.8. Construct the Hasse Diagrams to show that the


two partial orders are isomorphic.

4.14. The least element of A is the label on the row that is


all ones. The greatest element of A is the label on the
column that is all ones.

4.15. (a) 40. (b) 15 (c) {2, 4, 8, 16, 32, 64}.

4.16.
RTP: ≤ is a poset i.e. ≤ is reflexive, antisymmetric,
and transitive.
→By idempotent property, 𝑎 = 𝑎 ∗ 𝑎 hence 𝑎 ≤ 𝑎
∀𝑎 ∈ 𝐴 , ∴ 𝐴 is reflexive.
→Suppose that 𝑎 ≤ 𝑏 and 𝑏 ≤ 𝑎. Then, by
definition of ≤ and commutative property,
𝑎 = 𝑎 ∗ 𝑏 = 𝑏 ∗ 𝑎 = 𝑏, so 𝑎 = 𝑏. Thus ≤ is
antisymmetric.
→If 𝑎 ≤ 𝑏 and 𝑏 ≤ 𝑐, then
𝑎 = 𝑎 ∗ 𝑏 = 𝑎 ∗ (𝑏 ∗ 𝑐) = (𝑎 ∗ 𝑏) ∗ 𝑐 = 𝑎 ∗ 𝑐,
so 𝑎 ≤ 𝑐 and ≤ is transitive.
∴ 𝐴 is a poset.
RTP: ∀𝑎, 𝑏 ∈ 𝐴, 𝑎 ∗ 𝑏 = 𝑎 ∧ 𝑏, (i.e. 𝐺𝐿𝐵({𝑎, 𝑏})
with respect to ≤).
→We have 𝑎 ∗ 𝑏 = 𝑎 ∗ (𝑏 ∗ 𝑏) = (𝑎 ∗ 𝑏) ∗ 𝑏, so
𝑎 ∗ 𝑏 ≤ 𝑏.
→Similarly, we can show that 𝑎 ∗ 𝑏 ≤ 𝑎,
∴ 𝑎 ∗ 𝑏 is a lower bound for 𝑎 and 𝑏.
→if 𝑐 ≤ 𝑎 and 𝑐 ≤ 𝑏, then 𝑐 = 𝑐 ∗ 𝑎 and 𝑐 = 𝑐 ∗ 𝑏.
Thus 𝑐 = (𝑐 ∗ 𝑎) ∗ 𝑏 = 𝑐 ∗ (𝑎 ∗ 𝑏), ∴ 𝑐 ≤ 𝑎 ∗ 𝑏.
This shows that 𝑎 ∗ 𝑏 is 𝐺𝐿𝐵({𝑎, 𝑏}).

CS-102: Discrete Structures Page 6 Tutorial 4: Relations, Functions and Matrices

You might also like