and e 2 ~ e 2 iff e 1

Similar documents
Chapter 9: Relations Relations

Automata and Languages

{a, b, c} {a, b} {a, c} {b, c} {a}

Equivalence, Order, and Inductive Proof

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

Properties of the Integers

5. Partitions and Relations Ch.22 of PJE.

Practice Exam 1 CIS/CSE 607, Spring 2009

CSE 20 DISCRETE MATH. Winter

1.4 Equivalence Relations and Partitions

Section Summary. Relations and Functions Properties of Relations. Combining Relations

Equivalence relations

Lecture 8: Equivalence Relations

Practice Final Solutions. 1. Consider the following algorithm. Assume that n 1. line code 1 alg(n) { 2 j = 0 3 if (n = 0) { 4 return j

Relations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)

MATH 101: ALGEBRA I WORKSHEET, DAY #1. We review the prerequisites for the course in set theory and beginning a first pass on group. 1.

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

CSE 20 DISCRETE MATH. Fall

Definition List Modern Algebra, Fall 2011 Anders O.F. Hendrickson

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Discrete Structures, Logic, and Computability Third Edition

Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr.

Relations. Binary Relation. Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation. Let R A B be a relation from A to B.

14 Equivalence Relations

CSC Discrete Math I, Spring Relations

Problems for Putnam Training

(4.2) Equivalence Relations. 151 Math Exercises. Malek Zein AL-Abidin. King Saud University College of Science Department of Mathematics

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

Day 12. Thursday June 7, 2012

McGill University Faculty of Science. Solutions to Practice Final Examination Math 240 Discrete Structures 1. Time: 3 hours Marked out of 60

Notes on Sets, Relations and Functions

Notes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.

9. Quantifier-free Equality and Data Structures

Ring Sums, Bridges and Fundamental Sets

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

15.1 Matching, Components, and Edge cover (Collaborate with Xin Yu)

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

Exam Practice Problems

0 Sets and Induction. Sets

Logic, Set Theory and Computability [M. Coppenbarger]

Kruskal s Theorem Rebecca Robinson May 29, 2007

Relations Graphical View

Week 4-5: Binary Relations

1 Chapter 1: SETS. 1.1 Describing a set

Equivalence Relations and Partitions, Normal Subgroups, Quotient Groups, and Homomorphisms

Complete Induction and the Well- Ordering Principle

Relations. Relations. Definition. Let A and B be sets.

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Well-Ordering Principle. Axiom: Every nonempty subset of Z + has a least element. That is, if S Z + and S, then S has a smallest element.

1 Partitions and Equivalence Relations

BASIC MATHEMATICAL TECHNIQUES

Coloring Vertices and Edges of a Path by Nonempty Subsets of a Set

Math.3336: Discrete Mathematics. Chapter 9 Relations

@&%% Discrete Mathematics There are two problems in the discrete mathematics

Week 4-5: Generating Permutations and Combinations

Lecture 4.3: Closures and Equivalence Relations

Week 4-5: Binary Relations

Orders and Equivalences

EQUIVALENCE RELATIONS (NOTES FOR STUDENTS) 1. RELATIONS

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Today. Binary relations establish a relationship between elements of two sets

Discrete Mathematics. 2. Relations

CSE 20 DISCRETE MATH. Winter

Functions and Their Graphs

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

VIII. NP-completeness

Matroids and submodular optimization

Math 42, Discrete Mathematics

Chapter 2 - Relations

Automata Theory for Presburger Arithmetic Logic

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

Unit i) 1)verify that [p->(q->r)] -> [(p->q)->(p->r)] is a tautology or not? 2) simplify the Boolean expression xy+(x+y) + y

The Complexity of Computing the Sign of the Tutte Polynomial

HOMEWORK #2 - MATH 3260

Equational Logic. Chapter Syntax Terms and Term Algebras

Outline. We will now investigate the structure of this important set.

MATH 363: Discrete Mathematics

Generating Permutations and Combinations

(c) Give a proof of or a counterexample to the following statement: (3n 2)= n(3n 1) 2

Sets. A set is a collection of objects without repeats. The size or cardinality of a set S is denoted S and is the number of elements in the set.

COMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University

1.3 Vertex Degrees. Vertex Degree for Undirected Graphs: Let G be an undirected. Vertex Degree for Digraphs: Let D be a digraph and y V (D).

(1) Which of the following are propositions? If it is a proposition, determine its truth value: A propositional function, but not a proposition.

Section 3.2 Recursively Defined Functions and Procedures

IS 709/809: Computational Methods in IS Research Fall Exam Review

Discrete Mathematics. Benny George K. September 22, 2011

4. How to prove a problem is NPC

CS1800 Discrete Structures Fall 2016 Profs. Gold & Schnyder April 25, CS1800 Discrete Structures Final

Sets, Functions and Relations

Chapter 0: Preliminaries

REVIEW FOR THIRD 3200 MIDTERM

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Section 14.1 Computability then else

Selected Solutions to Even Problems, Part 3

Models of Computation. by Costas Busch, LSU

Chapter 2 - Basics Structures

1. To be a grandfather. Objects of our consideration are people; a person a is associated with a person b if a is a grandfather of b.

Transcription:

Section 4. Equivalence Relations A binary relation is an equivalence relation if it has the three properties reflexive, symmetric, and transitive (RST). Examples. a. Equality on any set. b. x ~ y iff x = y over the set of strings {a, b, c}*. c. x ~ y iff x and y have the same birthday over the set of people. Example. For any set of arithmetic expressions E let e ~ e iff e and e have the same value for any assignment to the variables. Then ~ is RST. e.g., 4x + ~ (x + ). Quiz ( minutes). Which of the relations are RST? a. x R y iff x y or x > y over Z. b. x R y iff x y over Z. c. x R y iff x and y are both even over Z. Answers. Yes, No, No. Intersection Property. If E and F are RST over A, then E F is RST over A. Example. Let x ~ y iff x and y have the same birthday and the same family name. Then ~ is RST since it is the intersection of two RSTs. RSTs from functions (Kernel Relations). Any function ƒ : A B defines an RST on the set A by letting x ~ y iff ƒ(x) = ƒ(y). Example. Let x ~ y iff x mod n = y mod n over any set S of integers. Then ~ is an RST because it is the kernel relation of the function ƒ : S N defined by ƒ(x) = x mod n. Example. Let x ~ y iff x + y is even over Z. Then ~ is RST because x + y is even iff x and y are both even or both odd iff x mod = y mod. So ~ is the kernel relation of the Function ƒ : Z N defined by ƒ(x) = x mod.

Equivalence Classes If R is RST over A, then for each a A the equivalence class of a, denoted [a], is the set [a] = {x x R a}. Property: For every pair a, b A we have either [a] = [b] or [a] [b] =. Example. Suppose x ~ y iff x mod 3 = y mod 3 over N. Then the equivalence classes are, [0] = {0, 3, 6, } = {3k k N} [] = {, 4, 7, } = {3k + k N} [] = {, 5, 8, } = {3k + k N}. Notice also, for example, that [0] = [3] = [6] and [] [] =. A Partition of a set is a collection of nonempty disjoint subsets whose union is the set. Example. From the previous example, the sets [0], [], [] form a partition of N. Theorem (RSTs and Partitions). Let A be a set. Then the following statements are true.. The equivalence classes of any RST over A form a partition of A.. Any partition of A yields an RST over A, where the sets of the partition act as the equivalence classes. Example. Let x ~ y iff x mod = y mod over Z. Then ~ is an RST with equivalence classes [0], the evens, and [], the odds. Also {[0], []} is a partition of Z. Example. R can be partitioned into the set of half-open intervals {(n, n + ] n Z}. Then we have an RST ~ over R, where x ~ y iff x, y (n, n + ] for some n Z. Quiz ( minute). In the preceding example, what is another way to say x ~ y? Answer. x ~ y iff x = y.

Refinements of Partitions. If P and Q are partitions of a set S, then P is a refinement of Q if every A P is a subset of some B Q. Example. Let S = {a, b, c, d, e} and consider the following four partitions of S. P = {{a, b, c, d, e}}, P = {{a, b}, {c, d, e}}, P 3 = {{a}, {b}, {c}, {d, e}}, P 4 = {{a}, {b}, {c}, {d}, {e}}. Each P i is a refinement of P i. P is the coarsest and P 4 is the finest. Example. Let ~ 3 and ~ 6 be the following RSTs over N. x ~ 3 y iff x mod 3 = y mod 3 has the following three equivalence classes. [0] 3 = {3k k N}, [] 3 = {3k + k N}, [] 3 = {3k + k N}. x ~ 6 y iff x mod 6 = y mod 6 has the following six equivalence classes. [n] 6 = {6k + n k N} for n {0,,, 3, 4, 5}. Notice that [0] 6 [0] 3, [] 6 [] 3, [] 6 [] 3, [3] 6 [0] 3, [4] 6 [] 3, [5] 6 [] 3. So the partition for ~ 6 is a refinement of the partition for ~ 3. Quiz ( minutes). Are either of the RSTs ~ 3 and ~ refinements of the other? Answer. No, since [0] and [] are the even and odd natural numbers, there is no subset relationship with [0] 3, [] 3, and [] 3. Theorem (Intersection Property of RST) If E and F are RSTs over A, then the equivalence classes of E F have the form [x] E F = [x] E [x] F, where x A. 3

Example. Let ~ and ~ be the following RSTs over N. x ~ y iff x/4 = y/4 has equivalence classes [4n] = {4n, 4n +, 4n +, 4n + 3}. x ~ y iff x/6 = y/6 has equivalence classes [6n] = {6n, 6n +,, 6n + 5}. Let ~ = ~ ~. Then a few equivalence classes for ~ are: [0] ~ = [0] [0] = {0,,, 3} {0,,, 3, 4, 5} = {0,,, 3}. [4] ~ = [4] [4] = {4, 5, 6, 7} {0,,, 3, 4, 5} = {4, 5}. [6] ~ = [6] [6] = {4, 5, 6, 7} {6, 7, 8, 9, 0, } = {6, 7}. [8] ~ = [8] [8] = {8, 9, 0, } {6, 7, 8, 9, 0, } = {8, 9, 0, }. Quiz ( minutes). Do you see a pattern for the equivalence classes? Answer. [n] ~ = {n, n +, n +, n +3}. [n + 4] ~ = {n + 4, n + 5}. [n + 6] ~ = {n + 6, n + 7}. [n + 8] ~ = {n + 8, n + 9, n + 0, n +}. Generating Equivalence Relations The smallest equivalence relation containing a binary relation R (i.e., the equivalence closure of R) is tsr(r). Example. The order tsr is important. For example, let R = {(a, b), (a, c)} over {a, b, c}. Then notice that tsr(r) = {a, b, c} {a, b, c}, which is an equivalence relation. But str(r) = {a, b, c} {a, b, c} {(b, c), (c, b)}, which is not transitive. 4

Kruskal s Algorithm (minimal spanning tree) The algorithm starts with the finest partition of the vertex set and ends with the coarsest partition, where x ~ y iff there is a path between x and y in the current spanning tree.. Order the edges by weight into a list L; Set the minimal spanning tree T := ; and construct the initial classes of the form [v] = {v} for each vertex v.. while there are two or more equivalence classes do {x, y} := head(l); b L := tail(l); g 3 if [x] [y] then a c T := T {{x, y}}; e 3 replace [x] and [y] by [x] [y] f fi od d Example. For the pictured graph, Step gives a list of edges ordered by weight. L := {a, b}, {b, c}, {d, f}, {e, f}, {a, d}, {c, e}, {f, g}, {b, g}, {c, d}, {b, e}. T Equivalence Classes { } {a}, {b}, {c}, {d}, {e}, {f}, {g} T {{a, b}} {a, b}, {c}, {d}, {e}, {f}, {g} T {{b, c}} {a, b, c}, {d}, {e}, {f}, {g} T {{d, f}} {a, b, c}, {d, f}, {e}, {g} T {{e, f}} {a, b, c}, {d, e, f}, {g} T {{a, d}} {a, b, c, d, e, f}, {g} Bypass {c, e} T {{f, g}} {a, b, c, d, e, f, g} a d b c e f g 5