+ All Categories
Home > Documents > Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia...

Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia...

Date post: 01-Jan-2016
Category:
Upload: lauren-harrison
View: 214 times
Download: 0 times
Share this document with a friend
24
Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia [email protected] Some slides from Aaron Bloomfield
Transcript
Page 1: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Rosen, Section 8.5Equivalence Relations

Longin Jan LateckiTemple University, Philadelphia

[email protected]

Some slides from Aaron Bloomfield

Page 2: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Introduction

• Certain combinations of relation properties are very useful

• In this set we will study equivalence relations:A relation that is reflexive, symmetric and transitive

• Next slide set we will study partial ordering:A relation that is reflexive, antisymmetric, and transitive

• The difference is whether the relation is symmetric or antisymmetric

Page 3: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Outline

• What is an equivalence relation

• Equivalence relation examples

• Related items– Equivalence class– Partitions

Page 4: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

We can group properties of relations together to define new types of important relations.

_________________Definition: A relation R on a set A is an equivalence relation iff R is• reflexive• symmetric• transitive

Two elements related by an equivalence relation are called equivalent.

Consider relation R = { (a,b) | len(a) = len(b) }, where len(a) means the length of string a

It is reflexive: len(a) = len(a)It is symmetric: if len(a) = len(b), then len(b) = len(a)It is transitive: if len(a) = len(b) and len(b) = len(c), then len(a) = len(c)Thus, R is a equivalence relation

Page 5: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Equivalence relation example• Consider the relation R = { (a,b) | a ≡ b (mod m) }

– Remember that this means that m | a-b– Called “congruence modulo m”

• Is it reflexive: (a,a) R means that m | a-a– a-a = 0, which is divisible by m

• Is it symmetric: if (a,b) R then (b,a) R– (a,b) means that m | a-b– Or that km = a-b. Negating that, we get b-a = -km– Thus, m | b-a, so (b,a) R

• Is it transitive: if (a,b) R and (b,c) R then (a,c) R– (a,b) means that m | a-b, or that km = a-b– (b,c) means that m | b-c, or that lm = b-c– (a,c) means that m | a-c, or that nm = a-c – Adding these two, we get km+lm = (a-b) + (b-c)– Or (k+l)m = a-c– Thus, m divides a-c, where n = k+l

• Thus, congruence modulo m is an equivalence relation

Page 6: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Rosen, section 8.5, question 1• Which of these relations on {0, 1, 2, 3} are equivalence

relations? Determine the properties of an equivalence relation that the others lack

a) { (0,0), (1,1), (2,2), (3,3) }Has all the properties, thus, is an equivalence relation

b) { (0,0), (0,2), (2,0), (2,2), (2,3), (3,2), (3,3) }Not reflexive: (1,1) is missingNot transitive: (0,2) and (2,3) are in the relation, but not (0,3)

c) { (0,0), (1,1), (1,2), (2,1), (2,2), (3,3) }Has all the properties, thus, is an equivalence relation

d) { (0,0), (1,1), (1,3), (2,2), (2,3), (3,1), (3,2) (3,3) }Not transitive: (1,3) and (3,2) are in the relation, but not (1,2)

e) { (0,0), (0,1) (0,2), (1,0), (1,1), (1,2), (2,0), (2,2), (3,3) }Not symmetric: (1,2) is present, but not (2,1)Not transitive: (2,0) and (0,1) are in the relation, but not (2,1)

Page 7: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Rosen, Section 8.5, question 9

• Suppose that A is a non-empty set, and f is a function that has A as its domain. Let R be the relation on A consisting of all ordered pairs (x,y) where f(x) = f(y)– Meaning that x and y are related if and only if f(x) = f(y)

• Show that R is an equivalence relation on A

• Reflexivity: f(x) = f(x)– True, as given the same input, a function always produces the

same output

• Symmetry: if f(x) = f(y) then f(y) = f(x)– True, by the definition of equality

• Transitivity: if f(x) = f(y) and f(y) = f(z) then f(x) = f(z)– True, by the definition of equality

Page 8: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Rosen, Section 8.5, question 11

• Show that the relation R, consisting of all pairs (x,y) where x and y are bit strings of length three or more that agree except perhaps in their first three bits, is an equivalence relation on the set of all bit strings

• Let f(x) = the bit string formed by the last n-3 bits of the bit string x (where n is the length of the string)

• Thus, we want to show: let R be the relation on A consisting of all ordered pairs (x,y) where f(x) = f(y)

• This has been shown in question 9 on the previous slide

Page 9: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

An equivalence class of an element x:

[x] = {y | <x, y> is in R}

[x] is the subset of all elements related to [x] by R.

The element in the bracket is called a representativeof the equivalence class. We could have chosen any one.

Theorem: Let R be an equivalence relation on A. Then either[a] = [b] or [a] ∩[b] = Φ

The number of equivalence classes is called the rank of the equivalence relation.

Let A={a,b,c} and R be given by a digraph:

Page 10: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

More on equivalence classes

• Consider the relation R = { (a,b) | a mod 2 = b mod 2 } on the set of integers– Thus, all the even numbers are related to each other– As are the odd numbers

• The even numbers form an equivalence class– As do the odd numbers

• The equivalence class for the even numbers is denoted by [2] (or [4], or [784], etc.)– [2] = { …, -4, -2, 0, 2, 4, … }– 2 is a representative of its equivalence class

• There are only 2 equivalence classes formed by this equivalence relation

Page 11: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

More on equivalence classes

• Consider the relation R = { (a,b) | a = b or a = -b }– Thus, every number is related to additive inverse

• The equivalence class for an integer a:– [7] = { 7, -7 }– [0] = { 0 }– [a] = { a, -a }

• There are an infinite number of equivalence classes formed by this equivalence relation

Page 12: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Theorem: Let R be an equivalence relation on a set A.The equivalence classes of R partition the set A into disjoint nonempty subsets whose union is the entire set.This partition is denoted A/R and called• the quotient set, or• the partition of A induced by R, or,• A modulo R.

Definition: Let S1, S2, . . ., Sn be a collection of subsets of a set A. Then the collection forms a partition of A if the subsets are nonempty, disjoint and exhaust A:

Note that { {}, {1,3}, {2} } is not a partition (it contains the empty set). { {1,2}, {2, 3} } is not a partition because …. { {1}, {2} } is not a partition of {1, 2, 3} because none of its blocks contains 3.

Page 13: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

It is easy to recognize equivalence relations using digraphs:• The equivalence class of a particular element forms a universal relation (contains all possible edges) between the elements in the equivalence class. The (sub)digraph representing the subset is called a complete (sub)digraph, since all arcs are present.Example: All possible equivalence relations on a set A with 3 elements:

Page 14: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Rosen, section 8.5, question 44• Which of the following are partitions of the set of integers?

a) The set of even integers and the set of odd integersYes, it’s a valid partition

b) The set of positive integers and the set of negative integersNo: 0 is in neither set

c) The set of integers divisible by 3, the set of integers leaving a remainder of 1 when divided by 3, and the set of integers leaving a remaineder of 2 when divided by 3

Yes, it’s a valid partitiond) The set of integers less than -100, the set of integers with

absolute value not exceeding 100, and the set of integers greater than 100

Yes, it’s a valid partitione) The set of integers not divisible by 3, the set of even integers, and

the set of integers that leave a remainder of 3 when divided by 6The first two sets are not disjoint (2 is in both), so it’s not a valid partition

Page 15: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

1. Determine whether the relations represented by these zero-one matricesare equivalence relations. If yes, with how many equivalence classes?

1000

0111

0111

0111

1010

0101

1010

0101

111

110

111

RPM

2. What are the equivalence classes (sets in the partition) of the integersarising from congruence modulo 4?

3. Can you count the number of equivalence relations on a set A with n elements. Can you find a recurrence relation?The answers are• 1 for n = 1• 2 for n = 2• 5 for n = 3How many for n = 4?

Page 16: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Theorem (Bell number)Let p(n) denotes the number of different equivalence relations on a set with n elements (which is equivalent to the number of partitions of the set with n elements). Then

1

0

)1(),1()(n

j

jnpjnCnp

p(n) is called Bell number, named in honor of Eric Temple Bell

Examples:p(0)=1, since there is only one partition of the empty set: into the empty collection of subsets

p(1)=C(0,0)p(0)=1, since {{1}} is the only partition of {1}

p(2)=C(1,0)p(1)+C(1,1)p(0)=1+1=5, since portions of {1,2} are {{1,2}} and {{1},{2}}

p(3)=5, since, the set { 1, 2, 3 } has these five partitions. { {1}, {2}, {3} }, sometimes denoted by 1/2/3. { {1, 2}, {3} }, sometimes denoted by 12/3. { {1, 3}, {2} }, sometimes denoted by 13/2. { {1}, {2, 3} }, sometimes denoted by 1/23. { {1, 2, 3} }, sometimes denoted by 123.

Page 17: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Proof (Bell number) :

1

0

)1(),1()(n

j

jnpjnCnp

We want to portion {1, 2, …, n}.For a fixed j, A is a subset of j elements from {1, 2, …, n-1} union {n}.Note that j can have values from 0 to n-1.

We can select a subset of j elements from {1, 2, …, n-1} in C(n-1,j) ways, and we have p(n-1-j) partitions of the remaining n-1-j elements. ■

Page 18: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Theorem: If R1 and R2 are equivalence relations on A, then R1∩R2 is an equivalence relation on A.

Proof: It suffices to show that the intersection of

• reflexive relations is reflexive,

• symmetric relations is symmetric, and

• transitive relations is transitive.

Page 19: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Definition: Let R be a relation on A. Then the reflexive, symmetric, transitive closure of R, tsr(R), is anequivalence relation on A, called the equivalence relation induced by R.

Example:

Page 20: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Theorem: tsr(R) is an equivalence relation.

Proof:We need to show that tsr(R) is still symmetric and reflexive.

• Since we only add arcs vs. deleting arcs when computing closures it must be that tsr(R) is reflexive since all loops <x, x> on the diagraph must be present when constructing r(R).

• If there is an arc <x, y> then the symmetric closure of r(R) ensures there is an arc <y, x>.

• Now argue that if we construct the transitive closure of sr(R) and we add an edge <x, z> because there is a path from x to z, then there must also exist a path from z to x (why?) and hence we also must add an edge <z, x>. Hence the transitive closure of sr(R) is symmetric.

Page 21: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

What we wish computers could do

Page 22: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Quick survey

• I felt I understood the material in this slide set…

a) Very well

b) With some review, I’ll be good

c) Not really

d) Not at all

Page 23: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Quick survey

• The pace of the lecture for this slide set was…

a) Fast

b) About right

c) A little slow

d) Too slow

Page 24: Rosen, Section 8.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia latecki@temple.edu Some slides from Aaron Bloomfield.

Quick survey

• How interesting was the material in this slide set? Be honest!

a) Wow! That was SOOOOOO cool!

b) Somewhat interesting

c) Rather boring

d) Zzzzzzzzzzz


Recommended