This document contains lecture notes on relations from a Discrete Structures course. It defines what a relation is and provides examples of relations on sets. It then discusses various properties of relations such as reflexive, symmetric, antisymmetric, transitive, and how to combine relations using set operations. It also introduces the concept of the closure of a relation and provides examples of finding the reflexive and transitive closure of relations. Finally, it provides a brief definition of what a graph is in terms of vertices and edges.
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Properties of relations
1. Fall 2002 CMSC 203 - Discrete Structures 1
You Never Escape Your…You Never Escape Your…
RelationsRelations
2. Fall 2002 CMSC 203 - Discrete Structures 2
Relations on a SetRelations on a Set
Definition:Definition: A relation on the set A is a relationA relation on the set A is a relation
from A to A.from A to A.
In other words, a relation on the set A is a subsetIn other words, a relation on the set A is a subset
of Aof A××A.A.
Example:Example: Let A = {1, 2, 3, 4}. Which ordered pairsLet A = {1, 2, 3, 4}. Which ordered pairs
are in the relation R = {(a, b) | a < b} ?are in the relation R = {(a, b) | a < b} ?
3. Fall 2002 CMSC 203 - Discrete Structures 3
Relations on a SetRelations on a Set
Solution:Solution: R = {R = {(1, 2),(1, 2), (1, 3),(1, 3), (1, 4),(1, 4), (2, 3),(2, 3),(2, 4),(2, 4),(3, 4)}(3, 4)}
RR 11 22 33 44
11
22
33
44
11 11
22
33
44
22
33
44
XX XX XX
XX XX
XX
4. Fall 2002 CMSC 203 - Discrete Structures 4
Properties of RelationsProperties of Relations
We will now look at some useful ways to classifyWe will now look at some useful ways to classify
relations.relations.
Definition:Definition: A relation R on a set A is calledA relation R on a set A is called
reflexivereflexive if (a, a)if (a, a)∈∈R for every element aR for every element a∈∈A.A.
Are the following relations on {1, 2, 3, 4} reflexive?Are the following relations on {1, 2, 3, 4} reflexive?
R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)} No.No.
R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)} Yes.Yes.
R = {(1, 1), (2, 2), (3, 3)}R = {(1, 1), (2, 2), (3, 3)} No.No.
Definition:Definition: A relation on a set A is calledA relation on a set A is called
irreflexiveirreflexive if (a, a)if (a, a)∉∉R for every element aR for every element a∈∈A.A.
5. Fall 2002 CMSC 203 - Discrete Structures 5
Properties of RelationsProperties of Relations
Definitions:Definitions:
A relation R on a set A is calledA relation R on a set A is called symmetricsymmetric if (b,if (b,
a)a)∈∈R whenever (a, b)R whenever (a, b)∈∈R for all a, bR for all a, b∈∈A.A.
A relation R on a set A is calledA relation R on a set A is called antisymmetricantisymmetric ifif
a = b whenever (a, b)a = b whenever (a, b)∈∈R and (b, a)R and (b, a)∈∈R.R.
6. Fall 2002 CMSC 203 - Discrete Structures 6
Properties of RelationsProperties of Relations
Are the following relations on {1, 2, 3, 4}Are the following relations on {1, 2, 3, 4}
symmetric or antisymmetric?symmetric or antisymmetric?
R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)} symmetricsymmetric
R = {(1, 1)}R = {(1, 1)} sym. andsym. and
antisym.antisym.
R = {(1, 3), (3, 2), (2, 1)}R = {(1, 3), (3, 2), (2, 1)} antisym.antisym.
And.And.
R = {(4, 4), (3, 3), (1, 4)}R = {(4, 4), (3, 3), (1, 4)} antisym.antisym.
7. Fall 2002 CMSC 203 - Discrete Structures 7
Properties of RelationsProperties of Relations
Definition:Definition: A relation R on a set A is calledA relation R on a set A is called
transitivetransitive if whenever (a, b)if whenever (a, b)∈∈R and (b, c)R and (b, c)∈∈R, thenR, then
(a, c)(a, c)∈∈R for a, b, cR for a, b, c∈∈A.A.
Are the following relations on {1, 2, 3, 4}Are the following relations on {1, 2, 3, 4}
transitive?transitive?
R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)}R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)} Yes.Yes.
R = {(1, 3), (3, 2), (2, 1)}R = {(1, 3), (3, 2), (2, 1)} No.No.
R = {(2, 4), (4, 3), (2, 3), (4, 1)}R = {(2, 4), (4, 3), (2, 3), (4, 1)} No.No.
8. Fall 2002 CMSC 203 - Discrete Structures 8
Combining RelationsCombining Relations
Relations are sets, and therefore, we can apply theRelations are sets, and therefore, we can apply the
usualusual set operationsset operations to them.to them.
If we have two relations RIf we have two relations R11 and Rand R22, and both of, and both of
them are from a set A to a set B, then we canthem are from a set A to a set B, then we can
combine them to Rcombine them to R11 ∪∪ RR22, R, R11 ∩∩ RR22, or R, or R11 – R– R22..
In each case, the result will beIn each case, the result will be another relationanother relation
from A to Bfrom A to B..
9. Fall 2002 CMSC 203 - Discrete Structures 9
Combining RelationsCombining Relations
compositecomposite SS°° RR::
if relation R contains a pair (a, b) and relation Sif relation R contains a pair (a, b) and relation S
contains a pair (b, c), then Scontains a pair (b, c), then S°° R contains a pair (a, c).R contains a pair (a, c).
Example:Example:
SbxRxaxRSba ∈∧∈∃↔∈ ),(),(:),(
)}4,3(),1,3(),3,2(),4,1(),1,1{(=R
)}1,4(),2,3(),1,3(),0,2(),0,1{(=S
)}1,3(),0,3(),2,2(),1,2(),1,1(),0,1{(=RS
:
:
10. Fall 2002 CMSC 203 - Discrete Structures 10
Combining RelationsCombining Relations
Definition:Definition: Let R be a relation on the set A. TheLet R be a relation on the set A. The
powers Rpowers Rnn
, n = 1, 2, 3, …, are defined inductively by, n = 1, 2, 3, …, are defined inductively by
RR11
= R= R
RRn+1n+1
= R= Rnn
°° RR
In other words:In other words:
RRnn
= R= R°° RR°° …… °° R (n times the letter R)R (n times the letter R)
11. Fall 2002 CMSC 203 - Discrete Structures 11
Combining RelationsCombining Relations
Theorem:Theorem: The relation R on a set A is transitive ifThe relation R on a set A is transitive if
and only if Rand only if Rnn
⊆⊆ R for all positive integers n.R for all positive integers n.
Remember the definition of transitivity:Remember the definition of transitivity:
Definition:Definition: A relation R on a set A is calledA relation R on a set A is called
transitive if whenever (a, b)transitive if whenever (a, b)∈∈R and (b, c)R and (b, c)∈∈R, thenR, then
(a, c)(a, c)∈∈R for a, b, cR for a, b, c∈∈A.A.
The composite of R with itself contains exactlyThe composite of R with itself contains exactly
these pairs (a, c).these pairs (a, c).
Therefore, for a transitive relation R, RTherefore, for a transitive relation R, R°° R does notR does not
contain any pairs that are not in R, so Rcontain any pairs that are not in R, so R°° RR ⊆⊆ R.R.
Since RSince R°° R does not introduce any pairs that are notR does not introduce any pairs that are not
already in R, it must also be true that (Ralready in R, it must also be true that (R°° R)R)°° RR ⊆⊆ R,R,
and so on, so that Rand so on, so that Rnn
⊆⊆ R.R.
12. Closure of Relation:Closure of Relation:
Definition:Definition: Let R be a relation on a set A. R mayLet R be a relation on a set A. R may
or may not have someor may not have some property Pproperty P, such as, such as
reflexivity, symmetry, or transitivity.reflexivity, symmetry, or transitivity.
If there is a relation S with property PIf there is a relation S with property P
containing R such that S is a subset of everycontaining R such that S is a subset of every
relation with property P containing R, then S isrelation with property P containing R, then S is
called the closure of R with respect to P.called the closure of R with respect to P.
12
13. Example I:Example I: Find theFind the reflexivereflexive closureclosure of relation R =of relation R =
{(1, 1), (1, 2), (2, 1), (3, 2)} on the set A = {1, 2, 3}.{(1, 1), (1, 2), (2, 1), (3, 2)} on the set A = {1, 2, 3}.
Solution:Solution: We know that any reflexive relation on AWe know that any reflexive relation on A
must contain the elements (1, 1), (2, 2), and (3, 3).must contain the elements (1, 1), (2, 2), and (3, 3).
By adding (2, 2) and (3, 3) to R, we obtain theBy adding (2, 2) and (3, 3) to R, we obtain the
reflexive relation S, which is given byreflexive relation S, which is given by
S = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 2), (3, 3)}.S = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 2), (3, 3)}.
Therefore, S is theTherefore, S is the reflexive closurereflexive closure of R.of R.
Fall 2002 CMSC 203 - Discrete Structures 13
14. Example II:Example II: Find theFind the transitive closuretransitive closure ofof
the relation R = {(1, 2), (2,3), (3, 4)} on thethe relation R = {(1, 2), (2,3), (3, 4)} on the
setset
A = {1, 2, 3, 4}.A = {1, 2, 3, 4}.
Solution:Solution: R would be transitive, if for allR would be transitive, if for all
pairspairs
(a, b) and (b, c) in R there were also a pair (a,(a, b) and (b, c) in R there were also a pair (a,
c) in R.c) in R.
11stst
order: (1,3),(2,4)order: (1,3),(2,4)
22ndnd
order: (1,4)order: (1,4)
Fall 2002 CMSC 203 - Discrete Structures 14
15. Graph:Graph:
AA graph Ggraph G == (V ,E)(V ,E) consists ofconsists of VV , a nonempty, a nonempty
set ofset of verticesvertices (or(or nodesnodes) and) and EE, a set of, a set of
edgesedges. Each edge has either one or two. Each edge has either one or two
vertices associated with it, called itsvertices associated with it, called its
endpointsendpoints..
Fall 2002 CMSC 203 - Discrete Structures 15