Lecture 4.3: Closures and Equivalence Relations

Slides:



Advertisements
Similar presentations
Representing Relations Using Matrices
Advertisements

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.
Applied Discrete Mathematics Week 10: Equivalence Relations
Lecture 4.5: POSets and Hasse Diagrams CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
9/8/2011Lecture Functions1 Lecture 2.4: Functions CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
Exam 2 Review 8.2, 8.5, 8.6, Thm. 1 for 2 roots, Thm. 2 for 1 root Theorem 1: Let c 1, c 2 be elements of the real numbers. Suppose r 2 -c 1.
Exam 2 Review 7.5, 7.6, |A1  A2  A3| =∑|Ai| - ∑|Ai ∩ Aj| + |A1∩ A2 ∩ A3| |A1  A2  A3  A4| =∑|Ai| - ∑|Ai ∩ Aj| + ∑ |Ai∩ Aj ∩ Ak| - |A1∩
Lecture 3.1: Mathematical Induction CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 2.2: Set Theory* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda.
1 Lecture 3.3: Recursion CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 4.3: Closures and Equivalence Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 2.1: Sets and Set Operations CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 4.2: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Lecture 2.2: Set Theory CS 250, Discrete Structures, Fall 2015 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Lecture 4.2: Relations CS 250, Discrete Structures, Fall 2013 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
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.
Lecture 4.4: Equivalence Classes and Partially Ordered Sets CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda.
Lecture 1.5: Proof Techniques CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren 1.
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
9/29/2011Lecture Strong Induction1 Lecture 3.2: Strong Induction CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures.
9/27/2011 Lecture Mathematical Induction1 Lecture 3.1: Mathematical Induction* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from.
Chapter8 Relations 8.1: Relations and their properties.
Lecture 1.5: Proof Techniques
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Representing Relations Using Digraphs
Discrete Mathematical
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Lecture 5.4: Paths and Connectivity
Relations.
Equivalence Relations
Lecture # 14 Types of Relations
Lecture 4.1: Relations Basics
Lecture 1.5: Proof Techniques
CS 173: Discrete Mathematical Structures
Applied Discrete Mathematics Week 9: Equivalence Relations
Lecture 3.2: Induction and Strong Induction (contd.)
8.5 Equivalence Relations
Lecture 4.1: Relations Basics
Lecture 3.2: Induction, and Strong Induction
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
Lecture 3.2: Induction and Strong Induction (contd.)
CS 250, Discrete Structures, Fall 2014
Lecture 3.2: Induction, and Strong Induction
CS 250, Discrete Structures, Fall 2014
CS 250, Discrete Structures, Fall 2015
CS 250, Discrete Structures, Fall 2015
Lecture 4.3: Closures and Equivalence Relations
Lecture 3.2: Induction, and Strong Induction
Lecture 1.6: Proof Techniques (contd)
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
Lecture 2.1: Sets and Set Operations*
CS 250, Discrete Structures, Fall 2013
CS 250, Discrete Structures, Fall 2013
Lecture 3.1: Mathematical Induction
Lecture 4.1: Relations Basics
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Lecture 1.6: Proof Techniques (contd)
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
9.5 Equivalence Relations
Equivalence relations
Lecture 3.1: Mathematical Induction
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
CS 250, Discrete Structures, Fall 2012
Presentation transcript:

Lecture 4.3: Closures and Equivalence Relations CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren

Course Admin Mid-Term 2 Exam HW3 Solution will be posted soon Should have the results this week HW3 Should have the results soon If you haven’t picked up your previous graded submissions, please do so from my office 9/6/2018

Outline Closures Equivalence Relations 9/6/2018

R’ = R U {(1,1),(4,4)} is called the reflexive closure of R. Consider relation R={(1,2),(2,2),(3,3)} on the set A = {1,2,3,4}. Is R reflexive? No What can we add to R to make it reflexive? (1,1), (4,4) R’ = R U {(1,1),(4,4)} is called the reflexive closure of R. 9/6/2018

Closure Definition: The closure of relation R on set A with respect to property P is the relation R’ with R  R’ R’ has property P S with R  S and S has property P, R’  S. 9/6/2018

Reflexive Closure Let r(R ) denote the reflexive closure of relation R. Then r(R ) = R U { } Fine, but does that satisfy the definition? R  r(R ) r(R ) is reflexive Need to show that for any S with particular properties, r(R )  S. Let S be such that R  S and S is reflexive. Then {(a,a):  a  A }  S (since S is reflexive) and RS (given). So, r(R )  S. (a,a):  a  A We added edges! By defn 9/6/2018

Symmetric Closure Let s(R ) denote the symmetric closure of relation R. Then s(R ) = R U { } Fine, but does that satisfy the definition? R  s(R ) s(R ) is symmetric Need to show that for any S with particular properties, s(R )  S. Let S be such that R  S and S is symmetric. Then {(b,a): (a,b)  R }  S (since S is symmetric) and RS (given). So, s(R )  S. (b,a): (a,b)  R We added edges! By defn 9/6/2018

Transitive Closure Let t(R ) denote the transitive closure of relation R. Then t(R ) = R U { } (a,c): b (a,b),(b,c)  R Example: A={1,2,3,4}, R={(1,2),(2,3),(3,4)}. Apply definition to get: t(R ) = {(1,2),(2,3),(3,4), } (1,3), (2,4) Which of the following is true: This set is transitive, but we added too much. This set is the transitive closure of R. This set is not transitive, one pair is missing. This set is not transitive, more than 1 pair is missing. 9/6/2018

Transitive Closure So how DO we find the transitive closure? Draw a graph. Example: A={1,2,3,4}, R={(1,2),(2,3),(3,4)}. 1 2 3 4 Define a path in a relation R, on A to be a sequence of elements from A: a,x1,…xi,…xn-1,b, with (a, x1)  R, i (xi,xi+1)  R, (xn-1,b)  R. 9/6/2018 “Path from a to b.”

Transitive Closure   9/6/2018

Transitive Closure -- Example   1 9/6/2018

Equivalence Relations Example: Let S = {people in this classroom}, and let R = {(a,b): a has same # of coins in his/her bag as b} Quiz time: Is R reflexive? Is R symmetric? Is R transitive? This is a special kind of relation, characterized by the properties it has. What’s special about it? Yes Everyone with the same # of coins as you is just like you. Yes Yes 9/6/2018

Equivalence Relations Formally: Relation R on A is an equivalence relation if R is Reflexive ( a  A, aRa) Symmetric (aRb --> bRa) Transitive (aRb AND bRc --> aRc) Recall: aRb denotes (a,b)  R. Example: S = Z (integers), R = {(a,b) : a  b mod 4} Is this relation an equivalence relation on S? Have to PROVE reflexive, symmetric, transitive. 9/6/2018

Equivalence Relations Example: S = Z (integers), R = {(a,b) : a  b mod 4} Is this relation an equivalence relation on S? Start by thinking of R a different way: aRb iff there is an int k so that a = 4k + b. Your quest becomes one of finding ks. Let a be any integer. aRa since a = 40 + a. Consider aRb. Then a = 4k + b. But b = -4k + a. Consider aRb and bRc. Then a = 4k + b and b = 4j + c. So, a = 4k + 4j +c = 4(k+j) + c. 9/6/2018

Equivalence Relations Example: S = Z (integers), R = {(a,b) : a = b or a =- b}. Is this relation an equivalence relation on S? Have to prove reflexive, symmetric, transitive. 9/6/2018

Equivalence Relations Example: S = R (real numbers), R = {(a,b) : a – b is an integer}. Is this relation an equivalence relation on S? Have to prove reflexive, symmetric, transitive. 9/6/2018

Equivalence Relations Example: S = R (real numbers), R = {(a,b) : a – b is an integer}. Is this relation an equivalence relation on S? Have to prove reflexive, symmetric, transitive. 9/6/2018

Equivalence Relations Example: S = N (natural numbers), R = {(a,b) : a | b}. Is this relation an equivalence relation on S? Have to prove reflexive, symmetric, transitive. 9/6/2018

Equivalence Classes Example: Back to coins in bags. Definition: Let R be an equivalence relation on S. The equivalence class of a  S, [a]R, is [a]R = {b: aRb} a is just a name for the equiv class. Any member of the class is a representative. 9/6/2018

Notice this is just a subset of S. Equivalence Classes Definition: Let R be an equivalence relation on S. The equivalence class of a  S, [a]R, is [a]R = {b: aRb} Notice this is just a subset of S. What does the set of equivalence classes on S look like? To answer, think about the relation from before: S = {people in this room} R = {(a,b) : a has the same # of coins in his/her bag as b} In how many different equivalence classes can each person fall? Similarly, consider the a  b mod 4 relation 9/6/2018

Today’s Reading Rosen 9.4 and 9.5 9/6/2018