Rosen, Section 8.5 Equivalence Relations

Slides:



Advertisements
Similar presentations
Equivalence Relations
Advertisements

Equivalence Relations
Equivalence Relations
Relations Relations on a Set. Properties of Relations.
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
1 Chapter Equivalence, Order, and Inductive Proof.
Chap6 Relations Def 1: Let A and B be sets. A binary relation from A
Basic Properties of Relations
Representing Relations Using Matrices
Applied Discrete Mathematics Week 11: Graphs
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?
CSE115/ENGR160 Discrete Mathematics 05/03/11 Ming-Hsuan Yang UC Merced 1.
Discrete Mathematics Lecture#11.
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Applied Discrete Mathematics Week 10: Equivalence Relations
Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations.
Equivalence Relations MSU CSE 260. Outline Introduction Equivalence Relations –Definition, Examples Equivalence Classes –Definition Equivalence Classes.
Chapter Relations and Their Properties 8.2 n-ary Relations and Their Applications 8.3 Representing Relations 8.4 Closures of Relations 8.5 Equivalence.
1 Partial Orderings Aaron Bloomfield CS 202 Rosen, section 7.6.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
2.6 Equivalence Relation §1.Equivalence relation §Definition 2.18: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric,
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
1 Relations and Their Properties Rosen, section 7.1 CS/APMA 202 Aaron Bloomfield.
1 Closures of Relations: Transitive Closure and Partitions Sections 8.4 and 8.5.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Representing Relations
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Mathematical Preliminaries
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Representing Relations Using Matrices A relation between finite sets can be represented using a zero-one matrix Suppose R is a relation from A = {a 1,
Section 7.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
8.4 Closures of Relations Definition: The closure of a relation R with respect to property P is the relation obtained by adding the minimum number of.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
8.5 Equivalence Relations
1 Section 4.2 Equivalence Relations A binary relation is an equivalence relation if it has the three properties reflexive, symmetric, and transitive (RST).
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda.
§R1∪R2§R1∪R2 §R 1 ∩R 2 R1-R2R1-R2 2.4 Operations on Relations.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Chapter8 Relations 8.1: Relations and their properties.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
The Relation Induced by a Partition
Representing Relations Using Digraphs
Relations and Their Properties
CSE15 Discrete Mathematics 05/03/17
Relations Binary relations represent relationships between the elements of two sets. A binary relation R from set A to set B is defined by: R  A 
Equivalence Relations
Relations Chapter 9.
Aaron Bloomfield CS 202 Rosen, section 7.4
RELATION KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS )
Dr. Ameria Eldosoky Discrete mathematics
Reflexivity, Symmetry, and Transitivity
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 9 Relations Slides are adopted from.
Discrete Math (2) Haiming Chen Associate Professor, PhD
Relations and Digraphs
Equivalence Relations
Equivalence Relations
Equivalence Relations
Chapter 8 (Part 2): Relations
Presentation transcript:

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

Outline What is an equivalence relation Equivalence relation examples Related items Equivalence class Partitions

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

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

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 { (0,0), (1,1), (2,2), (3,3) } Has all the properties, thus, is an equivalence relation { (0,0), (0,2), (2,0), (2,2), (2,3), (3,2), (3,3) } Not reflexive: (1,1) is missing Not transitive: (0,2) and (2,3) are in the relation, but not (0,3) { (0,0), (1,1), (1,2), (2,1), (2,2), (3,3) } { (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) { (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)

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)

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

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 representative of 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:

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

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

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.

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:

Rosen, section 8.5, question 44 Which of the following are partitions of the set of integers? The set of even integers and the set of odd integers Yes, it’s a valid partition The set of positive integers and the set of negative integers No: 0 is in neither set 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 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 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 6 The first two sets are not disjoint (2 is in both), so it’s not a valid partition

1. Determine whether the relations represented by these zero-one matrices are equivalence relations. If yes, with how many equivalence classes? 2. What are the equivalence classes (sets in the partition) of the integers arising 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 = 3 How many for n = 4?

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 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=2, 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.

Proof (Bell number) : 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. ■

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.

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

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.

What we wish computers could do

Quick survey I felt I understood the material in this slide set… Very well With some review, I’ll be good Not really Not at all

Quick survey The pace of the lecture for this slide set was… Fast About right A little slow Too slow

Quick survey How interesting was the material in this slide set? Be honest! Wow! That was SOOOOOO cool! Somewhat interesting Rather boring Zzzzzzzzzzz