0% found this document useful (0 votes)
5 views

Chap02 Rel& Func

Uploaded by

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

Chap02 Rel& Func

Uploaded by

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

Chapter # 4

Relations and
Functions
Relation
A binary relation is a collection of
ordered pairs from a to AB.
 Given two sets A and B its cross
product can be defined as

AB={(a, b)/aεA and bεB}


Example
 A = {1, 2, 3}
 B = {a, b}
 AB={(1,a),(1,b),(2,a),(2,b),(3,a),
(3,b)}
Then following are the few relation from
AB
R1={(1, a),(1, b)}
If there are n1 elemnts in set A and n2 elements in s
there willR2be
={(2,a)}
n1* n2 elements in AB &
there will be 2 n1* n2 relations in AB including {}and
Applications of
relations
 In the study of Data Bases
 In the study of State diagrams
 In the study of Automata Theory
 Conditions evaluation in
Programming Languages.
Representing
Relations
1. Listing the elements
2. Graphically
3. Pictorially
4. Relation matrix
5. Directed graphs/digraphs
1. Listing the elements
A = {1, 2, 3}
 B = {a, b}
 AB={(1,a),(1,b),(2,a),(2,b),
(3,a),(3,b)}

Then following are the few


relation from AB
R1={(1, a),(2, b),(3, b)}
2. Graphically
R1={(1, a),(2, b),(3, b)}

1 2 3
3. Pictorially
R1={(1, a),(2, b),(3, b)}

1 a
2
b
3
4. Relation Matrix
R1={(1, a),(2, b),(3, b)}

a b
1 1 0
2 0 1
3 0 1
5. Directed Graph/digraph
R1 ={(1, a),(2, a),(2, b),(3, b)}

1 3
a
Activity -1
A = {1,2,3,4}

R= {(1,1),(1,3),(2,1),(2,3),
(2,4),(3,1) ,(3, 2),(4, 1)}

Represent the given relation by


the other methods you have studie
Activity-2

a3 a4

a1 a2
Represent the given graph by
the other methods you have studie
Properties of relations
 Relations are classified
according to their properties.
There are three properties of
relations.

i. Reflexive property
ii. Symmetric property
iii. Transitive property
I. Reflexive Property
A relation is said to be
reflexive if for every aεA
(a, a) ε R
The relation is reflexive if
and only if an element is
related to itself
Example Reflexive
Property
A = {1, 2, 3}
 R = {(1,1),(1,2),(1,3),(2,2),(2,3),
(3,3)}
R is reflexive.

Let we have
R = {(1,1),(1,2),(1,3),(2,3),(3,3)}
Is not reflexive since (2,2) is not
included in the relation R
I. Symmetric Property
A relation is said to be symmetric if
for every
(a, b)εR (b, a) ε R
 The relation is reflexive if one
element is related with the second
element and the second element is
related with the first element.
Example…………………
Symmetric
A = {1, 2, 3}
 R = {(1,2),(1,3),(2,1),(2,3),(3,1)(3,2)}

R is symmetric.

Let we have
R = {((1,2),(1,3),(2,1),(2,3),(3,2)}
Is not symmetric since (1, 3) is there
but (3,1) is not included in the
relation R
Iii. Transitive Property
A relation is said to be transitive if
for every (a, b) (b, c)εR (a, c) ε R
 The relation is transitive if one
element is related with the second
element which is related with the
third and the first element is
related with the third.
Example…………………
Transitive
 A = {1, 2, 3}
 R = {(2,1),(3, 1),(3,2),(4,1),(4,2),(4,3)}

R is transitive.
(3,2)(2,1)……………..(3,1)
(4,2)(2,1)……………..(4,1)
Let we have A = {a, b, c}
R = {((a, b), (c, b), (b, a), (a, c)}
Is not transitive since (c, b) and (b, a) are
there but (c ,a) is not included
Equivalence relation
A relation is said to be
equivalence if
It is Symmetric
It is Reflexive
It is Transitive
 X = {1,2,3,4,5,6}
 R = {(1,1),(1,3),(1,5),(3,1),(3,3),(3,5),
(5,1),(5,3),(5,5),(2,2),(2,6),(6,2),(6,6),
(4,4)}

You might also like