0% found this document useful (0 votes)
55 views35 pages

Unit 2

Discrete Mathematics Slides

Uploaded by

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

Unit 2

Discrete Mathematics Slides

Uploaded by

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

Relations

Let A and B two sets. A binary relation R from A to B is a subset of A X B


OR
R⊆AXB
Recall: A X B ={(a,b) | a ∈ A & b ∈ B }

Usually we use the notation aRb to denote (a,b) ∈ R


a R b is used to denote (a,b) ∈ R

Example: Let A = {1,2,3} & B = {0,1,2,4}


A X B={(1,0),(1,1),(1,2),(1,4),(2,0),(2,1),(2,2),(2,4),(3,0),(3,1),(3,2),(3,4)} Order Pairs

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.

Solution : 1. R in Roster form R={(1,2),(1,3),(1,5),(2,3),(2,5)}


2. Domain of R ={1,2}
Range of R = {2,3,5}
Representation of a Relation
• A set of ordered pairs
• Arrow Diagram
• Diagraph
• Matrix
Example-
Let A={1,2,3,4,8} and B={1,4,6,9}
Let R={(x,y) | y is divisible by x}
• Let A = {1,2,3,4,5} Define the following relation R on A aRb if and only
if a<b.
Find:
1) R in roster form
2)Domain and range of R
3)Diagraph of R Dec 19 -3M
Properties of Binary Relation.
1.Reflexive Relations.
2.Symmetric Relations
3.Anti-Symmetric Relation
4.Transitive Relation

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

equivalence relation. Draw the diagraph of R


Dec 12,May 14- 6M

Que 2-Let x = {1,2..n}


R={(x,y)|x-y is divisible by 3} show that R is equivalence relation. Draw
the diagraph for R where n=7
Dec 19-6M

Que 3-Consider the following relation on {1,2,3,4,5,6}:R={(I,j):|i-j|=2}is R transitive? Is R


Reflexive ? Is R Symmetric ?

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)

A Relation R on a set A is said to be partial order relation if it is


(a) Reflexive (b) Antisymmetric (c) Transitive
Ex- A={1,2,3}
R1={(1,1),(2,2),(3,3)}
R2={(1,1),(2,2),(3,3),(1,2),(2,3),(1,3)}
Poset
Steps to Draw Hass Diagram
Hass Diagram
• A graphical representation of partial order relation in which all arrowhead
are understood to be pointing upward is known as the Hass Diagram.
• Example –
Let A = {1,2,3,4,6,8} be ordered by the relation “a divides b”
:
1.Start with a directed graph.
2Remove Self loop.
3.Remove all transitive edges.
4.Remove all Arrows.
• Draw hass diagram representing the partial ordering:{(a,b) |a divides b} on
{1,2,3,4,5,6,8,12} Find two examples of chain and antichain.

1.In a chain,every two elements are related.


2.In an antichain,no two elements are related.
Dec 19-3M
• Maximal Element-In a poset ,If an element is not related to any other
element.
• Minimal Element-In a poset,If an element is related to an element.
Example- Let (P, R) be a poset and p = {1,2,3,4,5} and R is the relation of
division.
We know that 3 4 5 are not related to any element.
So 3 4 5 are maximal element.
No element is related to 1 so 1 is minimal element.
Lattice
• A poset (p,r) is said to be a lattice if every two elements in the set L has a unique least
upper bound and unique greatest lower bound.
• Example-

Least Upper Bound(e,f)

• 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

Que 2-Find the transitive closure of R by warshall’s algorithm, Where


A={1,2,3,4,5,6} and R ={(x,y) | |x-y| =2} Dec 12,13,14 -6M

Que 3 –Let A = {1 ,2,3,4} and let R and S be the relation on A described by


R= 0 0 0 1 S= 1 1 0 0
0000 0100 Use warshall’s algorithm to compute the
0100 0010 transitive closure of R ∪ S Dec 14,May 16 -6

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 f2​is 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​∘f1​is 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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy