1 Chapter 4 - 2 Equivalence, Order, and Inductive Proof.

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
Recursive Definitions and Structural Induction
Equivalence, Order, and Inductive Proof
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
Chapter 9 Connectivity 连通度. 9.1 Connectivity Consider the following graphs:  G 1 : Deleting any edge makes it disconnected.  G 2 : Cannot be disconnected.
CMPS 2433 Discrete Structures Chapter 5 - Trees R. HALVERSON – MIDWESTERN STATE UNIVERSITY.
Chap6 Relations Def 1: Let A and B be sets. A binary relation from A
Relations.
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?
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
Congruence of Integers
Equivalence Relations: Selected Exercises
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
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.
Discrete Structure Li Tak Sing( 李德成 ) Lectures 16,17,18,19 1.
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.
1 Section 1.4 Graphs and Trees A graph is set of objects called vertices or nodes where some pairs of objects may be connected by edges. (A directed graph.
1 Chapter Elementary Notions and Notations.
1 Chapter Facts about Functions. 2 Section 2.3 Properties of Functions Let ƒ : A → B be a function. There are three properties that ƒ might possess.
Discrete Math for CS Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
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.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
1 Closures of Relations: Transitive Closure and Partitions Sections 8.4 and 8.5.
Rosen, Section 8.5 Equivalence Relations
Language: Set of Strings
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
September1999 CMSC 203 / 0201 Fall 2002 Week #13 – 18/20/22 November 2002 Prof. Marie desJardins.
Mathematical Preliminaries
Reflexivity, Symmetry, and Transitivity Lecture 44 Section 10.2 Thu, Apr 7, 2005.
1 Chapter Equivalence, Order, and Inductive Proof.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
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.
1 Section 4.3 Order Relations A binary relation is an partial order if it transitive and antisymmetric. If R is a partial order over the set S, we also.
Section 7.5 Equivalence Relations Longin Jan Latecki Temple University, Philadelphia
Chapter Relations and Their Properties
1 Section 4.1 Properties of Binary Relations A binary relation R over a set A is a subset of A  A. If (x, y)  R we also write x R y. Example. Some sample.
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.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
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.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Equivalence Relations Lecture 45 Section 10.3 Fri, Apr 8, 2005.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 7 Relations.
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
“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.
Dilworth’s theorem and extremal set theory 張雁婷 國立交通大學應用數學系.
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
Relations and Their Properties
Introduction to Relations
Equivalence Relations
Relations Chapter 9.
Chapter 2 Sets and Functions.
Equivalence Relations
Equivalence Relations: Selected Exercises
Presentation transcript:

1 Chapter Equivalence, Order, and Inductive Proof

2 Section 4.2 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 1 ~ e 2 iff e 1 and e 2 have the same value for any assignment to the variables. Then ~ is RST. e.g., 4x + 2 ~ 2(2x + 1).

3 Quiz (2 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 | ≤ 2 over Z. c. x R y iff x and y are both even over Z. Answers. Yes, No, No.

4 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.

5 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 2 = y mod 2. So ~ is the kernel relation of the 1Function ƒ : Z → N defined by ƒ(x) = x mod 2.

6 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} [1] = {1, 4, 7, …} = {3k + 1 | k ∊ N} [2] = {2, 5, 8, …} = {3k + 2 | k ∊ N}. Notice also, for example, that [0] = [3] = [6] and [1] ∩ [2] = Ø.

7 Partition 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], [1], [2] form a partition of N. Theorem (RSTs and Partitions). Let A be a set. Then the following statements are true. 1. The equivalence classes of any RST over A form a partition of A. 2. Any partition of A yields an RST over A, where the sets of the partition act as the equivalence classes.

8 Examples Example. Let x ~ y iff x mod 2 = y mod 2 over Z. Then ~ is an RST with equivalence classes [0], the evens, and [1], the odds. Also {[0], [1]} is a partition of Z. Example. R can be partitioned into the set of half-open intervals {(n, n + 1] | n ∊ Z}. Then we have an RST ~ over R, where x ~ y iff x, y ∊ (n, n + 1] for some n ∊ Z. Quiz (1 minute). In the preceding example, what is another way to say x ~ y? Answer. x ~ y iff ⌈ x ⌉ = ⌈ y ⌉.

9 Refinements of Partitions 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. P1 = {{a, b, c, d, e}}, P2 = {{a, b}, {c, d, e}}, P3 = {{a}, {b}, {c}, {d, e}}, P4 = {{a}, {b}, {c}, {d}, {e}}. Each P i is a refinement of P i–1. P 1 is the “coarsest” and P 4 is the “finest”.

10 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}, [1] 3 = {3k + 1 | k ∊ N}, [2] 3 = {3k + 2 | 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, 1, 2, 3, 4, 5}. Notice that [0] 6 ⊂ [0] 3, [1] 6 ⊂ [1] 3, [2] 6 ⊂ [2] 3, [3] 6 ⊂ [0] 3, [4] 6 ⊂ [1] 3, [5] 6 ⊂ [2] 3. So the partition for ~ 6 is a refinement of the partition for ~ 3.

11 Quiz (2 minutes) Quiz (2 minutes). Are either of the RSTs ~ 3 and ~ 2 refinements of the other? Answer. No, since [0] 2 and [1] 2 are the even and odd natural numbers, there is no subset relationship with [0] 3, [1] 3, and [2] 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.

12 Example Example. Let ~ 1 and ~ 2 be the following RSTs over N. x ~ 1 y iff ⌊ x/4 ⌋ = ⌊ y/4 ⌋ has equivalence classes [4n] 1 = {4n, 4n + 1, 4n + 2, 4n + 3}. x ~ 2 y iff ⌊ x/6 ⌋ = ⌊ y/6 ⌋ has equivalence classes [6n] 2 = {6n, 6n + 1,, …, 6n + 5}. Let ~ = ~ 1 n ~ 2. Then a few equivalence classes for ~ are: [0] ~ = [0] 1 ∩ [0] 2 = {0, 1, 2, 3} ∩ {0, 1, 2, 3, 4, 5} = {0, 1, 2, 3}. [4] ~ = [4] 1 ∩ [4] 2 = {4, 5, 6, 7} ∩ {0, 1, 2, 3, 4, 5} = {4, 5}. [6] ~ = [6] 1 ∩ [6] 2 = {4, 5, 6, 7} ∩ {6, 7, 8, 9, 10, 11} = {6, 7}. [8] ~ = [8] 1 ∩ [8] 2 = {8, 9, 10, 11} ∩ {6, 7, 8, 9, 10, 11} = {8, 9, 10, 11}.

13 Quiz (2 minutes) Do you see a pattern for the equivalence classes? Answer. [12n] ~ = {12n, 12n + 1, 12n + 2, 12n +3}. [12n + 4] ~ = {12n + 4, 12n + 5}. [12n + 6] ~ = {12n + 6, 12n + 7}. [12n + 8] ~ = {12n + 8, 12n + 9, 12n + 10, 12n +11}.

14 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.

15 Kruskal’s Algorithm 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. 1. 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. 2. while there are two or more equivalence classes do {x, y} := head(L); L := tail(L); if [x] ≠ [y] then T := T ⋃ {{x, y}}; replace [x] and [y] by [x] ⋃ [y] fi od

16 Example

17 The End of Chapter 4 - 2