Equivalence Relations

Slides:



Advertisements
Similar presentations
Equivalence Relations
Advertisements

Section 7.5: Equivalence Relations Def: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. Ex: Let.
Equivalence Relations
Chap6 Relations Def 1: Let A and B be sets. A binary relation from A
Basic Properties of Relations
Applied Discrete Mathematics Week 11: Graphs
CSE115/ENGR160 Discrete Mathematics 05/03/11 Ming-Hsuan Yang UC Merced 1.
Congruence of Integers
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Relations Chapter 9.
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.
1 Relations and Their Properties Epp, section ??? CS 202 Aaron Bloomfield.
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.
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.
Digraphs and Relations Warm Up. The Divisibility Relation Let “|” be the binary relation on N×N such that a|b (“a divides b”) iff there is an n ∈ N such.
Rosen, Section 8.5 Equivalence Relations
Language: Set of Strings
Relations and their Properties
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Mathematical Preliminaries
Problem Statement How do we represent relationship between two related elements ?
Chapter 8 Equivalence Relations Let A and B be two sets. A relation R from A to B is a subset of AXB. That is, R is a set of ordered pairs, where the first.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
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.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
1 Equivalence relations Binary relations: –Let S1 and S2 be two sets, and R be a (binary relation) from S1 to S2 –Not every x in S1 and y in S2 have such.
Chapter 13 Mathematic Structures 13.1 Modular Arithmetic Definition 1 (modulo). Let a be an integer and m be a positive integer. We denoted by a mod m.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 7 Relations.
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 B = {a,b} {( 0, a), (
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
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.
Equivalence Relations and Classes
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Equivalence Relations: Selected Exercises
The Relation Induced by a Partition
Representing Relations Using Digraphs
Relations and Their Properties
Relations and Their Properties
CSE15 Discrete Mathematics 05/03/17
Introduction to Relations
Equivalence Relations
Relations Chapter 9.
RELATION KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS )
Dr. Ameria Eldosoky Discrete mathematics
Reflexivity, Symmetry, and Transitivity
Aaron Bloomfield CS 202 Epp, section ???
Relations and Their Properties
Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 9 Relations Slides are adopted from.
CS2210 Discrete Structures Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Equivalence Relations
Relations and Digraphs
Applied Discrete Mathematics Week 6: Relations/Digraphs
Relations and their Properties
Equivalence Relations
Equivalence Relations
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
Clements MAΘ October 30th, 2014
Equivalence Relations: Selected Exercises
Foundations of Discrete Mathematics
Chapter 8 (Part 2): Relations
Presentation transcript:

Equivalence Relations CS 202 Epp, section 10.2

Equivalence relations A relation on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive 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) | 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

Sample questions 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)

Sample questions 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)

Sample questions 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 on the previous slide

Equivalence classes Let R be an equivalence relation on a set A. The set of all elements that are related to an element a of A is called the equivalence class of a. The equivalence class of a with respect to R is denoted by [a]R When only one relation is under consideration, the subscript is often deleted, and [a] is used to denote the equivalence class Note that these classes are disjoint! As the equivalence relation is symmetric

More on equivalence classes Consider the relation R = { (a,b) | a mod 2 = b mod 2 } 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 it’s 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

Partitions Consider the relation R = { (a,b) | a mod 2 = b mod 2 } This splits the integers into two equivalence classes: even numbers and odd numbers Those two sets together form a partition of the integers Formally, a partition of a set S is a collection of non-empty disjoint subsets of S whose union is S In this example, the partition is { [0], [1] } Or { {…, -3, -1, 1, 3, …}, {…, -4, -2, 0, 2, 4, …} }

Sample questions 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

n-ary Relations Up to now, binary relations on a single set, A, which produces a set of ordered pairs, a subset of A x A. n-ary relation, R on the sets A1, A2,…An is a subset of the product A1 x A2 x… x An A relational database is a collection of relations

Next class