Lecture 7 Relation-2
Lecture 7 Relation-2
2
3
4
5
6
7
8
Relation
Definition
a binary relation from A to B is a set R of ordered pairs where the first
element of each ordered pair comes from A and the second element
comes from B.
We use the notation a R b to denote that (a, b) ∈ R and a R b to denote
that (a, b) R. Moreover, when (a, b)belongs to R, a is said to be related
to b by R.
Let A and B be sets. A binary relation from A to B is a subset of A×B.
Nadira
CSE 201 CSE 202 CSE 203
CSE 201
Sojib Nadira 1 0 0
CSE 202 0 1 1
Sojib
Sakir
Sakira 0 0 0
CSE 203
Asma Asma 0 1 1
• For example, let A={1,2,3} and B={x, y, z}. Then the inverse of R={(1, y), (1, z), (3,y)}
• Then the inverse relation is R-1 = {(y,1), (z,1), (y,3)
Relations on a set
Definition
1 1 R 1 2 3 4
1 X X X X
2 2
2 X X
3 3 3 X
4 X
4 4
Directed Graphs of Relations on Sets
• Consider the relation R on the set A={1,2,3,4} :
• R1 = { (a,b) | a≤b } X X X
X X
• R2 = { (a,b) | a>b }
X X X
• R3 = { (a,b) | a=|b| }
X X
• R4 = { (a,b) | a=b }
X
• R5 = { (a,b) | a=b+1 }
X X X X
• R6 = { (a,b) | a+b≤3 }
Relation properties
Properties of Relations
• Properties of relations we will study:
• Reflexive
• Symmetric
• Antisymmetric
• Transitive
Reflexivity
• Reflexivity
• Definition: A relation is reflexive if
• (a, a) R for all a A
Symmetric and Antisymmetric
Relations
Definition
Symmetric and Antisymmetric
Relations
• A relation is symmetric if
• for all a, b A, (a,b) R (b,a) R
• A relation is antisymmetric if
• for all a, b A, (a,b) R (b,a) R
• If aRb and bRa then a=b
Transitivity
Definition
•
Transitivity
Transitivity
• A relation is transitive if
• for all a, b, c A, ((a,b)R (b,c)R) (a,c)R
• If a = b and b = c, then a = c
• Thus, = is transitive
Summary of properties of relations
reflexive a (a, a) R
irreflexive a (a, a) R
(*)
Alternative definition…