SlideShare a Scribd company logo
1 of 25
Download to read offline
MATH301-
DISCRETE MATHEMATICS
Copyright © Nahid Sultana 2014-2015.
Dr. Nahid Sultana
Email: nszakir@ud.edu.sa
Chapter 2: Relations
10/10/2014
1
Topics
10/10/2014
2
 Product sets
 Relations
Inverse Relation,
Representing Relations Using Matrices
 Composition of Relations
 Types of Relations
 Reflexive and Irreflexive Relations
 Symmetric and Antisymmetric Relations
Transitive Relations
 Equivalence Relations
 Partial Ordering Relations
 Closure Properties
Copyright © Nahid Sultana 2014-2015.
Product sets
Definition: The ordered pair (x , y) is a single element consisting of
pair of elements in which
 x is the first element (coordinate)
 y is the second element (coordinate).
Definition: Two ordered pair (x , y) and (w , z) will be equal if
x = w and y = z.
Note:
 If {a, b} is a set, {a, b}= {b, a}
 If (a, b) is an ordered pair, then (a, b) ≠ (b, a)
10/10/2014
3
Copyright © Nahid Sultana 2014-2015.
Cartesian Product
10/10/2014
4
Definition: The Cartesian product of two sets A and B is the set of
all ordered pairs (a, b) with
Example: Let A = {x, y} and B = {1, 2}. Compute .
Copyright © Nahid Sultana 2014-2015.
Relations
10/10/2014
5
Definition: A Relation R from set A to set B is a subset of A × B.
 If (a , b) ∈ R, we say that “a is related to b", and write aRb.
 If (a , b) ∉ R, we say that “a is not related to b“, and write aRb.
 If A = B, we often say that R ∈ A × A is a relation on A.
Example: A = (1, 2, 3) and B = {x, y, z}, and let
R = {(1, y), (1, z), (3, y)}.
Then R is a relation from A to B ? . Yes--since R is a subset of A × B
With respect to this relation,
Copyright © Nahid Sultana 2014-2015.
Relations
Solution: Note that these relations are on an infinite set and each of
these relations is an infinite set. Checking the conditions that define
each relation, we see that
(1,1) is in R1, R3, R4 , and R6:
(1,2) is in R1 and R6:
(2,1) is in R2, R5, and R6:
(1, −1) is in R2, R3, and R6 :
(2,2) is in R1, R3, and R4.
Example: Consider these relations on the set of integers:
R1 = {(a,b) | a ≤ b}, R4 = {(a,b) | a = b},
R2 = {(a,b) | a > b}, R5 = {(a,b) | a = b + 1},
R3 = {(a,b) | a = b or a = −b}, R6 = {(a,b) | a + b ≤ 3}.
Which of these relations contain each of the pairs
(1,1), (1, 2), (2, 1), (1, −1), and (2, 2)?
10/10/2014
6
Copyright © Nahid Sultana 2014-2015.
Relations (Cont…)
10/10/2014
7
Definition: The domain of relation R is the set of all first elements of
the ordered pairs which belong to R, denoted by Dom(R).
Definition: The range is the set of second elements of the ordered
pairs which belong to R, denoted by Ran(R).
Example: A = (1, 2, 3) and B = {x, y, z}, and consider the relation
R = {(1, y), (1, z), (3, y)}.
Find the domain and range of R.
The domain of R is Dom(R) = {1, 3}
The range of R is Ran(R) = {y, z}
Copyright © Nahid Sultana 2014-2015.
Inverse Relations
10/10/2014
8
Definition: Let R be any relation from set A to B. The inverse of R,
denoted by R-1, is the relation from B to A denoted by
R-1 = {(b , a)|(a , b)∈ R}
Example: let A = {1, 2, 3} and B = {x, y, z}. Find the inverse of
R = {(1, y), (1 , z), (3 , y)}
Solution: R−1 = {(y , 1), (z , 1), (y , 3)}
 If R is any relation, then (R-1)-1 = R.
 The domain and range of R-1 are equal to the range and domain
of R, respectively.
 If R is a relation on A, then R-1 is also a relation on A.
Copyright © Nahid Sultana 2014-2015.
Representing Relations Using Matrices
 A relation between finite sets can be represented using a zero-one
matrix.
 Suppose R is a relation from A = {a1, a2, …, am} to B = {b1, b2, …,
bn}.
 The elements of the two sets can be listed in any particular
arbitrary order. When A = B, we use the same ordering.
 The relation R is represented by the matrix
MR = [mij], where
 The matrix representing R has a 1 as its (i,j) entry when ai is related
to bj and a 0 if ai is not related to bj.
10/10/2014
9
Copyright © Nahid Sultana 2014-2015.
Examples of Representing Relations
Using Matrices
Example 1: Suppose that A = {1,2,3} and B = {1,2}. Let R be the
relation from A to B containing (a,b) if a ∈ A, b ∈ B, and a > b.
What is the matrix representing R (assuming the ordering of
elements is the same as the increasing numerical order)?
Solution: Here R = {(2,1), (3,1),(3,2)}. The matrix representing R is
10/10/2014
10
Copyright © Nahid Sultana 2014-2015.
Examples of Representing Relations
Using Matrices (cont.)
Example 2: Let A = {a1,a2, a3} and B = {b1,b2, b3,b4, b5}.
Which ordered pairs are in the relation R represented by
the matrix
Solution: R = {(a1, b2), (a2, b1),(a2, b3), (a2, b4),(a3, b1), {(a3, b3), (a3, b5)}.
10/10/2014
11
Copyright © Nahid Sultana 2014-2015.
Composition of Relations
10/10/2014
12
Definition: Suppose A, B and C are sets, and
 R is a relation from A to B
 S is a relation from B to C
 Then the composition of R and S, denoted by R ∘ S, is a relation
from A to C defined by
R ∘ S = {(a , c)| ∃ b ∈ B, for which (a , b) ∈ R and (b , c) ∈ S}
Example: Let A = {1, 2, 3, 4}, B = {a, b, c, d}, C = {x, y, z} and let
R = {(1, a), (2, d), (3, a), (3, b), (3, d)}
and S = {(b, x), (b, z), (c, y), (d, z)}
Compute R ∘ S .
Using arrow diagram, R ◦ S={(2,z), (3,x), (3,z)}
Copyright © Nahid Sultana 2014-2015.
Composition of Relations (Cont…)
10/10/2014
13
Example: Let A = {1, 2, 3, 4}, B = {a, b, c, d}, C = {x, y, z} and let
R = {(1, a), (2, d), (3, a), (3, b), (3, d)}
and S = {(b, x), (b, z), (c, y), (d, z)}. Compute R ∘ S .
There is another way of finding R ◦ S.
Let MR and MS denote the matrix representations of the relations R
and S, respectively. Then
The nonzero entries in this matrix tell us which elements are related by
R◦S. Thus R ◦ S={(2,z), (3,x), (3,z)}
Multiplying MR and MS
Copyright © Nahid Sultana 2014-2015.
Types of relations
10/10/2014
14
Types of relations which are defined on a set A.
 Reflexive and Irreflexive Relations
 Symmetric and Antisymmetric Relations
 Transitive Relations
Definition: A relation R on a set A is reflexive if (a,a) ∈ R for all a ∈ A.
Thus R is not reflexive if there exists a ∈ A such that (a, a)∉ R.
Example: Consider the following relations on the set A = {1, 2, 3}:
R1 = {(1, 1)(1, 2), (2, 1), (2, 2), (3, 3)}
R2 = {(1, 1), (1, 2), (2, 1), (2, 2)}
R3 = Φ
Determine which relation is reflexive.
Copyright © Nahid Sultana 2014-2015.
Types of relations (Cont…)
10/10/2014
15
Example: The following relations on the integers are reflexive:
R1 = {(a,b) | a ≤ b},
R3 = {(a,b) | a = b or a = −b},
R4 = {(a,b) | a = b}.
The following relations are not reflexive:
R2 = {(a,b) | a > b} (note that 3 ≯ 3),
R5 = {(a,b) | a = b + 1} (note that 3 ≠3 + 1),
R6 = {(a,b) | a + b ≤ 3} (note that 4 + 4 ≰ 3).
Copyright © Nahid Sultana 2014-2015.
Types of relations (Cont…)
10/10/2014
16
Definition: A relation R on a set A is symmetric if whenever aRb
then bRa, i.e., if whenever (a, b) ∈ R then (b, a) ∈ R.
Thus R is not symmetric if there exists a, b ∈ A such that
(a, b) ∈ R but (b, a) ∉ R.
Example: Consider the following relations on the set A = {1, 2, 3}:
R1 = {(1, 1)(1, 2), (2, 1), (2, 2), (3, 3)}
R2 = {(1, 1), (1, 2), (2, 2)}
Determine which relation is symmetric.
Copyright © Nahid Sultana 2014-2015.
Types of relations (Cont…)
10/10/2014
17
Definition: A relation R on a set A is antisymmetric if whenever aRb
and bRa then a = b.
Example: Consider the following relations on the set A = {1, 2, 3}:
R1 = {(1, 1)(1, 2), (2, 1), (2, 2), (3, 3)}
R2 = {(1, 1), (1, 2)}
Determine which relation is antisymmetric.
The contrapositive of this definition is that R is antisymmetric if
whenever a ≠ b, then either (a,b) ∉ R or (b,a) ∉ R.
Definition: A relation R is not antisymmetric if there exist a, b ∈ A such
that (a,b)∈ R and (b, a) ∈ R but a ≠ b.
Note: Not symmetric ≠ antisymmetric .
Copyright © Nahid Sultana 2014-2015.
Types of relations (Cont…)
10/10/2014
18
Example: Consider the following relations on the set A = {1, 2, 3}:
R1 = {(1, 1), (1, 2), (2, 3), (1, 3)}
R2 = {(1, 1), (1, 2), (2,2), (2,3)}
R3 = {(1, 1), (1, 2), (1,3), (3,3)}
Determine which relation is transitive.
Definition: A relation R on a set A is transitive if whenever aRb and bRc
then aRc, that is, if whenever (a, b)∈R and (b, c)∈ R then (a, c)∈R.
Thus R is not transitive if there exist a, b, c ∈ R such that
(a,b)∈ R and (b, c) ∈ R but (a,c) ∉ R.
If such a, b and c not exist, then R is transitive.
Copyright © Nahid Sultana 2014-2015.
Equivalence relation
10/10/2014
19
Example: Consider the following relation on the set A = {1, 2, 3,4}:
R = {(1, 1), (1, 2), (2,1), (2,2), (3,4), (4,3), (3,3), (4, 4)}
Determine whether this relation is equivalence or not.
Definition: A relation R on a set A is called an equivalence
relation if R is reflexive, symmetric, and transitive.
 It follows three properties:
1) For every a ∈ A, aRa.
2) If aRb then bRa.
3) If aRb and bRc, then aRc.
The relation R is equivalence because R is reflexive, symmetric and
transitive.
Copyright © Nahid Sultana 2014-2015.
Equivalence relation (cont…)
10/10/2014
20
Example: Let A= ℤ, set of integers. Let R be defined by aRb
iff a ≤ b. Determine whether this relation is equivalence or not.
Therefore the relation R is not an equivalence.
Solution:
1) The relation R is reflexive a ≤ a.
2) The relation R is not symmetric a ≤ b does not imply that b ≤ a .
3) The relation R is transitive because a ≤ b and b ≤ c imply that a ≤ c.
Copyright © Nahid Sultana 2014-2015.
Equivalence relation (cont…)
10/10/2014
21
Example: Prove that congruence modulo n is an equivalence relation
on ℤ.
Definition: For a given positive integer n ≥ 2, two integers a and b
are called congruent modulo n, written as
a ≡ b(mod n)
if a - b is divisible by n.
Solution:
1) Reflexivity: For any a ∈ ℤ, we have a ≡ a(mod n) because a-
a=0 is divisible by n. Hence the relation is reflexive.
Cont to next slide…..
Copyright © Nahid Sultana 2014-2015.
Equivalence relation (cont…)
10/10/2014
22
2) Symmetry: suppose a ≡ b(mod n)
⇒ a-b is divisible by n ⇒ (a-b)/n = k , for some k ∈ℤ ⇒ a-b = nk .
Therefore, b-a = -(a-b) = -nk = n(-k)
⇒(b-a)/n = -k, so b-a is divisible by n as -k∈ℤ i.e. b ≡ a(mod n).
Thus the relation is symmetric.
3) Transitivity: suppose a ≡ b (mod n) and b ≡ c (mod n), then
(a-b)/n =k and (b-c)/n=l for some k,l∈ℤ. i.e. a-b=nk and b-c=nl.
By adding this two equations we get, a-c=n(k+l)⇒(a-c)/n=k+l.
So a-c is divisible by n as k+l ∈ℤ, i.e. a ≡ c(mod n).
Thus the relation is transitive.
Hence this is an equivalence relation on ℤ.
Copyright © Nahid Sultana 2014-2015.
Solution: Cont…..
Equivalence class (cont…)
10/10/2014
23
Definition: For an equivalence relation R defined on A and for
a∈ A, the set
[a] = {x ∈ A| (a, x) ∈R}
is called the equivalence class of a in A.
Definition: Any b ∈ [a] is called a representative of this equivalence
class.
Definition: The collection of all equivalence classes of elements of A
under an equivalence relation R is called the quotient set, denoted
by A/R, i.e.
A/R = {[a] | a ∈ A}.
Note: The quotient set A/R is a partition of A.
Copyright © Nahid Sultana 2014-2015.
Partial Orderings
10/10/2014
24
Definition : A relation R on a set S is called a partial ordering, or
partial order, if it is reflexive, antisymmetric, and transitive.
Definition: A set A together with a partial ordering R is called a
partially ordered set or poset.
Example: Show that the “greater than or equal” relation (≥) is a
partial ordering on the set of integers.
Solution:
Reflexivity: a ≥ a for every integer a.
Antisymmetry: If a ≥ b and b ≥ a , then a = b.
Transitivity: If a ≥ b and b ≥ c , then a ≥ c.
Copyright © Nahid Sultana 2014-2015.
Closure Properties
10/10/2014
25
 Suppose R is a relation on A
 If R does not possess a particular relation (reflexive, symmetric,
transitive)
 Then we may add as few new pairs as possible until we get
a new relation R1 on A that have that required property.
 If such R1 exists, we call it the closure of R with respect to that
property.
 Example: Reflexive closure, Symmetric closure, Transitive closure.
Copyright © Nahid Sultana 2014-2015.

More Related Content

What's hot

Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statements
guestd166eb5
 

What's hot (20)

Relations
RelationsRelations
Relations
 
Introductions to Relations
Introductions to RelationsIntroductions to Relations
Introductions to Relations
 
CMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing RelationsCMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing Relations
 
maths set
maths setmaths set
maths set
 
Relations
RelationsRelations
Relations
 
Equation of second degree
Equation of second degreeEquation of second degree
Equation of second degree
 
CMSC 56 | Lecture 15: Closures of Relations
CMSC 56 | Lecture 15: Closures of RelationsCMSC 56 | Lecture 15: Closures of Relations
CMSC 56 | Lecture 15: Closures of Relations
 
Riemann sumsdefiniteintegrals
Riemann sumsdefiniteintegralsRiemann sumsdefiniteintegrals
Riemann sumsdefiniteintegrals
 
Set theory
Set theory Set theory
Set theory
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relations
 
Module 4 circular function
Module 4   circular functionModule 4   circular function
Module 4 circular function
 
CMSC 56 | Lecture 16: Equivalence of Relations & Partial Ordering
CMSC 56 | Lecture 16: Equivalence of Relations & Partial OrderingCMSC 56 | Lecture 16: Equivalence of Relations & Partial Ordering
CMSC 56 | Lecture 16: Equivalence of Relations & Partial Ordering
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statements
 
Types of RELATIONS
Types of RELATIONSTypes of RELATIONS
Types of RELATIONS
 
Relations & functions
Relations & functionsRelations & functions
Relations & functions
 
Husqvarna brush cutters service repair manual
Husqvarna brush cutters service repair manualHusqvarna brush cutters service repair manual
Husqvarna brush cutters service repair manual
 
3.2 Power sets
3.2 Power sets3.2 Power sets
3.2 Power sets
 
Composition and inverse of functions
Composition  and inverse of functionsComposition  and inverse of functions
Composition and inverse of functions
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
 
RELASI & FUNGSI (Pertemuan 1 - Relasi)
RELASI & FUNGSI (Pertemuan 1 - Relasi)RELASI & FUNGSI (Pertemuan 1 - Relasi)
RELASI & FUNGSI (Pertemuan 1 - Relasi)
 

Similar to Relations

Discrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsDiscrete-Chapter 08 Relations
Discrete-Chapter 08 Relations
Wongyos Keardsri
 
Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1
RAHUL SINGH
 
Presentation2 vijayan pillai
Presentation2 vijayan pillaiPresentation2 vijayan pillai
Presentation2 vijayan pillai
unni2012
 

Similar to Relations (20)

Per5 relasi
Per5 relasiPer5 relasi
Per5 relasi
 
dm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptxdm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptx
 
CMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their PropertiesCMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their Properties
 
Relation in Discrete Mathematics
Relation in Discrete Mathematics Relation in Discrete Mathematics
Relation in Discrete Mathematics
 
Properties of relations
Properties of relationsProperties of relations
Properties of relations
 
Final relation1 m_tech(cse)
Final relation1 m_tech(cse)Final relation1 m_tech(cse)
Final relation1 m_tech(cse)
 
Final relation1 m_tech(cse)
Final relation1 m_tech(cse)Final relation1 m_tech(cse)
Final relation1 m_tech(cse)
 
Final relation1 m_tech(cse)
Final relation1 m_tech(cse)Final relation1 m_tech(cse)
Final relation1 m_tech(cse)
 
Discrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsDiscrete-Chapter 08 Relations
Discrete-Chapter 08 Relations
 
Relations between two sets
Relations between two setsRelations between two sets
Relations between two sets
 
Relations
RelationsRelations
Relations
 
Lemh101
Lemh101Lemh101
Lemh101
 
Sadat sumon
Sadat sumonSadat sumon
Sadat sumon
 
Inverse of Relations Presentation.pptx
Inverse of Relations   Presentation.pptxInverse of Relations   Presentation.pptx
Inverse of Relations Presentation.pptx
 
Introduction to The Relations in Mathematics.pptx
Introduction to The Relations in Mathematics.pptxIntroduction to The Relations in Mathematics.pptx
Introduction to The Relations in Mathematics.pptx
 
Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1
 
Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
 
Relations and Its Applications
Relations and Its ApplicationsRelations and Its Applications
Relations and Its Applications
 
Presentation2 vijayan pillai
Presentation2 vijayan pillaiPresentation2 vijayan pillai
Presentation2 vijayan pillai
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

Relations

  • 1. MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana 2014-2015. Dr. Nahid Sultana Email: nszakir@ud.edu.sa Chapter 2: Relations 10/10/2014 1
  • 2. Topics 10/10/2014 2  Product sets  Relations Inverse Relation, Representing Relations Using Matrices  Composition of Relations  Types of Relations  Reflexive and Irreflexive Relations  Symmetric and Antisymmetric Relations Transitive Relations  Equivalence Relations  Partial Ordering Relations  Closure Properties Copyright © Nahid Sultana 2014-2015.
  • 3. Product sets Definition: The ordered pair (x , y) is a single element consisting of pair of elements in which  x is the first element (coordinate)  y is the second element (coordinate). Definition: Two ordered pair (x , y) and (w , z) will be equal if x = w and y = z. Note:  If {a, b} is a set, {a, b}= {b, a}  If (a, b) is an ordered pair, then (a, b) ≠ (b, a) 10/10/2014 3 Copyright © Nahid Sultana 2014-2015.
  • 4. Cartesian Product 10/10/2014 4 Definition: The Cartesian product of two sets A and B is the set of all ordered pairs (a, b) with Example: Let A = {x, y} and B = {1, 2}. Compute . Copyright © Nahid Sultana 2014-2015.
  • 5. Relations 10/10/2014 5 Definition: A Relation R from set A to set B is a subset of A × B.  If (a , b) ∈ R, we say that “a is related to b", and write aRb.  If (a , b) ∉ R, we say that “a is not related to b“, and write aRb.  If A = B, we often say that R ∈ A × A is a relation on A. Example: A = (1, 2, 3) and B = {x, y, z}, and let R = {(1, y), (1, z), (3, y)}. Then R is a relation from A to B ? . Yes--since R is a subset of A × B With respect to this relation, Copyright © Nahid Sultana 2014-2015.
  • 6. Relations Solution: Note that these relations are on an infinite set and each of these relations is an infinite set. Checking the conditions that define each relation, we see that (1,1) is in R1, R3, R4 , and R6: (1,2) is in R1 and R6: (2,1) is in R2, R5, and R6: (1, −1) is in R2, R3, and R6 : (2,2) is in R1, R3, and R4. Example: Consider these relations on the set of integers: R1 = {(a,b) | a ≤ b}, R4 = {(a,b) | a = b}, R2 = {(a,b) | a > b}, R5 = {(a,b) | a = b + 1}, R3 = {(a,b) | a = b or a = −b}, R6 = {(a,b) | a + b ≤ 3}. Which of these relations contain each of the pairs (1,1), (1, 2), (2, 1), (1, −1), and (2, 2)? 10/10/2014 6 Copyright © Nahid Sultana 2014-2015.
  • 7. Relations (Cont…) 10/10/2014 7 Definition: The domain of relation R is the set of all first elements of the ordered pairs which belong to R, denoted by Dom(R). Definition: The range is the set of second elements of the ordered pairs which belong to R, denoted by Ran(R). Example: A = (1, 2, 3) and B = {x, y, z}, and consider the relation R = {(1, y), (1, z), (3, y)}. Find the domain and range of R. The domain of R is Dom(R) = {1, 3} The range of R is Ran(R) = {y, z} Copyright © Nahid Sultana 2014-2015.
  • 8. Inverse Relations 10/10/2014 8 Definition: Let R be any relation from set A to B. The inverse of R, denoted by R-1, is the relation from B to A denoted by R-1 = {(b , a)|(a , b)∈ R} Example: let A = {1, 2, 3} and B = {x, y, z}. Find the inverse of R = {(1, y), (1 , z), (3 , y)} Solution: R−1 = {(y , 1), (z , 1), (y , 3)}  If R is any relation, then (R-1)-1 = R.  The domain and range of R-1 are equal to the range and domain of R, respectively.  If R is a relation on A, then R-1 is also a relation on A. Copyright © Nahid Sultana 2014-2015.
  • 9. Representing Relations Using Matrices  A relation between finite sets can be represented using a zero-one matrix.  Suppose R is a relation from A = {a1, a2, …, am} to B = {b1, b2, …, bn}.  The elements of the two sets can be listed in any particular arbitrary order. When A = B, we use the same ordering.  The relation R is represented by the matrix MR = [mij], where  The matrix representing R has a 1 as its (i,j) entry when ai is related to bj and a 0 if ai is not related to bj. 10/10/2014 9 Copyright © Nahid Sultana 2014-2015.
  • 10. Examples of Representing Relations Using Matrices Example 1: Suppose that A = {1,2,3} and B = {1,2}. Let R be the relation from A to B containing (a,b) if a ∈ A, b ∈ B, and a > b. What is the matrix representing R (assuming the ordering of elements is the same as the increasing numerical order)? Solution: Here R = {(2,1), (3,1),(3,2)}. The matrix representing R is 10/10/2014 10 Copyright © Nahid Sultana 2014-2015.
  • 11. Examples of Representing Relations Using Matrices (cont.) Example 2: Let A = {a1,a2, a3} and B = {b1,b2, b3,b4, b5}. Which ordered pairs are in the relation R represented by the matrix Solution: R = {(a1, b2), (a2, b1),(a2, b3), (a2, b4),(a3, b1), {(a3, b3), (a3, b5)}. 10/10/2014 11 Copyright © Nahid Sultana 2014-2015.
  • 12. Composition of Relations 10/10/2014 12 Definition: Suppose A, B and C are sets, and  R is a relation from A to B  S is a relation from B to C  Then the composition of R and S, denoted by R ∘ S, is a relation from A to C defined by R ∘ S = {(a , c)| ∃ b ∈ B, for which (a , b) ∈ R and (b , c) ∈ S} Example: Let A = {1, 2, 3, 4}, B = {a, b, c, d}, C = {x, y, z} and let R = {(1, a), (2, d), (3, a), (3, b), (3, d)} and S = {(b, x), (b, z), (c, y), (d, z)} Compute R ∘ S . Using arrow diagram, R ◦ S={(2,z), (3,x), (3,z)} Copyright © Nahid Sultana 2014-2015.
  • 13. Composition of Relations (Cont…) 10/10/2014 13 Example: Let A = {1, 2, 3, 4}, B = {a, b, c, d}, C = {x, y, z} and let R = {(1, a), (2, d), (3, a), (3, b), (3, d)} and S = {(b, x), (b, z), (c, y), (d, z)}. Compute R ∘ S . There is another way of finding R ◦ S. Let MR and MS denote the matrix representations of the relations R and S, respectively. Then The nonzero entries in this matrix tell us which elements are related by R◦S. Thus R ◦ S={(2,z), (3,x), (3,z)} Multiplying MR and MS Copyright © Nahid Sultana 2014-2015.
  • 14. Types of relations 10/10/2014 14 Types of relations which are defined on a set A.  Reflexive and Irreflexive Relations  Symmetric and Antisymmetric Relations  Transitive Relations Definition: A relation R on a set A is reflexive if (a,a) ∈ R for all a ∈ A. Thus R is not reflexive if there exists a ∈ A such that (a, a)∉ R. Example: Consider the following relations on the set A = {1, 2, 3}: R1 = {(1, 1)(1, 2), (2, 1), (2, 2), (3, 3)} R2 = {(1, 1), (1, 2), (2, 1), (2, 2)} R3 = Φ Determine which relation is reflexive. Copyright © Nahid Sultana 2014-2015.
  • 15. Types of relations (Cont…) 10/10/2014 15 Example: The following relations on the integers are reflexive: R1 = {(a,b) | a ≤ b}, R3 = {(a,b) | a = b or a = −b}, R4 = {(a,b) | a = b}. The following relations are not reflexive: R2 = {(a,b) | a > b} (note that 3 ≯ 3), R5 = {(a,b) | a = b + 1} (note that 3 ≠3 + 1), R6 = {(a,b) | a + b ≤ 3} (note that 4 + 4 ≰ 3). Copyright © Nahid Sultana 2014-2015.
  • 16. Types of relations (Cont…) 10/10/2014 16 Definition: A relation R on a set A is symmetric if whenever aRb then bRa, i.e., if whenever (a, b) ∈ R then (b, a) ∈ R. Thus R is not symmetric if there exists a, b ∈ A such that (a, b) ∈ R but (b, a) ∉ R. Example: Consider the following relations on the set A = {1, 2, 3}: R1 = {(1, 1)(1, 2), (2, 1), (2, 2), (3, 3)} R2 = {(1, 1), (1, 2), (2, 2)} Determine which relation is symmetric. Copyright © Nahid Sultana 2014-2015.
  • 17. Types of relations (Cont…) 10/10/2014 17 Definition: A relation R on a set A is antisymmetric if whenever aRb and bRa then a = b. Example: Consider the following relations on the set A = {1, 2, 3}: R1 = {(1, 1)(1, 2), (2, 1), (2, 2), (3, 3)} R2 = {(1, 1), (1, 2)} Determine which relation is antisymmetric. The contrapositive of this definition is that R is antisymmetric if whenever a ≠ b, then either (a,b) ∉ R or (b,a) ∉ R. Definition: A relation R is not antisymmetric if there exist a, b ∈ A such that (a,b)∈ R and (b, a) ∈ R but a ≠ b. Note: Not symmetric ≠ antisymmetric . Copyright © Nahid Sultana 2014-2015.
  • 18. Types of relations (Cont…) 10/10/2014 18 Example: Consider the following relations on the set A = {1, 2, 3}: R1 = {(1, 1), (1, 2), (2, 3), (1, 3)} R2 = {(1, 1), (1, 2), (2,2), (2,3)} R3 = {(1, 1), (1, 2), (1,3), (3,3)} Determine which relation is transitive. Definition: A relation R on a set A is transitive if whenever aRb and bRc then aRc, that is, if whenever (a, b)∈R and (b, c)∈ R then (a, c)∈R. Thus R is not transitive if there exist a, b, c ∈ R such that (a,b)∈ R and (b, c) ∈ R but (a,c) ∉ R. If such a, b and c not exist, then R is transitive. Copyright © Nahid Sultana 2014-2015.
  • 19. Equivalence relation 10/10/2014 19 Example: Consider the following relation on the set A = {1, 2, 3,4}: R = {(1, 1), (1, 2), (2,1), (2,2), (3,4), (4,3), (3,3), (4, 4)} Determine whether this relation is equivalence or not. Definition: A relation R on a set A is called an equivalence relation if R is reflexive, symmetric, and transitive.  It follows three properties: 1) For every a ∈ A, aRa. 2) If aRb then bRa. 3) If aRb and bRc, then aRc. The relation R is equivalence because R is reflexive, symmetric and transitive. Copyright © Nahid Sultana 2014-2015.
  • 20. Equivalence relation (cont…) 10/10/2014 20 Example: Let A= ℤ, set of integers. Let R be defined by aRb iff a ≤ b. Determine whether this relation is equivalence or not. Therefore the relation R is not an equivalence. Solution: 1) The relation R is reflexive a ≤ a. 2) The relation R is not symmetric a ≤ b does not imply that b ≤ a . 3) The relation R is transitive because a ≤ b and b ≤ c imply that a ≤ c. Copyright © Nahid Sultana 2014-2015.
  • 21. Equivalence relation (cont…) 10/10/2014 21 Example: Prove that congruence modulo n is an equivalence relation on ℤ. Definition: For a given positive integer n ≥ 2, two integers a and b are called congruent modulo n, written as a ≡ b(mod n) if a - b is divisible by n. Solution: 1) Reflexivity: For any a ∈ ℤ, we have a ≡ a(mod n) because a- a=0 is divisible by n. Hence the relation is reflexive. Cont to next slide….. Copyright © Nahid Sultana 2014-2015.
  • 22. Equivalence relation (cont…) 10/10/2014 22 2) Symmetry: suppose a ≡ b(mod n) ⇒ a-b is divisible by n ⇒ (a-b)/n = k , for some k ∈ℤ ⇒ a-b = nk . Therefore, b-a = -(a-b) = -nk = n(-k) ⇒(b-a)/n = -k, so b-a is divisible by n as -k∈ℤ i.e. b ≡ a(mod n). Thus the relation is symmetric. 3) Transitivity: suppose a ≡ b (mod n) and b ≡ c (mod n), then (a-b)/n =k and (b-c)/n=l for some k,l∈ℤ. i.e. a-b=nk and b-c=nl. By adding this two equations we get, a-c=n(k+l)⇒(a-c)/n=k+l. So a-c is divisible by n as k+l ∈ℤ, i.e. a ≡ c(mod n). Thus the relation is transitive. Hence this is an equivalence relation on ℤ. Copyright © Nahid Sultana 2014-2015. Solution: Cont…..
  • 23. Equivalence class (cont…) 10/10/2014 23 Definition: For an equivalence relation R defined on A and for a∈ A, the set [a] = {x ∈ A| (a, x) ∈R} is called the equivalence class of a in A. Definition: Any b ∈ [a] is called a representative of this equivalence class. Definition: The collection of all equivalence classes of elements of A under an equivalence relation R is called the quotient set, denoted by A/R, i.e. A/R = {[a] | a ∈ A}. Note: The quotient set A/R is a partition of A. Copyright © Nahid Sultana 2014-2015.
  • 24. Partial Orderings 10/10/2014 24 Definition : A relation R on a set S is called a partial ordering, or partial order, if it is reflexive, antisymmetric, and transitive. Definition: A set A together with a partial ordering R is called a partially ordered set or poset. Example: Show that the “greater than or equal” relation (≥) is a partial ordering on the set of integers. Solution: Reflexivity: a ≥ a for every integer a. Antisymmetry: If a ≥ b and b ≥ a , then a = b. Transitivity: If a ≥ b and b ≥ c , then a ≥ c. Copyright © Nahid Sultana 2014-2015.
  • 25. Closure Properties 10/10/2014 25  Suppose R is a relation on A  If R does not possess a particular relation (reflexive, symmetric, transitive)  Then we may add as few new pairs as possible until we get a new relation R1 on A that have that required property.  If such R1 exists, we call it the closure of R with respect to that property.  Example: Reflexive closure, Symmetric closure, Transitive closure. Copyright © Nahid Sultana 2014-2015.