DS_relation
DS_relation
H Chı́ Minh
Khoa Khoa Hc và K Thut Máy Tı́nh
Bài tp chng 5
Relation
1 Dn nhp
Trong bài tp di dây, chúng ta s làm quen vi các kin thc liên quan dn quan h. Sinh viên cn
ôn li lý thuyt ca chng 5 trc khi làm bài tp bên di.
2 Bài tp cn gii
Exercise 1.
For each of these relations on the set {1, 2, 3, 4}, decide whether it is reflexive, whether it
is symmetric, whether it is antisymmetric, and whether it is transitive.
a) {(2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}
b) {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
f) {(1, 3), (1, 4), (2, 3), (2, 4), (3, 1), (3, 4)}
Exercise 2.
Determine whether the relation R on the set of all real numbers is reflexive, symmetric,
antisymmetric, and/or transitive, where (x, y) ∈ R if and only if
a) x + y = 0
b) x = ±y
c) x − y is a rational number.
d) x = 2y
e) xy ≥ 0
f) xy = 0
g) x = 1
h) x = 1 or y = 1
i) x ≡ y (mod 7)
Exercise 3.
Let R1 = {(1, 2), (2, 3), (3, 4)} and R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (3, 4)}
be relations from {1, 2, 3} to {1, 2, 3, 4}. Find
a) R1 ∪ R2
b) R1 ∩ R2
c) R1 − R2
d) R2 − R1
Exercise 4.
Let R1 and R2 be the ”congruent modulo 3” and the ”congruent modulo 4” relations,
respectively, on the set of integers. That is, R1 = {(a, b)|a ≡ b( mod 3)} and R2 =
{(a, b)|a ≡ b( mod 4)}. Find
a) R1 ∪ R2
b) R1 ∩ R2
c) R1 − R2
d) R2 − R1
Exercise 5.
Let R be the relation on the set {1, 2, 3, 4, 5} containing the ordered pairs (1,1), (1,2), (1,3),
(2,3), (2,4), (3,1), (3,4), (3,5), (4,2), (4,5), (5,1), (5,2) and (5,4). Find R2 , R3 .
Exercise 6.
For each of these relations on the set {1,2,3,4}, let
R1 = {(1, 1), (2, 2), (3, 3)}
R2 = {(4, 2), (2, 4), (2, 2), (2, 3), (3, 2), (3, 3), (4, 4)}
R3 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3)}
R4 = {(1, 1), (1, 3), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (4, 4)}
R5 = {(4, 4), (4, 1), (4, 2), (1, 4), (1, 1), (1, 2), (2, 4), (2, 2), (3, 3)}
R6 = {(1, 2)}.
Find
a) R1 ◦ R2 , R1 ◦ R3 , R1 ◦ R4 , R1 ◦ R5 , R1 ◦ R6
b) R2 ◦ R3 ◦ R4 ◦ R6
c) (R3 )2
d) (R3 )4
e) reflexive closure ca R2
f) symmetric closure ca R1 ◦ R2
g) transitive closure ca R6
Exercise 7.
Give an example of a relation on a set {1,2,3,4} that is
Exercise 8.
b) How many relations are there on the set {a, b, c, d} that contain the pair (a, a)?
Exercise 9.
List the ordered pairs in the relations on {1, 2, 3, 4} corresponding to these matrices (where
the rows and columns correspond to the integers listed in increasing order).
1 1 0 1
1 0 1 0
a)
0 1 1 1
1 0 1 1
1 1 1 0
0 1 0 0
b)
0 0 1 1
1 0 0 1
0 1 0 1
1 0 1 0
c)
0
1 0 1
1 0 1 0
Exercise 10.
Draw the directed graph that represents the relation {(a, a), (a, b), (b, c), (c, b), (c, d), (d, a), (d, b)}
Exercise 11.
Let R be the relation that contains the pair (a, b) if a and b are cities such that there is a
direct non-stop airline flight from a to b. When is (a, b) in
a) R2 ?
b) R3 ?
Exercise 12.
Let R be the relation on the set {0, 1, 2, 3} containing the ordered pairs (0,1), (1,1), (1,2),
(2,0), (2,2) and (3,0). Find the
a) reflexive closure of R.
b) symmetric closure of R.
c) transitive closure of R.
Exercise 13.
Let R be the relation {(a, b)|a divides b} on the set of integers. What is the symmetric
closure of R?
Exercise 14.
Find the smallest relation containing the relation {(1, 2), (1, 4), (3, 3), (4, 1)} that is
Exercise 15.
Which of these relations on {0, 1, 2, 3} are equivalence relations? Determine the properties
of an equivalence relation that the others lack.
b) {(0, 0), (0, 2), (2, 0), (2, 2), (2, 3), (3, 2), (3, 3)}
c) {(0, 0), (1, 1), (1, 2), (2, 1), (2, 2), (3, 3)}
d) {(0, 0), (1, 1), (1, 3), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}
Exercise 16.
Which of these collections of subsets are partitions of {1, 2, 3, 4, 5, 6}?
c) {2,4,6}, {1,3,5}
d) {1,4,5}, {2,6}
Exercise 17.
List the ordered pairs in the equivalence relations produced by these partitions of {0, 1, 2,
3, 4, 5}.
Exercise 18.
Let R be the relation on the set of real numbers such that aRb if and only if a − b is an
integer.
a) Is R an equivalence relation?
Exercise 19.
Let R be the relation on the set A = {1, 2, 3, 4, 5} such that
(a, b)R(c, d) ⇔ a + b = c + d
a) Is R an equivalence relation?
Exercise 20.
Which of these relations on {0, 1, 2, 3} are partial orderings? Determine the properties of
a partial ordering that the others lack.
Exercise 21.
Which of these are posets?
a) (Z, =)
b) (Z, 6=)
c) (Z, ≥)
d) (Z, -)