Tutorial 4
Tutorial 4
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.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.
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.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 𝐺𝐿𝐵({𝑎, 𝑏}).