The document discusses closures of relations, including reflexive closure and symmetric closure. It provides definitions and theorems related to closures. It also uses an example to illustrate finding the reflexive closure and symmetric closure of a relation. Additionally, it covers topics like paths in directed graphs, shortest paths, and transitive closure. It includes an example of calculating the transitive closure of a relation by finding its zero-one matrix.
CMSC 56 | Lecture 16: Equivalence of Relations & Partial Orderingallyn joy calcaben
Equivalence of Relations & Partial Ordering
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 21, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
CMSC 56 | Lecture 16: Equivalence of Relations & Partial Orderingallyn joy calcaben
Equivalence of Relations & Partial Ordering
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 21, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Relations and their Properties
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 9, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Representing Relations
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 14, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Relations and their Properties
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 9, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Representing Relations
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 14, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
This presentation is about electromagnetic fields, history of this theory and personalities contributing to this theory. Applications of electromagnetism. Vector Analysis and coordinate systems.
Similar to CMSC 56 | Lecture 15: Closures of Relations (20)
Matrices
CMSC 56 | Discrete Mathematical Structure for Computer Science
November 30, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
CMSC 56 | Lecture 12: Recursive Definition & Algorithms, and Program Correctnessallyn joy calcaben
Recursive Definition & Algorithms, and Program Correctness
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 23, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Mathematical Induction
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 18, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Integer Representations & Algorithms
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 13, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Functions Representations
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 13, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Growth of Functions
CMSC 56 | Discrete Mathematical Structure for Computer Science
October 6, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Predicates & Quantifiers
CMSC 56 | Discrete Mathematical Structure for Computer Science
September 5, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Sets & Set Operation
CMSC 56 | Discrete Mathematical Structure for Computer Science
September 11, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Proofs Methods and Strategy
CMSC 56 | Discrete Mathematical Structure for Computer Science
September 10, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Predicates & Quantifiers
CMSC 56 | Discrete Mathematical Structure for Computer Science
September 1, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Propositional Equivalences
CMSC 56 | Discrete Mathematical Structure for Computer Science
August 23, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Propositional Logic
CMSC 56 | Discrete Mathematical Structure for Computer Science
August 17, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
La Solidaridad and the Propaganda Movement
PI100 Life & Works of Rizal
March 2018
by: Allyn Joy Calcaben, & Jemwel Autor
University of the Philippines Visayas
Computer Vision: Feature matching with RANSAC Algorithmallyn joy calcaben
Computer Vision: Feature matching with RANdom SAmple Consensus Algorithm
CMSC197.1 Introduction to Computer Vision
April 2018
by: Allyn Joy Calcaben, Jemwel Autor, & Jefferson Butch Obero
University of the Philippines Visayas
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
3. Closure
Definition
The closure of a relation R with respect to property P is the
relation obtained by adding the minimum number of ordered
pairs to R to obtain property P.
4. Consider a relation R:
We want to add edges to
make the relation reflexive
By adding those edges,
we have made a non-
reflexive relation R into
a reflexive relation
This new relation is called the reflexive closure of R
Reflexive Closure
5. Theorem
The reflexive closure of a relation R on A is obtained by adding (a, a) to R for
each a ∈ A.
Reflexive Closure
6. Theorem
The reflexive closure of a relation R on A is obtained by adding (a, a) to R for
each a ∈ A.
The reflexive closure of R is R U ∆,
where ∆ = { (a,a) | a ∈ R } is the diagonal relation on A.
Reflexive Closure
7. What is the reflexive closure of the relation R = { (a, b) | a < b } on the set of
integers?
Example
8. What is the reflexive closure of the relation R = { (a, b) | a < b } on the set of
integers?
R = { (a, b) | a < b }
Solution
9. What is the reflexive closure of the relation R = { (a, b) | a < b } on the set of
integers?
R = { (a, b) | a < b }
∆ = { (a, a) | a ∈ Z }
Solution
10. What is the reflexive closure of the relation R = { (a, b) | a < b } on the set of
integers?
R = { (a, b) | a < b }
∆ = { (a, a) | a ∈ Z }
The reflexive closure of R is
R U ∆ = { (a, b) | a < b } U { (a, a) | a ∈ Z }
= { (a, b) | a ≤ b }
Solution
11. Let’s go back to the previous relation R:
We want to add edges to
make the relation symmetric
By adding those edges,
we have made a non-
symmetric relation R into
a symmetric relation
This new relation is called the symmetric closure of R
Symmetric Closure
12. Definition
Let R be a relation on A. Then R -1 or the inverse of R is the relation
R -1 = { < y,x > | < x, y > ∈ R}
Symmetric Closure
13. Definition
Let R be a relation on A. Then R -1 or the inverse of R is the relation
R -1 = { < y,x > | < x, y > ∈ R}
NOTE: This relation is sometimes denoted as RT or Rc and called the
converse of R
Symmetric Closure
14. Theorem
Let R be a relation on A. The symmetric closure of R, denoted s(R), is the
relation R ∪ R−1.
Symmetric Closure
15. What is the symmetric closure of the relation R = { (a, b) | a > b } on the set
of positive integers?
Example
16. What is the symmetric closure of the relation R = { (a, b) | a > b } on the set
of positive integers?
R = { (a, b) | a > b }
Solution
17. What is the symmetric closure of the relation R = { (a, b) | a > b } on the set
of positive integers?
R = { (a, b) | a > b }
R−1 = { (b, a) | a > b }
Solution
18. What is the symmetric closure of the relation R = { (a, b) | a > b } on the set
of positive integers?
R = { (a, b) | a > b }
R−1 = { (b, a) | a > b }
The symmetric closure of R is the relation
R ∪ R−1 = { (a, b) | a > b } U { (b, a) | a > b }
= { (a, b) | a ≠ b }
Solution
20. • A path is a sequences of connected edges from vertex a to vertex b
• No path exists from
the noted start location
• A path that starts and
ends at the same
vertex is called a
circuit or cycle
• Must have length ≥1
Start (a)
End (b)
Start (a)
Start (a)
End (b)
Paths in directed graphs
21. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
What are the lengths of those that are paths?
Which of the paths in this list are circuits?
Example
a b c
ed
22. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
23. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
24. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
a,e,c,d,b is not a path.
25. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
a,e,c,d,b is not a path.
b,a,c,b,a,a,b is a path of length 6.
26. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
a,e,c,d,b is not a path.
b,a,c,b,a,a,b is a path of length 6.
d,c is a path of length 1.
27. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
a,e,c,d,b is not a path.
b,a,c,b,a,a,b is a path of length 6.
d,c is a path of length 1.
c,b,a is a path of length 2.
28. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
a,e,c,d,b is not a path.
b,a,c,b,a,a,b is a path of length 6.
d,c is a path of length 1.
c,b,a is a path of length 2.
e,b,a,b,a,b,e is a path of length 6.
29. Which of the following are paths in the directed graph shown in the figure:
a,b,e,d; a,e,c,d,b; b,a,c,b,a,a,b; d,c; c,b,a; e,b,a,b,a,b,e?
Solution
a b c
ed
a,b,e,d is a path of length 3.
a,e,c,d,b is not a path.
b,a,c,b,a,a,b is a path of length 6.
d,c is a path of length 1.
c,b,a is a path of length 2.
e,b,a,b,a,b,e is a path of length 6.
30. 30
• The length of a path is the number of edges in the path, not the number of
nodes
More on paths . . .
31. • What is really needed in most
applications is finding the
shortest path between two
vertices
Shortest PathShortest Path
33. • Informal definition: If there is a path from a to b, then there should be an
edge from a to b in the transitive closure
• First take of a definition:
• In order to find the transitive closure of a relation R, we add an edge from a to c,
when there are edges from a to b and b to c
• But there is a path from 1 to 4 with no edge!
1
2 3
4
R = { (1,2), (2,3), (3,4) } (1,2) & (2,3) (1,3)
(2,3) & (3,4) (2,4)
1
2 3
4
Transitive Closure
34. • Second take of a definition:
• In order to find the transitive closure of a relation R, we add an edge from a to c,
when there are edges from a to b and b to c
• Repeat this step until no new edges are added to the relation
• We will study different algorithms for determining the transitive closure
• green means added on
the first repeat
• orange means added on
the second repeat
1
2 3
4
Transitive Closure
35. Theorem:
If A ⊂ B and C ⊂ B, then A ∪ C ⊂ B.
Theorem:
If R ⊂ S and T ⊂ U then R ◦ T ⊂ S ◦ U.
Corollary:
If R ⊂ S then Rn ⊂ Sn
Theorem:
If R is transitive then so is Rn
Transitive Closure
36. Trick proof:
Show (Rn)2 = (R2)n ⊂ Rn
Theorem:
If Rk = Rj for some j > k, then Rj + m = Rn for some n ≤ j.
Transitive Closure
37. Definition
The connectivity relation or the star closure of the relation R, denoted R*, is
the set of ordered pairs <a, b> such that there is a path (in R) from a to b:
∞
R*= U Rn
n=1
Transitive Closure
38. R contains edges between all the nodes reachable via 1 edge
R ◦ R = R2 contains edges between nodes that are reachable via 2 edges in R
R2 ◦ R = R3 contains edges between nodes that are reachable via 3 edges in R
Rn contains edges between nodes that are reachable via n edges in R
Transitive Closure
39. R* contains edges between nodes that are reachable via any number of
edges (i.e. via any path) in R
Rephrased: R* contains all the edges between nodes a and b when is a path of length
at least 1 between a and b in R
R* is the transitive closure of R
The definition of a transitive closure is that there are edges between any nodes (a,b)
that contain a path between them
Transitive Closure
41. Lemma
Let A be a set with n elements, and let R be a relation on A. If there is a path
of length at least one in R from a to b, then there is such a path with length
not exceeding n. Moreover, when a = b, if there is a path of length at least one
in R from a to b, then there is such a path with length not exceeding n – 1.
Transitive Closure
42. Theorem
Let MR be the zero-one matrix of the relation R on a set with n elements.
Then the zero-one matrix of the transitive closure R* is:
Transitive Closure
Nodes reachable with
one application of the
relation
Nodes reachable with
two applications of
the relation
Nodes reachable with
n applications of the
relation
43. Find the zero-one matrix of the transitive closure of the relation R where
Example
1 0 1
MR = 0 1 0
1 1 0
44. Find the zero-one matrix of the
transitive closure of the relation
R where
Solution
1 0 1
MR = 0 1 0
1 1 0
1 2
3
45. Find the zero-one matrix of the
transitive closure of the relation
R where
Solution
1 0 1
MR = 0 1 0
1 1 0
1 1 1
MR2 = 0 1 0
1 1 1
1 2
3
46. Find the zero-one matrix of the
transitive closure of the relation
R where
Solution
1 0 1
MR = 0 1 0
1 1 0
1 1 1
MR3 = 0 1 0
1 1 1
1 2
3
47. Find the zero-one matrix of the
transitive closure of the relation
R where
Solution
1 1 1
V 0 1 0
1 1 1
1 0 1
MR* = 0 1 0
1 1 0
1 1 1
V 0 1 0
1 1 1
1 1 1
= 0 1 0
1 1 1
49. oSet
November 12 – December 05
FINAL EXAM
December 11, 2018
12:00PM – 02:00PM
49
Reminders
Editor's Notes
• Add loops to all vertices on the digraph representation of R.
• Put 1’s on the diagonal of the connection matrix of R.
In order to find the reflexive closure of a relation R, we add a loop at each node that does not have one.
With matrices, we set the diagonal to all 1’s
Note: to get R -1
• reverse all the arcs in the digraph representation of R
• take the transpose M T of the connection matrix M of R.
The composition of the relation with its inverse does not necessarily produce the diagonal relation (recall that the composition of a bijective function with its inverse is the identity)
Note: to get R -1
• reverse all the arcs in the digraph representation of R
• take the transpose M T of the connection matrix M of R.
Circuits
We don’t get any new relations beyond Rj.
As soon as you get a power of R that is the same as one you had before, STOP