INSTITUT TEKNIKAL JEPUN MALAYSIA
JABATAN TENAGA MANUSIA
KEMENTERIAN SUMBER MANUSIA
INSTITUT TEKNIKAL JEPUN MALAYSIA
MALAYSIA
INFORMATION SHEET
CODE AND
PROGRAM J12 DIPLOMA IN COMPUTER ENGINEERING TECHNOLOGY
NAME
CODE AND
DKB3204 DISCRETE MATHEMATICS
COURSE NAME
TOPIC 3.0 RELATIONS
Upon completion of this course students should be able to :
Describe the discrete structures and techniques which can be
COURSE CLO 1
used for solving problems in computing effectively.
LEARNING Identify problems which can be solved using discrete structures
OBJECTIVE CLO 2
and techniques.
Apply the basic of mathematical reasoning, discrete structures,
CLO 3
applications and modeling appropriately.
3.1 Definition of relations
Let A and B be sets. A (binary) relation R from A to B is a subset of A B . Given an
ordered pair x, y in A B , x is related to y by R, written x R y, if and only if x, y is in R .
The notation for relation may be written symbolically as follows:
x R y x, y R
Example
Given set A 0,1, 2 and B 1,2, 3.
- 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 shorthand for the sentence “ x is related to y”
- Then:
0 R 1 sin ce 0 1,
0 R 2 sin ce 0 2,
0 R 3 sin ce 0 3,
1 R 2 sin ce 1 2,
1 R 3 sin ce 1 3, and
2 R 3 sin ce 2 3,
x R y 0,1 , 0,2, 0,3, 1,2, 1,3, 2,3
1
Recall that the Cartesian product of A and B where A B , consists of all ordered
pairs whose first element is in A and whose second element is in B:
A B x, y x A and y B.
3.1.1 Properties Relation
1) R is reflexive for all x in A, x, x R.
2) R is symmetric for all x and y in A, if x, y R then y, x R
3) R is transitive for all x, y, and z in A, if x, y R and y, z R then x, z R.
Reflexive
A relation R on a set A is reflexive if (x , x) ϵ R for every x ϵ A.
In a reflexive relation, every element on a set A is related to itself (the arrow
pointed to itself)
Have a loop at every vertex.
x y
Example 1
Consider the following relations on the set A = {1, 2, 3, 4}. Determine whether the relation
is reflexive or not?
a) R₁ = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}
b) R₂ = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
Solution
a) R₁ = {(1, 1), (1, 2), (2, 3), (1, 3), (4, 4)}
Directed graph;
2
1
4 3
Hence, R₁ is not reflexive because not all (x,x) ϵ R for every x ϵ A.
2
b) R₂ = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
1 2
4 3
Hence, R2 is reflexive because for all (x, x) ϵ R for every x ϵ A.
Symmetric
A relation R on a set A is called symmetric if whenever aRb then bRa, that is, if
whenever (a, b) ∈ R then (b, a) ∈ R. Thus, R is not symmetric if there exist a, b
∈ A such that (a, b) ∈ R but (b, a) ∉ R.
A relation R on a set A is antisymmetric if whenever aRb and bRa, then a=b,
that is, if whenever (a, b),(b, a) ∈ R then a=b. Thus R is not antisymmetric if
there exist a, b ∈ A such that (a ,b) and (b, a) belong to R, but a b.
In a symmetric relation, for each arrow we have also an opposite arrow.
Example
Determine which of the relations in Example 1 are symmetric.
Solution
a) Hence, R₁ is not symmetric because not all (x , y) ϵ R then (y , x) ϵ R.
b) Hence, R2 is not symmetric because not all (x , y) ϵ R then (y , x) ϵ R.
Transitive
A relation R on a set A is called transitive if whenever (a, b) ∈ R and (b, c) ∈ R,
then (a, c) ∈ R, for all a, b, c ∈ A.
Example
Determine which of the relations in Example 1 are transitive.
- Hence, R₁ is transitive because for all (x , y) ϵ R and(y, z) ϵ R, then (x, z) ϵ R.
3
- Hence, R2 is not transitive because not all (x , y) ϵ R and(y, z) ϵ R, then (x, z) ϵ R.
3.1.2 Representing Relations Using Digraphs
Each element of the set can be represented by a point, and each ordered pair is
represented using an arc with its direction indicated by an arrow. We use such pictorial
representations when we think of relations on a finite set as directed graphs, or
digraphs.
DEFINITION 1
A directed graph, or digraph, consists of a set V of vertices (or nodes) together with a
set E of ordered pairs of elements of V called edges (or arcs). The vertex a is called
the initial vertex of the edge (a, b), and the vertex b is called the terminal vertex of this
edge.
An edge of the form (a, a) is represented using an arc from the vertex a back to itself.
Such an edge is called a loop.
EXAMPLE
The directed graph with vertices a, b, c, and d, and edges (a, b), (a, d), (b, b), (b, d),
(c,a), (c, b), and (d, b) is displayed in Figure 4.
FIGURE 1 A Directed Graph.
The relation R on a set A is represented by the directed graph that has the elements of
A as its vertices and the ordered pairs (a, b), where (a, b) ∈ R, as edges. This
assignment sets up a one-to-one correspondence between the relations on a set A and
the directed graphs with A as their set of vertices. Thus, every statement about relations
corresponds to a statement about directed graphs, and vice versa.
Directed graphs give a visual display of information about relations. As such, they are
often used to study relations and their properties.
4
3.2 Equivalence Relations
In this section we will study relations with a particular combination of properties that
allows them to be used to relate objects that are similar in some way.
DEFINITION 1
A relation on a set A is called an equivalence relation if it is reflexive, symmetric, and
transitive.
Equivalence relations are important throughout mathematics and computer science.
One reason for this is that in an equivalence relation, when two elements are related it
makes sense to say they are equivalent.
5
QUICK EXERCISE
1) Let A 1,2 and B 1,2,3 define a binary relation R from A to B as follows:
x, y A B, x, y R x y is even.
a) State explicitly which ordered pairs are in A B and which are in R .
2) Consider the following relation on A = {1, 2, 3, 4} which is
R 1,1, 1,2, 1,3, 1,4, 2,1, 2,2, 3,1, 3,3, 4,1, 4,4
a) Draw the directed graph for the relation R.
b) Determine whether the relation R is reflexive, symmetric or transitive.
Explain your answers.
3) Let M= {0, 1, 2, 3} and define relation R= 0,1, 0,3, 1,0, 1,12,3, 3,0, 3,3, 3,2
a) Represent the relation R using directed graph
b) Determine whether the relation R is reflexive, symmetric or transitive.
Explain your answers.
4) For the following questions, refer to the directed graph below for the relation R.
c b
a) List the ordered pairs in the relation R represented by the directed graph
above.
b) Determine whether the relation R is an equivalence relation on the set
{a,b,c}. Explain your answer.