Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Transitive Closure - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Transitive Closure, Closure of Relation, Sequence of Elements, Warshall’s Algorithm, Graph Connectivity Problem, Equivalence Relations, Equivalence Classes, Collection of Sets, Definition of Partition

Typology: Slides

2012/2013

Uploaded on 04/27/2013

atasi
atasi 🇮🇳

4.6

(32)

136 documents

1 / 40

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 173:
Discrete Mathematical Structures
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Transitive Closure - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

CS 173:

Discrete Mathematical Structures

Transitive Closure

• Let c(R ) denote the transitive

closure of relation R.

Then c(R ) = R U {

(a,c): ∃b (a,b),(b,c) ∈ R

Example: A={1,2,3,4}, R={(1,2),(2,3),(3,4)}.

Apply definition to get:

c(R ) = {(1,2),(2,3),(3,4), }

Which of the following is true: a) This set is transitive, but we added too much. b) This set is the transitive closure of R. c) This set is not transitive, one pair is missing. d) This set is not transitive, more than 1 pair ismissing.

Transitive Closure

Formally:

If t(R) is the transitive closure of R, and if

R contains a path from a to b, then (a,b)

∈ t(R)

Notes:

– Later classes will give you efficient

algorithms for determining if there is a

path between two vertices in a graph

(graph connectivity problem)

– Read about Warshall’s algorithm in the

text.

Equivalence Relations

Example:

Let S = {people in this classroom},

and let

R = {(a,b): a has same # of coins in his/her bag as b}

Quiz time:

Is R reflexive?

Is R symmetric?

Is R transitive?

Yes

Yes

Yes

This is a special

kind of relation,

characterized by

the properties it

has.

What’s special

about it?

Everyone with the same

of coins as

you is just like you.

Equivalence Relations

Example:

S = Z (integers), R = {(a,b) : a ≡ b mod

Is this relation an equivalence

relation on S?

Let a be any integer. aRa since a = 4⋅0 + a.

Consider aRb. Then a = 4k + b. But b = -4k + a.

Consider aRb and bRc. Then a = 4k + b and b = 4j + c.

So, a = 4k + 4j +c = 4(k+j) + c.

Start by thinking of R a different way: aRb iff

there is an int k so that a = 4k + b. Your quest

becomes one of finding ks.

Equivalence Relations

Example:

S = people in this room,

R = {(a,b) : total $ on a is within $1.00 of total $ on b}

Is this relation an equivalence

relation on S?

Clearly reflexive and symmetric. Is it transitive?

a) Yes, I can give a proof. b) Yes, I think so, but I can’t prove it. c) No, I can give a proof. d) No, I don’t think so, but I can’t prove it.

Equivalence Classes

What equivalence relation we’ve seen

recently has representatives

[244], [7], [58], [1]?

Equivalence Classes

Definition: Let R be an equivalence

relation on S. The equivalence class

of a ∈ S, [a] R , is

[a] R = {b: aRb}

What does the set of equivalence classes on S look

like?

Notice this is just a subset of S.

To answer, think about the relation from before:

S = {people in this room}

R = {(a,b) : a has the same # of coins in his/her bag as b}

In how many different equivalence classes can each

person fall?

Equivalence Classes

Lemma: Let R be an equivalence

relation on S. Then

1. If aRb, then [a] R = [b] R

2. If not aRb, then [a] R ∩ [b] R = ∅

Proof:

  1. Suppose to the contrary that ∃ x ∈ [a] (^) R ∩ [b] (^) R.

x ∈ [a]R x ∈ [b]R ⇔ aRx and bRx

⇔ aRb, contradicting “not aRb”

⇔ aRx and xRb

Thus, [a]R and [b] (^) R are either identical or disjoint.

S = [ a ] R

aS

Equivalence Classes

So S is the union of disjoint

equivalence classes of R.

A partition of a set S is a (perhaps infinite…or

uncountably infinite) collection of sets {Ai} with

Each Ai non-empty Each Ai ⊆ S For all i, j, A (^) i ∩ Aj = ∅ S = ∪A (^) i Each Ai is called a block of the partition.

Equivalence Classes

Theorem: if R is a _____ S, then {[a] (^) R : a ∈ S} is a _____ S.

A. Partition of, equivalence relation on B. Subset of, equivalence class of C. Relation on, partition of D. Equivalence relation on, partition of E. I have no clue.

Theorem: if R is an equivalence relation on S, then {[a] (^) R : a ∈ S} is a partition of S.

Proof: we need to show that an equivalence relation R satisfies the definition of a partition. (we’ve spent the whole day doing this!)

Equivalence Classes

Theorem: if {Ai} is any partition of S, then there exists an

equivalence relation R, whose equivalence classes are exactly the blocks Ai.

Proof If {Ai} partitions S then define relation R on S to be R = {(a,b) : ∃ i, a ∈ Ai and b ∈ Ai} Next show that R is an equivalence relation. Reflexive and symmetric. Transitive? Suppose aRb and bRc. Then a and b are in A (^) i, and b and c are in A (^) j. But b ∈ Ai ∩ A (^) j , so A (^) i = Aj. So, a, b, c ∈ Ai, thus aRc.

Partially Ordered Sets (POSets)

Ex. (Z +, | ), the relation “divides” on positive integers.

Reflexive? Yes, x|x since x=1x (k=1)

Transitive?

Antisymmetric?

a|b means b=ak, b|c means c=bj. Does c=am for some m?

c = bj = akj (m=kj)

a|b means b=ak, b|a means a=bj. But b = bjk (subst) only if jk=1.

jk=1 means j=k=1, and we have b=a1, or b=a

Yes, or No?

Partially Ordered Sets (POSets)

Ex. (Z, | ), the relation “divides” on integers.

Reflexive? Yes, x|x since x=1x (k=1)

Transitive?

Antisymmetric?

a|b means b=ak, b|c means c=bj. Does c=am for some m?

c = bj = akj (m=kj)

3|-3, and -3|3, but 3 ≠ -3.

Not a poset.

Yes, or No?