8-Relations - EECS 210 Discrete Structures David O Johnson...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Relations David O. Johnson EECS 210 (Fall 2016) 1 EECS 210 Discrete Structures David O. Johnson Fall 2016
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Reminders Homework 2 due: Today at the beginning of the lecture (Thursday, September 22) Connect 2 due: 11:59 PM, Thursday, September 29 Relations David O. Johnson EECS 210 (Fall 2016) 2
Image of page 2
Any Questions? Relations 3 David O. Johnson EECS 210 (Fall 2016)
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Closure of Relations (Section 9.4) What Is a Closure? Reflexive Closure Symmetric Closure Transitive Closures Paths in Directed Graphs Connectivity Relation R * Warshall’s Algorithm Relations David O. Johnson EECS 210 (Fall 2016) 4
Image of page 4
What Is a Closure? Example: A computer network has data centers in Boston, Chicago, Denver, Detroit, New York, and San Diego. There are direct, one-way telephone lines from Boston to Chicago, from Boston to Detroit, from Chicago to Detroit, from Detroit to Denver, and from New York to San Diego. We want to add telephone lines so that at least one link (possibly indirect) is between any two data centers. How do we determine the minimum number of direct links to add using the properties of a relation? Relations David O. Johnson EECS 210 (Fall 2016) 5 Chicago Boston San Diego Denver Detroit New York Solution: Let R be the relation containing (a, b) if there is a telephone line from the data center in a to that in b. The relation would be transitive, if all the data centers were interconnected. Transitivity : If ( x,y ) and ( y,z ) are edges, then so is ( x,z ) .
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What Is a Closure? Solution (continued): As we will show in this section, we can find all pairs of data centers that have a link by constructing a transitive relation S containing R such that S is a subset of every transitive relation containing R. Here, S is the smallest transitive relation that contains R. This relation is called the transitive closure of R. Thus S – R = the direct links we need to add. What is a Closure? In general, let R be a relation on a set A. R may or may not have some property P, such as reflexivity, symmetry, or transitivity. If there is a relation S with property P containing R such that S is a subset of every relation with property P containing R, then S is called the closure of R with respect to P. Note that the closure of a relation with respect to a property may not exist. Relations David O. Johnson EECS 210 (Fall 2016) 6
Image of page 6
Reflexive Closure R is reflexive iff ( a,a ) R for every element a A . Written symbolically, R is reflexive if and only if x [ x U ⟶ ( x , x ) ∊ R ] The relation R = {(1, 1), (1, 2), (2, 1), (3, 2)} on the set A = {1, 2, 3} is not reflexive. How can we produce a reflexive relation containing R that is as small as possible? This can be done by adding (2, 2) and (3, 3) to R, because these are the only pairs of the form (a, a) that are not in R.
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern