SlideShare a Scribd company logo
Fall 2002 CMSC 203 - Discrete Structures 1
You Never Escape Your…You Never Escape Your…
RelationsRelations
Fall 2002 CMSC 203 - Discrete Structures 2
RelationsRelations
If we want to describe a relationship betweenIf we want to describe a relationship between
elements of two sets A and B, we can useelements of two sets A and B, we can use orderedordered
pairspairs with their first element taken from A andwith their first element taken from A and
their second element taken from B.their second element taken from B.
Since this is a relation betweenSince this is a relation between two setstwo sets, it is, it is
called acalled a binary relationbinary relation..
Definition:Definition: Let A and B be sets. A binary relationLet A and B be sets. A binary relation
from A to B is a subset of Afrom A to B is a subset of A××B.B.
In other words, for a binary relation R we haveIn other words, for a binary relation R we have
RR ⊆⊆ AA××B. We use the notation aRb to denote thatB. We use the notation aRb to denote that
(a, b)(a, b)∈∈R and aR and aRb to denote that (a, b)b to denote that (a, b)∉∉R.R.
Fall 2002 CMSC 203 - Discrete Structures 3
RelationsRelations
When (a, b) belongs to R, a is said to beWhen (a, b) belongs to R, a is said to be relatedrelated toto
b by R.b by R.
Example:Example: Let P be a set of people, C be a set ofLet P be a set of people, C be a set of
cars, and D be the relation describing which personcars, and D be the relation describing which person
drives which car(s).drives which car(s).
P = {Carl, Suzanne, Peter, Carla},P = {Carl, Suzanne, Peter, Carla},
C = {Mercedes, BMW, tricycle}C = {Mercedes, BMW, tricycle}
D = {(Carl, Mercedes), (Suzanne, Mercedes),D = {(Carl, Mercedes), (Suzanne, Mercedes),
(Suzanne, BMW), (Peter, tricycle)}(Suzanne, BMW), (Peter, tricycle)}
This means that Carl drives a Mercedes, SuzanneThis means that Carl drives a Mercedes, Suzanne
drives a Mercedes and a BMW, Peter drives adrives a Mercedes and a BMW, Peter drives a
tricycle, and Carla does not drive any of thesetricycle, and Carla does not drive any of these
vehicles.vehicles.
Fall 2002 CMSC 203 - Discrete Structures 4
Relations on a SetRelations on a Set
Definition:Definition: A relation on the set A is a relationA relation on the set A is a relation
from A to A.from A to A.
In other words, a relation on the set A is a subsetIn other words, a relation on the set A is a subset
of Aof A××A.A.
Example:Example: Let A = {1, 2, 3, 4}. Which ordered pairsLet A = {1, 2, 3, 4}. Which ordered pairs
are in the relation R = {(a, b) | a < b} ?are in the relation R = {(a, b) | a < b} ?
Fall 2002 CMSC 203 - Discrete Structures 5
Relations on a SetRelations on a Set
Solution:Solution: R = {R = {(1, 2),(1, 2), (1, 3),(1, 3), (1, 4),(1, 4), (2, 3),(2, 3),(2, 4),(2, 4),(3, 4)}(3, 4)}
RR 11 22 33 44
11
22
33
44
11 11
22
33
44
22
33
44
XX XX XX
XX XX
XX
Fall 2002 CMSC 203 - Discrete Structures 6
Properties of RelationsProperties of Relations
We will now look at some useful ways to classifyWe will now look at some useful ways to classify
relations.relations.
Definition:Definition: A relation R on a set A is calledA relation R on a set A is called
reflexivereflexive if (a, a)if (a, a)∈∈R for every element aR for every element a∈∈A.A.
Are the following relations on {1, 2, 3, 4} reflexive?Are the following relations on {1, 2, 3, 4} reflexive?
R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)} No.No.
R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)} Yes.Yes.
R = {(1, 1), (2, 2), (3, 3)}R = {(1, 1), (2, 2), (3, 3)} No.No.
Definition:Definition: A relation on a set A is calledA relation on a set A is called
irreflexiveirreflexive if (a, a)if (a, a)∉∉R for every element aR for every element a∈∈A.A.
Fall 2002 CMSC 203 - Discrete Structures 7
Properties of RelationsProperties of Relations
Definitions:Definitions:
A relation R on a set A is calledA relation R on a set A is called symmetricsymmetric if (b,if (b,
a)a)∈∈R whenever (a, b)R whenever (a, b)∈∈R for all a, bR for all a, b∈∈A.A.
A relation R on a set A is calledA relation R on a set A is called antisymmetricantisymmetric ifif
a = b whenever (a, b)a = b whenever (a, b)∈∈R and (b, a)R and (b, a)∈∈R.R.
A relation R on a set A is calledA relation R on a set A is called asymmetricasymmetric ifif
(a, b)(a, b)∈∈R implies that (b, a)R implies that (b, a)∉∉R for all a, bR for all a, b∈∈A.A.
Fall 2002 CMSC 203 - Discrete Structures 8
Properties of RelationsProperties of Relations
Are the following relations on {1, 2, 3, 4}Are the following relations on {1, 2, 3, 4}
symmetric, antisymmetric?symmetric, antisymmetric?
R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)} symmetricsymmetric
R = {(1, 1)}R = {(1, 1)} Sym. and antisym.Sym. and antisym.
R = {(1, 3), (3, 2), (2, 1)}R = {(1, 3), (3, 2), (2, 1)}
R = {(4, 4), (3, 3), (1, 4)}R = {(4, 4), (3, 3), (1, 4)}
antisym.antisym.
antisym.antisym.
Fall 2002 CMSC 203 - Discrete Structures 9
Properties of RelationsProperties of Relations
Definition:Definition: A relation R on a set A is calledA relation R on a set A is called
transitivetransitive if whenever (a, b)if whenever (a, b)∈∈R and (b, c)R and (b, c)∈∈R, thenR, then
(a, c)(a, c)∈∈R for a, b, cR for a, b, c∈∈A.A.
Are the following relations on {1, 2, 3, 4}Are the following relations on {1, 2, 3, 4}
transitive?transitive?
R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)}R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)} Yes.Yes.
R = {(1, 3), (3, 2), (2, 1)}R = {(1, 3), (3, 2), (2, 1)} No.No.
R = {(2, 4), (4, 3), (2, 3), (4, 1)}R = {(2, 4), (4, 3), (2, 3), (4, 1)} No.No.
Fall 2002 CMSC 203 - Discrete Structures 10
Representing RelationsRepresenting Relations
Example:Example: How can we represent the relationHow can we represent the relation
R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?
Solution:Solution: The matrix MThe matrix MRR is given byis given by










=
11
01
00
RM
Fall 2002 CMSC 203 - Discrete Structures 11
Representing RelationsRepresenting Relations
What do we know about the matrices representingWhat do we know about the matrices representing
aa relation on a setrelation on a set (a relation from A to A) ?(a relation from A to A) ?
They areThey are squaresquare matrices.matrices.
What do we know about matrices representingWhat do we know about matrices representing
reflexivereflexive relations?relations?
All the elements on theAll the elements on the diagonaldiagonal of such matricesof such matrices
MMrefref must bemust be 1s1s..




















=
1
.
.
.
1
1
refM
Fall 2002 CMSC 203 - Discrete Structures 12
Representing RelationsRepresenting Relations
What do we know about the matrices representingWhat do we know about the matrices representing
symmetric relationssymmetric relations??
These matrices are symmetric, that is, MThese matrices are symmetric, that is, MRR = (M= (MRR))tt
..












=
1101
1001
0010
1101
RM
symmetric matrix,symmetric matrix,
symmetric relation.symmetric relation.












=
0011
0011
0011
0011
RM
non-symmetric matrix,non-symmetric matrix,
non-symmetric relation.non-symmetric relation.
Fall 2002 CMSC 203 - Discrete Structures 13
Representing RelationsRepresenting Relations
The Boolean operationsThe Boolean operations joinjoin andand meetmeet (you(you
remember?)remember?) can be used to determine the matricescan be used to determine the matrices
representing therepresenting the unionunion and theand the intersectionintersection of twoof two
relations, respectively.relations, respectively.
To obtain theTo obtain the joinjoin of two zero-one matrices, weof two zero-one matrices, we
apply the Boolean “or” function to all correspondingapply the Boolean “or” function to all corresponding
elements in the matrices.elements in the matrices.
To obtain theTo obtain the meetmeet of two zero-one matrices, weof two zero-one matrices, we
apply the Boolean “and” function to all correspondingapply the Boolean “and” function to all corresponding
elements in the matrices.elements in the matrices.
14
Representing Relations Using MatricesRepresenting Relations Using Matrices
Example:Example: How can we represent the relationHow can we represent the relation
R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?
Solution:Solution: The matrix MThe matrix MRR is given byis given by










=
11
01
00
RM
Fall 2002 CMSC 203 - Discrete Structures 15
Representing Relations Using MatricesRepresenting Relations Using Matrices
Example:Example: Let the relations R and S be representedLet the relations R and S be represented
by the matricesby the matrices










=∨=∪
011
111
101
SRSR MMM










=
001
110
101
SM
What are the matrices representing RWhat are the matrices representing R∪∪S and RS and R∩∩S?S?
Solution:Solution: These matrices are given byThese matrices are given by










=∧=∩
000
000
101
SRSR MMM










=
010
001
101
RM

More Related Content

What's hot

Relations
RelationsRelations
Functions
FunctionsFunctions
Functions
Ankit Bhandari
 
Relations and functions
Relations and functions Relations and functions
Relations and functions
Seyid Kadher
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
Heather Scott
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
University of Potsdam
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
rey castro
 
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
allyn joy calcaben
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
SURBHI SAROHA
 
1551 limits and continuity
1551 limits and continuity1551 limits and continuity
1551 limits and continuity
Dr Fereidoun Dejahang
 
Ideals and factor rings
Ideals and factor ringsIdeals and factor rings
Ideals and factor rings
dianageorge27
 
Limits, Continuity & Differentiation (Theory)
Limits, Continuity & Differentiation (Theory)Limits, Continuity & Differentiation (Theory)
Limits, Continuity & Differentiation (Theory)
Eduron e-Learning Private Limited
 
Group homomorphism
Group homomorphismGroup homomorphism
Group homomorphism
NaliniSPatil
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graph
Rounak Biswas
 
Infinite sequence and series
Infinite sequence and seriesInfinite sequence and series
Infinite sequence and series
Bhavik A Shah
 
7 functions
7   functions7   functions
7 functions
KathManarang
 
CMSC 56 | Lecture 11: Mathematical Induction
CMSC 56 | Lecture 11: Mathematical InductionCMSC 56 | Lecture 11: Mathematical Induction
CMSC 56 | Lecture 11: Mathematical Induction
allyn joy calcaben
 
Different types of functions
Different types of functionsDifferent types of functions
Different types of functions
Katrina Young
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Ratnakar Mikkili
 
Lesson 11: Limits and Continuity
Lesson 11: Limits and ContinuityLesson 11: Limits and Continuity
Lesson 11: Limits and Continuity
Matthew Leingang
 
Limit and continuity (2)
Limit and continuity (2)Limit and continuity (2)
Limit and continuity (2)
Digvijaysinh Gohil
 

What's hot (20)

Relations
RelationsRelations
Relations
 
Functions
FunctionsFunctions
Functions
 
Relations and functions
Relations and functions Relations and functions
Relations and functions
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
 
Discrete mathematics
Discrete mathematicsDiscrete mathematics
Discrete mathematics
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
 
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
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
 
1551 limits and continuity
1551 limits and continuity1551 limits and continuity
1551 limits and continuity
 
Ideals and factor rings
Ideals and factor ringsIdeals and factor rings
Ideals and factor rings
 
Limits, Continuity & Differentiation (Theory)
Limits, Continuity & Differentiation (Theory)Limits, Continuity & Differentiation (Theory)
Limits, Continuity & Differentiation (Theory)
 
Group homomorphism
Group homomorphismGroup homomorphism
Group homomorphism
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graph
 
Infinite sequence and series
Infinite sequence and seriesInfinite sequence and series
Infinite sequence and series
 
7 functions
7   functions7   functions
7 functions
 
CMSC 56 | Lecture 11: Mathematical Induction
CMSC 56 | Lecture 11: Mathematical InductionCMSC 56 | Lecture 11: Mathematical Induction
CMSC 56 | Lecture 11: Mathematical Induction
 
Different types of functions
Different types of functionsDifferent types of functions
Different types of functions
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Lesson 11: Limits and Continuity
Lesson 11: Limits and ContinuityLesson 11: Limits and Continuity
Lesson 11: Limits and Continuity
 
Limit and continuity (2)
Limit and continuity (2)Limit and continuity (2)
Limit and continuity (2)
 

Similar to Relations

Sadat sumon
Sadat sumonSadat sumon
Sadat sumon
sadatsumon
 
Per5 relasi
Per5 relasiPer5 relasi
Relation in Discrete Mathematics
Relation in Discrete Mathematics Relation in Discrete Mathematics
Relation in Discrete Mathematics
NANDINI SHARMA
 
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
allyn joy calcaben
 
Discrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsDiscrete-Chapter 08 Relations
Discrete-Chapter 08 Relations
Wongyos Keardsri
 
Relations
RelationsRelations
Relations
PJS KUMAR
 
dm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdfdm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdf
SanjanaAdri
 
Final relation1 m_tech(cse)
Final relation1 m_tech(cse)Final relation1 m_tech(cse)
Final relation1 m_tech(cse)
Himanshu Dua
 
Final relation1 m_tech(cse)
Final relation1 m_tech(cse)Final relation1 m_tech(cse)
Final relation1 m_tech(cse)
Himanshu Dua
 
Final relation1 m_tech(cse)
Final relation1 m_tech(cse)Final relation1 m_tech(cse)
Final relation1 m_tech(cse)
Himanshu Dua
 
dm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptxdm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptx
RockyIslam5
 
Relations
RelationsRelations
Relations
Shiwani Gupta
 
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
 
CMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing RelationsCMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing Relations
allyn joy calcaben
 
Lemh101
Lemh101Lemh101
Relations and functions
Relations and functionsRelations and functions
Relations and functions
Vishwakarma Nutan Prakash
 
Inverse of Relations Presentation.pptx
Inverse of Relations   Presentation.pptxInverse of Relations   Presentation.pptx
Inverse of Relations Presentation.pptx
MuhammadArishImran
 
Relations
RelationsRelations
Relations
Niliha
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
Barnali Banerjee
 
Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )
OliverBaltazar2
 

Similar to Relations (20)

Sadat sumon
Sadat sumonSadat sumon
Sadat sumon
 
Per5 relasi
Per5 relasiPer5 relasi
Per5 relasi
 
Relation in Discrete Mathematics
Relation in Discrete Mathematics Relation in Discrete Mathematics
Relation in Discrete Mathematics
 
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
 
Discrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsDiscrete-Chapter 08 Relations
Discrete-Chapter 08 Relations
 
Relations
RelationsRelations
Relations
 
dm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdfdm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdf
 
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)
 
dm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptxdm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptx
 
Relations
RelationsRelations
Relations
 
Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1
 
CMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing RelationsCMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing Relations
 
Lemh101
Lemh101Lemh101
Lemh101
 
Relations and functions
Relations and functionsRelations and functions
Relations and functions
 
Inverse of Relations Presentation.pptx
Inverse of Relations   Presentation.pptxInverse of Relations   Presentation.pptx
Inverse of Relations Presentation.pptx
 
Relations
RelationsRelations
Relations
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
 
Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )
 

More from Ali Saleem

Trees
TreesTrees
Trees
Ali Saleem
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiers
Ali Saleem
 
Graphs
GraphsGraphs
Graphs
Ali Saleem
 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summations
Ali Saleem
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiers
Ali Saleem
 
Writing a memo, letter, and e mail
Writing a memo, letter, and e mailWriting a memo, letter, and e mail
Writing a memo, letter, and e mail
Ali Saleem
 
Challenges for the newborn state
Challenges for the newborn  stateChallenges for the newborn  state
Challenges for the newborn state
Ali Saleem
 
Objectives or goals of technical communication
Objectives or goals of technical communicationObjectives or goals of technical communication
Objectives or goals of technical communication
Ali Saleem
 
17 using rules of inference to build arguments
17   using rules of inference to build arguments17   using rules of inference to build arguments
17 using rules of inference to build arguments
Ali Saleem
 

More from Ali Saleem (9)

Trees
TreesTrees
Trees
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiers
 
Graphs
GraphsGraphs
Graphs
 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summations
 
Nested quantifiers
Nested quantifiersNested quantifiers
Nested quantifiers
 
Writing a memo, letter, and e mail
Writing a memo, letter, and e mailWriting a memo, letter, and e mail
Writing a memo, letter, and e mail
 
Challenges for the newborn state
Challenges for the newborn  stateChallenges for the newborn  state
Challenges for the newborn state
 
Objectives or goals of technical communication
Objectives or goals of technical communicationObjectives or goals of technical communication
Objectives or goals of technical communication
 
17 using rules of inference to build arguments
17   using rules of inference to build arguments17   using rules of inference to build arguments
17 using rules of inference to build arguments
 

Recently uploaded

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 

Recently uploaded (20)

PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 

Relations

  • 1. Fall 2002 CMSC 203 - Discrete Structures 1 You Never Escape Your…You Never Escape Your… RelationsRelations
  • 2. Fall 2002 CMSC 203 - Discrete Structures 2 RelationsRelations If we want to describe a relationship betweenIf we want to describe a relationship between elements of two sets A and B, we can useelements of two sets A and B, we can use orderedordered pairspairs with their first element taken from A andwith their first element taken from A and their second element taken from B.their second element taken from B. Since this is a relation betweenSince this is a relation between two setstwo sets, it is, it is called acalled a binary relationbinary relation.. Definition:Definition: Let A and B be sets. A binary relationLet A and B be sets. A binary relation from A to B is a subset of Afrom A to B is a subset of A××B.B. In other words, for a binary relation R we haveIn other words, for a binary relation R we have RR ⊆⊆ AA××B. We use the notation aRb to denote thatB. We use the notation aRb to denote that (a, b)(a, b)∈∈R and aR and aRb to denote that (a, b)b to denote that (a, b)∉∉R.R.
  • 3. Fall 2002 CMSC 203 - Discrete Structures 3 RelationsRelations When (a, b) belongs to R, a is said to beWhen (a, b) belongs to R, a is said to be relatedrelated toto b by R.b by R. Example:Example: Let P be a set of people, C be a set ofLet P be a set of people, C be a set of cars, and D be the relation describing which personcars, and D be the relation describing which person drives which car(s).drives which car(s). P = {Carl, Suzanne, Peter, Carla},P = {Carl, Suzanne, Peter, Carla}, C = {Mercedes, BMW, tricycle}C = {Mercedes, BMW, tricycle} D = {(Carl, Mercedes), (Suzanne, Mercedes),D = {(Carl, Mercedes), (Suzanne, Mercedes), (Suzanne, BMW), (Peter, tricycle)}(Suzanne, BMW), (Peter, tricycle)} This means that Carl drives a Mercedes, SuzanneThis means that Carl drives a Mercedes, Suzanne drives a Mercedes and a BMW, Peter drives adrives a Mercedes and a BMW, Peter drives a tricycle, and Carla does not drive any of thesetricycle, and Carla does not drive any of these vehicles.vehicles.
  • 4. Fall 2002 CMSC 203 - Discrete Structures 4 Relations on a SetRelations on a Set Definition:Definition: A relation on the set A is a relationA relation on the set A is a relation from A to A.from A to A. In other words, a relation on the set A is a subsetIn other words, a relation on the set A is a subset of Aof A××A.A. Example:Example: Let A = {1, 2, 3, 4}. Which ordered pairsLet A = {1, 2, 3, 4}. Which ordered pairs are in the relation R = {(a, b) | a < b} ?are in the relation R = {(a, b) | a < b} ?
  • 5. Fall 2002 CMSC 203 - Discrete Structures 5 Relations on a SetRelations on a Set Solution:Solution: R = {R = {(1, 2),(1, 2), (1, 3),(1, 3), (1, 4),(1, 4), (2, 3),(2, 3),(2, 4),(2, 4),(3, 4)}(3, 4)} RR 11 22 33 44 11 22 33 44 11 11 22 33 44 22 33 44 XX XX XX XX XX XX
  • 6. Fall 2002 CMSC 203 - Discrete Structures 6 Properties of RelationsProperties of Relations We will now look at some useful ways to classifyWe will now look at some useful ways to classify relations.relations. Definition:Definition: A relation R on a set A is calledA relation R on a set A is called reflexivereflexive if (a, a)if (a, a)∈∈R for every element aR for every element a∈∈A.A. Are the following relations on {1, 2, 3, 4} reflexive?Are the following relations on {1, 2, 3, 4} reflexive? R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 3), (3, 3), (4, 4)} No.No. R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)}R = {(1, 1), (2, 2), (2, 3), (3, 3), (4, 4)} Yes.Yes. R = {(1, 1), (2, 2), (3, 3)}R = {(1, 1), (2, 2), (3, 3)} No.No. Definition:Definition: A relation on a set A is calledA relation on a set A is called irreflexiveirreflexive if (a, a)if (a, a)∉∉R for every element aR for every element a∈∈A.A.
  • 7. Fall 2002 CMSC 203 - Discrete Structures 7 Properties of RelationsProperties of Relations Definitions:Definitions: A relation R on a set A is calledA relation R on a set A is called symmetricsymmetric if (b,if (b, a)a)∈∈R whenever (a, b)R whenever (a, b)∈∈R for all a, bR for all a, b∈∈A.A. A relation R on a set A is calledA relation R on a set A is called antisymmetricantisymmetric ifif a = b whenever (a, b)a = b whenever (a, b)∈∈R and (b, a)R and (b, a)∈∈R.R. A relation R on a set A is calledA relation R on a set A is called asymmetricasymmetric ifif (a, b)(a, b)∈∈R implies that (b, a)R implies that (b, a)∉∉R for all a, bR for all a, b∈∈A.A.
  • 8. Fall 2002 CMSC 203 - Discrete Structures 8 Properties of RelationsProperties of Relations Are the following relations on {1, 2, 3, 4}Are the following relations on {1, 2, 3, 4} symmetric, antisymmetric?symmetric, antisymmetric? R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)}R = {(1, 1), (1, 2), (2, 1), (3, 3), (4, 4)} symmetricsymmetric R = {(1, 1)}R = {(1, 1)} Sym. and antisym.Sym. and antisym. R = {(1, 3), (3, 2), (2, 1)}R = {(1, 3), (3, 2), (2, 1)} R = {(4, 4), (3, 3), (1, 4)}R = {(4, 4), (3, 3), (1, 4)} antisym.antisym. antisym.antisym.
  • 9. Fall 2002 CMSC 203 - Discrete Structures 9 Properties of RelationsProperties of Relations Definition:Definition: A relation R on a set A is calledA relation R on a set A is called transitivetransitive if whenever (a, b)if whenever (a, b)∈∈R and (b, c)R and (b, c)∈∈R, thenR, then (a, c)(a, c)∈∈R for a, b, cR for a, b, c∈∈A.A. Are the following relations on {1, 2, 3, 4}Are the following relations on {1, 2, 3, 4} transitive?transitive? R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)}R = {(1, 1), (1, 2), (2, 2), (2, 1), (3, 3)} Yes.Yes. R = {(1, 3), (3, 2), (2, 1)}R = {(1, 3), (3, 2), (2, 1)} No.No. R = {(2, 4), (4, 3), (2, 3), (4, 1)}R = {(2, 4), (4, 3), (2, 3), (4, 1)} No.No.
  • 10. Fall 2002 CMSC 203 - Discrete Structures 10 Representing RelationsRepresenting Relations Example:Example: How can we represent the relationHow can we represent the relation R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix? Solution:Solution: The matrix MThe matrix MRR is given byis given by           = 11 01 00 RM
  • 11. Fall 2002 CMSC 203 - Discrete Structures 11 Representing RelationsRepresenting Relations What do we know about the matrices representingWhat do we know about the matrices representing aa relation on a setrelation on a set (a relation from A to A) ?(a relation from A to A) ? They areThey are squaresquare matrices.matrices. What do we know about matrices representingWhat do we know about matrices representing reflexivereflexive relations?relations? All the elements on theAll the elements on the diagonaldiagonal of such matricesof such matrices MMrefref must bemust be 1s1s..                     = 1 . . . 1 1 refM
  • 12. Fall 2002 CMSC 203 - Discrete Structures 12 Representing RelationsRepresenting Relations What do we know about the matrices representingWhat do we know about the matrices representing symmetric relationssymmetric relations?? These matrices are symmetric, that is, MThese matrices are symmetric, that is, MRR = (M= (MRR))tt ..             = 1101 1001 0010 1101 RM symmetric matrix,symmetric matrix, symmetric relation.symmetric relation.             = 0011 0011 0011 0011 RM non-symmetric matrix,non-symmetric matrix, non-symmetric relation.non-symmetric relation.
  • 13. Fall 2002 CMSC 203 - Discrete Structures 13 Representing RelationsRepresenting Relations The Boolean operationsThe Boolean operations joinjoin andand meetmeet (you(you remember?)remember?) can be used to determine the matricescan be used to determine the matrices representing therepresenting the unionunion and theand the intersectionintersection of twoof two relations, respectively.relations, respectively. To obtain theTo obtain the joinjoin of two zero-one matrices, weof two zero-one matrices, we apply the Boolean “or” function to all correspondingapply the Boolean “or” function to all corresponding elements in the matrices.elements in the matrices. To obtain theTo obtain the meetmeet of two zero-one matrices, weof two zero-one matrices, we apply the Boolean “and” function to all correspondingapply the Boolean “and” function to all corresponding elements in the matrices.elements in the matrices.
  • 14. 14 Representing Relations Using MatricesRepresenting Relations Using Matrices Example:Example: How can we represent the relationHow can we represent the relation R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix? Solution:Solution: The matrix MThe matrix MRR is given byis given by           = 11 01 00 RM
  • 15. Fall 2002 CMSC 203 - Discrete Structures 15 Representing Relations Using MatricesRepresenting Relations Using Matrices Example:Example: Let the relations R and S be representedLet the relations R and S be represented by the matricesby the matrices           =∨=∪ 011 111 101 SRSR MMM           = 001 110 101 SM What are the matrices representing RWhat are the matrices representing R∪∪S and RS and R∩∩S?S? Solution:Solution: These matrices are given byThese matrices are given by           =∧=∩ 000 000 101 SRSR MMM           = 010 001 101 RM