0% found this document useful (0 votes)
15 views55 pages

Lecture Week 9 - Relations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views55 pages

Lecture Week 9 - Relations

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Switch off your Mobile Phone

or
Change Profile to Silent Mode

Date-22nd Dec. 2019 By-Aananda Bhattarai


Welcome To The Week-09

Logic & Problem Solving(MA4001NP)


Lecture -9

RELATIONS
Date-22nd Dec. 2019 By-Aananda Bhattarai
Agenda:

 Week 8 lecture coverage


– Relation
– Properties of relations
– Types of relations

Date-22nd Dec. 2019 By-Aananda Bhattarai


Before We start:-

Lets Watch some cool Mathmatical Trick!

Date-22nd Dec. 2019 By-Aananda Bhattarai


Cool Math Tricks!

Date-22nd Dec. 2019 By-Aananda Bhattarai


Predict the result !

Date-22nd Dec. 2019 By-Aananda Bhattarai


The Cartesian Product of Two Sets:
Let A and B are two sets .The Cartesian product of sets A
and B is denoted by AB and is the set of ordered pairs
given by ,
AB = { (a , b) : a A and b B}
Example:
If A ={a,b,c} and B = {d} then ,
AB = {(a , d), (b , d) , (c , d) }
BA = {(d , a) , (d , b), (d , c) }
AA = {(a , a) , (a , b), (a , c) ,(b , b) , (b , a), (b , c) , (c , c) ,
(c , a), (c , b) }
Note : Here |A| = 3 and |B| = 1 then | AB | =| BA|=3
Date-22nd Dec. 2019 By-Aananda Bhattarai
Definition of Relations:
Let A be a non-empty set. Any subset R of the Cartesian
product A x A is called a relation on the set A.

Notation: If R is a relation on A (i.e. R  A x A) and


if ( x , y)  R then we say x is related to y by R and we
write x R y.
if (x , y) R we write xRy

Date-22nd Dec. 2019 By-Aananda Bhattarai


Example:
Example 1:
Let A = {1,2,3,4,5}. Then
R = {(1,2), (4,2), (3,5)}
S = {(1,1), (2,2), (3,3), (4,4), (5,5)) = {(a , a) : a A} and
T = {(3,4)} are all relations on A.

We could write 1 R2, 4R2 and 3R5


Similarly 1S1,2S2 etc.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Example (Contd.):
Example 2 :
Let A = {1, 2, 3, 4)
We can define a subset R of A x A; and hence a relation on
A, by R = { (a , b): a  A, b  A, a b}
This is called the "is less than equal to" relation on A.

Another way of describing this relation is simply by saying


a R b if a  b.
In set listing notation
R = { (1,1) ,(1,2) (1,3), (1,4), (2,2), (2,3), (2,4), (3,3), (3,4),
(4,4)}
Date-22nd Dec. 2019 By-Aananda Bhattarai
Example (Contd.):
Example 3 :
Let P denote the set of all people living in Kathmandu. We
can define a relation R on P by a R b if a is the father of b.
In set builder notation
R = {(a , b) : a  P, b  P, a is the father of b}

We might say "is the father of is a relation on P.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Pictorial representation of relations:
Often the best way of illustrating the structure and
properties of a relation is by means of a diagrammatic
representation of the relation.

1. Digraphs
2. Matrix Representation

Date-22nd Dec. 2019 By-Aananda Bhattarai


Digraphs:
In discrete mathematics a Graph is a set of points (called
Vertices) some of which are connected by lines (or Arcs)
called Edges.
For example: Here there are the four
vertices a, b, c and d with
edges as shown.

Note that there is an edge


joining b to itself. Such an
edge is called a Loop.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Digraphs (Contd.):
A graph in which every edge has a direction (indicated
by an arrow) is called a Directed graph or Digraph.

Notice that there are


two directed edges
between a and d, one
in each direction and
that these really are
different edges.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Digraphs (Contd.):
For example:
Let A = {1, 2, 3, 4} and
R = {(1, 2), (1, 3), (1, 4), (2, 2), (3, 1), (4, 2)}
The digraph of R is then:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Digraphs (Contd.):
For example:
Let A = {a, b, c, d, e} and suppose two letters are related if
the first precedes the second in the alphabet. The
digraph representation of this relation is then:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Matrix Representation:
If R is a relation on a finite set A, with l A l = n, we
construct an n x n matrix representation of R as follows:
 Label the rows and columns of an n x n matrix M by the
elements of A.
 For all ordered pairs (x, y)  A x A locate the unique
position in M defined by row x and column y.
 Enter a 1 in this position if x R y and a 0 otherwise.
We call M the matrix of the relation R or the relation
matrix for R.
Date-22nd Dec. 2019 By-Aananda Bhattarai
Matrix Representation (Contd.):
The two relations from above examples have the
following relation matrices:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Any Questions?

Date-22nd Dec. 2019 By-Aananda Bhattarai


Some special relations:
1. Reflexive Relations

2. Symmetric Relations

3. Transitive Relations

4. Equivalence Relations

5. Anti-symmetric Relations

6. Anti-Reflexive Relations

Date-22nd Dec. 2019 By-Aananda Bhattarai


Exercises…
Question :
Let R1 and R2 be the relation on set A ={1,2,3,4} given by
1. R1 ={(1,1), (1,2), (2,1), (2,2), (3,3), (1,3), (3,1), (4,4)}
2. R2 ={(1,1), (2,2), (3,3), (4,4)}
Draw matrix and Digraphs representation and check all the seven
properties of relations for R1 and R2.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Reflexive Relations:
Many important relations in mathematics have the
property that every element is related to itself. We call
such relations Reflexive.

We say a relation R on a set A is reflexive if x R x for every


element x  A.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Reflexive Relations (Contd.):
Examples:

1. Let A = {1, 2, 3, 4} and


R = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3), (3, 1), (4, 4)}
Then R is reflexive since 1 R1, 2R2, 3R3 and 4R4 are
present.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Reflexive Relations (Contd.):
Examples:

3. Let R be the "is less than" relation on the set N of


natural numbers (that is, x R y if x < y). Then R is not
reflexive since x is not less than x for any x  N.

i.e R = {(1, 2), (3, 2), (3, 1), (4, 3), (4, 2), (4, 1), (5, 4),....}

This is not Reflexive Relation.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Reflexive Relations (Contd.):
The digraph and matrix representations of a reflexive
relation have simple characteristic features. Since x R x for
all x  A it follows easily that for a reflexive relation:

a. Every vertex of the digraph has a loop attached.


b. The matrix M representing R must have a 1 in every
position in its main diagonal (that is, the diagonal
from the top left of the matrix).

Date-22nd Dec. 2019 By-Aananda Bhattarai


Reflexive Relations (Contd.):
Example:
Let A = {1, 2, 3, 4} and
R = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3), (3, 1), (4, 4)} gives
the following digraph and matrix of R:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Symmetric Relations:
We have already seen that simply because element a is
related to element b it does not follow that b must be
related to a.
However, for some relations this is the case, and we call
such relations Symmetric.
More precisely:
We say a relation R on a set A is symmetric if a R b  b R
a for all a, b  A.
[The symbol  is read as "implies" and means that
whenever the left hand side is true the right hand side
must also be true]
Date-22nd Dec. 2019 By-Aananda Bhattarai
Symmetric Relations (Contd.):
We next look at what effect being symmetric has on the
digraph and matrix representation of a relation.
• If R is a symmetric relation on A we know that
x R y y R x. This means that if there is an edge from
x to y in the digraph of R then there must also be an
edge from y to x.
Hence, if R is symmetric, every edge of the digraph of R
comes as part of a pair of edges of the form

Date-22nd Dec. 2019 By-Aananda Bhattarai


Symmetric Relations (Contd.):
The only exception to this is that a symmetric relation
may have loop edges:

The relation R = { (1, 2), (2, 1), (2, 3), (2, 2), (3, 2) } on
the set A = {1, 2, 3} is symmetric. Its digraph is as below:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Symmetric Relations (Contd.):
• Now suppose M is the matrix of a symmetric relation.
Since x R y  y R x, if there is a 1 in position (x, y) of M
there must also be a 1 in position (y, x).
Similarly, a 0 in position (x, y) implies a 0 in position (y, x).

Consequently,
A relation R is symmetric if and only if the matrix of R is
symmetric.

[Note: a matrix is symmetric if it is equal to its own


transpose ]

Date-22nd Dec. 2019 By-Aananda Bhattarai


Symmetric Relations (Contd.):
The relation R = { (1, 2), (2, 1), (2, 3), (2, 2), (3, 2) } on the
set A = {1, 2, 3} is symmetric. Its Matrix representation M
is as below:

0 1 0
M= 1 1 1
0 1 0

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations:
The transitive relation is a special case that frequently
occurs in mathematics. We call a relation R transitive if
whenever a is related to b and b is related to c it follows
that a is related to c.

More precisely:
We say a relation R on a set A is transitive if
a R b and b R c  a R c

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations (Contd.):
Examples:
1. Let A = {1, 2, 3, 4} and
R = (1, 1), (1, 2), (2, 3), (1, 3), (4, 1), (4, 2), (4, 3)}
To check transitivity we must test all occurrences of both
a R b and b R c ( with b  a and c  b) , and verify a R c in
each case.
Here we have 1 R2 and 2R3 but also 1 R3
4R1 and 1 R2 but also 4R2
4R1 and 1 R3 but also 4R3
4R2 and 2R3 but also 4R3
In all cases where a R b and b R c it is also true that a R c.
Therefore relation R on set A is transitive .
Date-22nd Dec. 2019 By-Aananda Bhattarai
Transitive Relations (Contd.):
Examples :
2. Let A={1, 2, 3, 4} and
R={(1, 1), (1, 3), (3, 1), (1, 2), (3, 2), (3, 4), (1, 4)}
Then R is not transitive.
To demonstrate this we need only find one occurrence of
a R b and b R c for which aRc.
Here we have 3 R 1 and 1 R 3 but 3R3.
Alternatively , (3,1) and (1,3) belongs to R but (3,3)
doesn't belongs to R so R is not transitive .

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations (Contd.):
In terms of the digraph and the matrix representation of
a relation, transitivity is easy to interpret but much more
difficult to check, especially for relations on large sets.
a. Since x R y and y R z  x R z it follows that,
 Every time there is an edge from a vertex x to vertex y
and an edge from y to z, there must be an edge from x
to z, shown as the broken line below:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations (Contd.):
 Every time there is an edge from x to y and an edge
from y back to x there must be loops at both x and y:

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations (Contd.):
b)
 Every time there is a 1 in position (x, y) and a 1 in
position (y, z)there must be a 1 in a position (x, z).
 Every time there is a 1 in position (x, y) and a 1 in
position (y, x) there must be a 1 in both diagonal
positions (x, x) and (y, y).

The above interpretations would be difficult to check for


relations on large sets. For small sets the following
systematic approaches may be helpful.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations (Contd.):
The digraph and matrix representations for the relation
which is transitive .
Let A = {1, 2, 3, 4} and
R = { (1, 1), (1, 2), (2, 3), (1, 3), (4, 1), (4, 2), (4, 3)}

Date-22nd Dec. 2019 By-Aananda Bhattarai


Transitive Relations (Contd.):
Example:
The matrix of a relation R on the set A = {1, 2, 3, 4} is
given below:

Since N(3, 3) = 0 we conclude that R is not transitive


without further investigation. In other words (3,1) and
(1,3) belongs to R but (3,3) doesn't belongs to R so R is
not transitive.
Date-22nd Dec. 2019 By-Aananda Bhattarai
Any Questions?

Date-22nd Dec. 2019 By-Aananda Bhattarai


Equivalence Relations:
A relation R on a set A which is reflexive, symmetric and
transitive is called an equivalence relation.
For example,
If A = { -2, -1, 0, 1, 2, 3 } , the “is equal to” relation would
be given, in set listing notation, by
R = {(-2, -2), (-1, -1), (0, 0), (1, 1), (2, 2), (3, 3)}
Here the given relation is reflexive , symmetric and
transitive .So R is an equivalence relation on set A.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Equivalence Relations (Contd.):
Example I:
If A is any set of real numbers we define the "is equal to"
relation on A by a R b if a = b.
Then R is an equivalence relation since
i) a = a for all real numbers a.
a R a for all a  A and R is reflexive.
ii) if a = b then b = a for all real numbers a and b
 a R b  b R a and R is symmetric.
iii) if a = b and b = c then a = c
a R b and b R c  a R c and R is transitive.
Hence the relation is an equivalence relation.
Date-22nd Dec. 2019 By-Aananda Bhattarai
Equivalence Relations (Contd.):
Example II:
Let S be the relation on Z defined by m S n if m + n is
even. (Note first that an integer x is even if we can
write x = 2k for some integer k)
We can now show that S is a equivalence relation since
i. m + m = 2m (even) for all m  Z
 m S m and S is Reflexive.
ii. if m S n then m + n = 2k for some k  Z.
Then n + m = 2k and n S m also.
 m S n  n S m and S is Symmetric.
Date-22nd Dec. 2019 By-Aananda Bhattarai
Equivalence Relations (Contd.):
iii. if m S n and n S p then
m + n = 2k1 and n + p = 2k2 for some k1, k2  Z.
Then m +n +n +p = 2k1 + 2k2
m + 2n +p = 2k1 + 2k2
 m + p = 2k1 + 2k2 — 2n
= 2(k1 + k2 — n)
= 2l ,where I = (k1 + k2 — n)  Z
 m S p and S is transitive.

Hence S is an equivalence relation.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Anti – Symmetric Relations:
For an arbitrary relation R, if we have x R y sometimes we
will have y R x as well, but not always. We have called R
symmetric if whenever we have x R y we always have y R
x as well.
However, there are some relations for which we never
have both x R y and y R x for distinct elements x, y  A.
We call such relations anti-symmetric.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Anti – Symmetric Relations (Contd.):
More formally we have:
We say a relation R on a set A is antisymmetric if
x R y and y R x  x = y or, equivalently,
if R(a , b) with a  b, then R(b , a) must not hold.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Anti – Symmetric Relations (Contd.):
Examples:
1. Let A = {1, 2, 3, 4} and
R = {(1, 3), (2, 2), (2, 1), (3, 4), (4, 1), (4, 4)}
Then R is antisymmetric since R does not contain both
(x, y) and (y, x) for any distinct elements x and y of A.

2. A = {1, 2, 3, 4} ,
R = {(1, 3), (1, 2), (2, 2), (3, 1), (4, 2), (3, 4)}
Hence R is not antisymmetric since both (1, 3)  R and
(3, 1)  R (notice that since (1, 2)  R and (2, 1)  R, R is
not symmetric either).
Date-22nd Dec. 2019 By-Aananda Bhattarai
Anti – Symmetric Relations (Contd.):
It is easy to interpret "antisymmetry" in both the
digraph and matrix representations of the relation.

a) Since x R y and y R x are not both allowed for distinct


x, y  A we cannot have any configurations of the
form in the digraph of an antisymmetric relation.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Anti – Symmetric Relations (Contd.):
b) For the matrix, if there is a 1 in position (x, y) with
(x  y) there must be a 0 in position (y, x).
Example: Let A = {1, 2, 3, 4} and
R = {(1, 3), (2, 2), (2, 1), (3, 4), (4, 1), (4, 4)}
we obtain the digraph and matrix below:

Note that the criterion of a) and b) above hold.


Date-22nd Dec. 2019 By-Aananda Bhattarai
Irreflexive Relations:
We say a relation R on a set A is irreflexive if (x, x) doesn't
belongs to R for every element x  A.
For Example:
Let A = {1, 2, 3, 4} and
R = {(1,3), (2,1), (3,4), (2,3), (4,1)}
S = {(1,1), (1,2), (2,1), (2,2), (3,3), (1,3), (3,1), (4,4)}

Here relation R is irreflexive because (x ,x ) doesn't


belongs to R for every element x  A.
Here relation S is not irreflexive because (1 ,1 ) belongs
to S .
Date-22nd Dec. 2019 By-Aananda Bhattarai
Any Questions?

Date-22nd Dec. 2019 By-Aananda Bhattarai


Exercises…
Question 1:
Let R1 and R2 be the relation on set A ={1,2,3,4} given by
1. R1={(1,1), (1,2), (2,1), (2,2), (3,3), (1,3), (3,1), (4,4)}
2. R2={(1,1), (2,2), (3,3), (4,4)}
Draw matrix and Digraphs representation and check all the seven
properties of relations for R1 and R2.
Question 2:
Determine the properties (reflexivity, symmetry, transitivity) of the
following relations defined on the set of natural numbers:
a. R = {(x, y) | x = y² }
b. R = {(x, y) | x > y }
c. R = {(x, y) | x  y }
Date-22nd Dec. 2019 By-Aananda Bhattarai
Summary: Week 8 Lecture:
• Relation
• Properties of relations
• Types of relations

Date-22nd Dec. 2019 By-Aananda Bhattarai


What to Expect: Week 8 Tutorials
• Review and practice Relations problems through in-
class assignments to actually acquire them.
• Practice problems to know how concept of relations
can be useful in solving various mathematical
problems.

Date-22nd Dec. 2019 By-Aananda Bhattarai


Thank you

Date-22nd Dec. 2019 By-Aananda Bhattarai

You might also like