Unit 2
Unit 2
Lets say R is the relation where (a,b) ∈ R if and only if a=b then
R={(1,1),(2,2)} and R ⊆ A X B
Relations
• Domain-The set of all first elements of the ordered pairs (x,y) in a relation R from set A to set B is called the domain
of the relation R.
• Range-The Set of all second elements of the ordered pairs(x,y) in a relation R from set A to set B is called the range
of the relation R
• Co-domain-The entire set B is called the co-domain of the relation R
• Ex- Let A={2,3,4,5,6,7} Define a relation R from A to A by R ={(x,y) | y =x+1}.
• Find the relation R and also Write down the domain ,co-domain and range of R.
soln:- Since y= x+1 we can write down the relation R using the ordered pairs. 2
2
R={(2,3),(3,4),(4,5),(5,6),(6,7)} 3 3
Domain of R = {2,3,4,5,6} 4 4
Co-Domain of R ={2,3,4,5,6,7} 5 5
6 6
Range of R= {3,4,5,6,7} 7
7
Relations
• Ex- Show that the relation R is “Less Than” from A to B where : A = {1,2,8} and B =
{1,2,3,5} Find
1. R in Roster Form.
2.Domain and Range of R.
Reflexive
A reflexive relation is the one in which every element maps to itself.
1. set A = {a,b,c}
Now, the reflexive relation will be R1 = {(a, a), (a, b), (a, c),(b, b), (b, c),(c, c)}.
2. {1,2,3,4} then R2 ={(1,1),(2,4),(3,3),(4,1),(4,4)} not reflexive since 2 ∈ A but
(2,2) ∈ R2
Symmetric
A relation R defined on the set A is said to be symmetric, if
(x, y) is an element of R, then (y, x) is also an element of R.
In other words, if x is related to y, then y is also related to x.
Example 1 - set A = { 1 , 4 , 5 , 7 }
R = { ( 1 , 5 ) , ( 5 , 1 ) , ( 4 , 7 ) , ( 7 , 4 ) } is a symmetric
relation.
Example 2 - set B={0,1,2}
R={(0,0)(1,1),(2,2),(1,2)} as (2,1) is not present in relation
so this is not symmetric relation.
Antisymmetric
• A binary relation R on a set A is anti symmetric if (a,b) ∈
R and (b,a) ∈ R then a=b .Here a,b ∈ A
Example 1
• Consider the set A={1,2,3} and the relation R={(1,2),(2,3)}.
• Here, (1,2) ∈ R but (2,1) ∉ R.
• Similarly, (2,3) ∈ R but (3,2) ∉ R.
• There are no pairs (a,b) and (b,a) with a≠b.
• Therefore, R is antisymmetric.
Transitive Relations
A binary relation R on set A said to be transitive relation if(a,b) ∈ R and
(b,c) ∈ R ->(a,c) ∈ R where a,b,c ∈ A
Example A={1,2,3}
R= {(1,2),(2,1),(1,1)} is not transitive since (2,1) ∈ R and
(1,2) ∈ R but (2,2) ∈ R
Consider set R = {(1, 2), (1, 3), (2, 3), (3, 4)}
For the pairs (1, 2) and (2, 3):
=> The relation (1, 3) exists
=> This satisfies the condition.
For the pairs (1, 3) and (3, 4):
=> The relation (1, 4) does not exist
=> This does not satisfy the condition.
So the relation is not transitive.
Equivalence Relation
• A relation R on a set A is called an equivalence relation if
1. R is reflexive i.e (a,a) ∈ R
2. R is symmetric i.e (a,b) ∈ R ->(b,a) ∈ R
3. R is transitive i.e (a,b) ∈ R and (b,c) ∈ R -> (a,c)->R
Que 1-If x={1,2,3……,7} and R ={(x,y) | x-y is divisible by 3}. Show that R is an
Dec 14-2M
• A relation R is reflexive if every element is related to itself. In other
words, for every x in the set, (x,x)∈R
• Verification: For any x in {1,2,3,…,7} x −x=0, and 0 is divisible by 3.
Therefore, (x,x)∈R
• So, R is reflexive.
Que 1-Let A= {1,2,3} R is the relation on A whose matrix is :M= 1 1 1
001
Show that R is transitive. 001
May 17 -3M
Que 2 -A={1,2,3,4},B={1,4,6,8,9} aRb if b=a² .find the domain, range of R.
Also find its relation matrix and draw its diagraph.
Dec 18-6M
• Partial Order Relation (POSET)
• GLB(f,e)=b
• LUB(f,e)=g Greatest Lower Bound(e,f)
• GLB(c,d)=b
• LUB=(c,d)=g
• GLB(e,d)=b, LUB(e,d)=g, GLB(c,f)=b ,LUB(c,f)=g for every incomparable pairs GLB and LUB exist so
we can say it is lattice
Because (f,g) meets at two points at
same time i.e. (e,d)so there is no
unique element hence we can say
this hass diagram is not lattics.
Transitive Closure by Warshall’s
Algorithm
Que 1-Let A= {1,2,3,4} and R= {(1,2),(2,1),(2,3),(3,4)} Find the transitive
closure of R by warshall’s algorithm May 13,17-5M
0010 0101
Types of Function
• One to One Function(Injective)
• Onto Function(Surjective)
• Bijective
One to One Function (Injective)
• A function f from set A to set B is one to one if no two elements in A are mapped to same
element in B
A 1 A 1 A
1
B 2 B 2 B
2
C 3 C 3
3
D 111 111 111
111
111
111
A B A B A B
Onto Function(Surjective)
Bijective
• A function f A->B is Bijection if f is both one to one and onto.
• Ex-
Let A ={1,2,3} and B={a,b,c,d}.In each case state whether the given
function is Injective,Surjective,Bijective.
1)f={(1,a),(2,d),(3,b)}
2)g={(1,a),(2,a),(3,d)}
3)h={(1,a),(1,b),(2,d),(3,c)}
4)j={(1,a),(2,b)}
Functions
Que 1-
What are relations and functions. Given a Relation R= {(1,4),(2,2),(3,10),
(4,8),(5,6)} and check whether the following relations R1,R2,R3,R4 is a
function or not.
R1={(1,4),(2,4),(3,4),(4,4),(5,4)}
R2={(1,2),(2,4),(2,10),(3,8),(4,6),(5,4)}
R3={(1,6),(2,2),(4,4),(5,10)}
R4={(1,6),(2,2),(3,2),(4,4),(5,10)} Dec 17,6M
Composition of Function
Que 1 - Let f(x)=2x+3 , g(x)=3x+4 , h(x)=4x find gof ,fog,foh,goh(Last year Insem Q.)
Que 2-If f(x)=x+2, g(x)=x-2 and h (x) =3x find gof, fog,fof,gog,foh,fogoh.(Dec 12 -6M)
Que 3-Let A={1,2,3} and f1 and f2 are functions from A to B given by f1={(1,2),(2,3),
(3,1)} and f2={(1,2),(2,1),(3,3) compute f1 o f2 and f2 o f1.(May 18-4M)
1.f1∘f2: This means we apply f1 to the result of f2.
1. If we take 1 from A and apply f2, we get 2 in B. Then, if we apply f1 to 2 in B, we get 3 in B.
2. If we take 2 from A and apply f2, we get 1 in B. Then, if we apply f1 to 1 in B, we get 2 in B.
3. If we take 3 from A and apply f2, we get 3 in B. Then, if we apply f1 to 3 in B, we get 1 in B.
2.So, f1 o f2is a new function that maps:
1. 1 in A to 3 in B.
2. 2 in A to 2 in B.
3. 3 in A to 1 in B.
3.f2∘f1: This means we apply f2 to the result of f1.
1. If we take 1 from A and apply f1, we get 2 in B. Then, if we apply f2 to 2 in B, we get 1 in B.
2. If we take 2 from A and apply f1, we get 3 in B. Then, if we apply f2 to 3 in B, we get 3 in B.
3. If we take 3 from A and apply f1, we get 1 in B. Then, if we apply f2 to 1 in B, we get 2 in B.
4.So, f2∘f1is a new function that maps:
1. 1 in A to 1 in B.
2. 2 in A to 3 in B.
3. 3 in A to 2 in B.