Top Banner
8.4 Closures of Relations
21

8.4 Closures of Relations

Feb 22, 2016

Download

Documents

Calla

8.4 Closures of Relations. Intro. Consider the following example (telephone line, bus route,…) abc d Is R, defined above on the set A={a, b, c, d}, transitive? If not, is there a (possibly indirect) link between each of the cities? To answer, we want to find the Transitive Closure. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 8.4 Closures of Relations

8.4 Closures of Relations

Page 2: 8.4 Closures of Relations

Intro

Consider the following example (telephone line, bus route,…)

a b c

d

Is R, defined above on the set A={a, b, c, d}, transitive?If not, is there a (possibly indirect) link between each of the

cities?To answer, we want to find the Transitive Closure

Page 3: 8.4 Closures of Relations

Closures, in general

Def: Let R be a relation on a set A that may or may not have some property P. (Ex: Reflexive,…) 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: the closure may or may not exist

Page 4: 8.4 Closures of Relations

Reflexive Closures- Idea, Example

Reflexive Closure of R—the smallest reflexive relation that contains R

Consider R={(1,2),(2,3),(3,2)} on A={1,2,3}

1 23

Using both ordered pairs and digraphs, find the reflexive closure.

Page 5: 8.4 Closures of Relations

Reflexive Closures

Reflexive Closure of R—the smallest reflexive relation that contains R

Reflexive Closure = R

Where ={(a,a)| a A} is the diagonal relation on A.

Page 6: 8.4 Closures of Relations

More examples

• Find the reflexive closures for:– R={(a,b)|a<b} on the integers Z

– R={(a,b)|a ≠ b} on Z

Page 7: 8.4 Closures of Relations

Symmetric Example

• Find the symmetric closure of R={(1,1), (1,2),(2,2),(2,3),(3,1),(3,2)} on A={1,2,3}

1 2 3

Page 8: 8.4 Closures of Relations

Symmetric Closures

Symmetric Closure of R = R R-1

Where R-1= {(b,a) | (a,b) R}

Example:R={(a,b)|a>b} on the integers ZSymmetric closure:

Page 9: 8.4 Closures of Relations

Transitive Theory- example

1 2

4 3

Add all (a,c) such that (a,b), (b,c) R.

Keep going. (Why?)

Page 10: 8.4 Closures of Relations

Transitive Closure Theory, and Def of Path

Def: A path from a to b in a directed graph G is a

sequence of edges (x0,x1), (x1,x2)… (xn-1, xn) in G where x0=a and xn=b. It is denoted x1, x2,…xn and has length n.

When a=b, the path is called a circuit or cycle.

Page 11: 8.4 Closures of Relations

Find Transitive Closure- see worksheet

Do Worksheet 1 2

4 3 Find the transitive closure Find circuits and paths of length 2, 3, 4

Page 12: 8.4 Closures of Relations

Example- in matrices

Using the idea that R n+1 = Rn°R and

MS°R = MR MS , Find the matrices for R R 2 R 3 R 4

The find paths of length 2, 3, 4

Page 13: 8.4 Closures of Relations

Example

=

Page 14: 8.4 Closures of Relations

Next step

In order to come up with a theory for the transitive closure, we will first study paths….

Page 15: 8.4 Closures of Relations

Theorem 1

Theorem 1: Let R be a relation on a set A.There is a path of length n from a to b iff

(a,b)Rn

Proof method?

Page 16: 8.4 Closures of Relations

Proof of Thm. 1By induction:N=1: true by definition (path from a to b of l=1 iff (a,b) R).

Induction step: Assume: There exists a path of length __ from ___iff ______Show: There exists a path of length __ from ___iff ______Assuming the IH (Inductive Hypothesis), There is a path of length __ from ___ Iff There exists an element c with a path from a to c in R and a

path of length n from c to b in ___ Iff There exists an element c with (a,c) ___ and (c,b) ___Iff (a,b) ____ = _______

Page 17: 8.4 Closures of Relations

Def 2: Connectivity relation

Def. 2: Let R be a relation on set A.The connectivity relation R* consists of the pairs

(a,b) such that there is a path between a and b in R.

R* =

Page 18: 8.4 Closures of Relations

Examples• R={(a,b)| a has met b}– 6 degrees – Erdos number– R* include (you,__)

• R={(a,b)| it is possible to travel from stop a to b directly} on set A of all subway stops– R*=

• R={(a,b)|state a and b have a common border” on the set A of states. – R*=

Page 19: 8.4 Closures of Relations

Thm. 2: Transitive closure is the connectivity relation

Theorem 2: The transitive closure of a relation R equals the connectivity relation

R* =

Elements of the Proof:Note that R R*To show R* is the transitive closure of R, show:1) R* is ________2) Whenever S is a transitive relation that contains R, then

R* ______

Page 20: 8.4 Closures of Relations

Proof of Thm 21) Assume (a,b) R* and (b,c) R*So (a,b) ___ and (b,c) ___By Thm. 1, there exists paths…

2 paths:

In conclusion ________

Page 21: 8.4 Closures of Relations

Thm 2 proof…

2) Suppose S is a transitive relation containing RIt can be shown by induction that Sn is transitive.By a previous theorem in sec. 8.1, S n ___ S.Since S* = S k and S k __ S , the S* ___ S.Since R ___S, the R* ____ S*.Therefore R* ___ S* ___ S.