Discrete Structures Chapter 5 Relations Nurul Amelina Nasharuddin Multimedia Department.

Slides:



Advertisements
Similar presentations
Relations Relations on a Set. Properties of Relations.
Advertisements

CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
Basic Properties of Relations
Discrete Mathematics Lecture # 16 Inverse of Relations.
CS2210(22C:19) Discrete Structures Relations Spring 2015 Sukumar Ghosh.
Chapter 7 Relations : the second time around
CSE115/ENGR160 Discrete Mathematics 05/03/11 Ming-Hsuan Yang UC Merced 1.
Discrete Structures Chapter 5 Relations and Functions Nurul Amelina Nasharuddin Multimedia Department.
Discrete Structures Chapter 2 Part A Sequences Nurul Amelina Nasharuddin Multimedia Department.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Discrete Structures Chapter 5 Relations and Functions
Relations binary relations xRy on sets x  X y  Y R  X  Y Example: “less than” relation from A={0,1,2} to B={1,2,3} use traditional notation 0 < 1,
Discrete Mathematics Lecture#11.
Reflexive -- First sentence of proof is: (1) Let x  Z (2) Let (x,x)  R. (3) Let (x,x)  I (4) Let x  R.
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Week 8 - Wednesday.  What did we talk about last time?  Cardinality  Countability  Relations.
Relations (1) Rosen 6 th ed., ch. 8. Binary Relations Let A, B be any two sets. A binary relation R from A to B, written (with signature) R:A↔B, is a.
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.
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.
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.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Discrete Mathematics Relation.
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.
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
CS 103 Discrete Structures Lecture 19 Relations. Chapter 9.
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
1 Partial Orderings Aaron Bloomfield CS 202 Epp, section ???
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
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,
1 Lecture 2: Relations Relations Reading: Epp Chp 10.1, 10.2.
Chapter Relations and Their Properties
1 RELATIONS Learning outcomes Students are able to: a. determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b. determine.
Equivalence 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.
1 Lecture 2 (part 1) Partial Orders Reading: Epp Chp 10.5.
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.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
ORDERED SETS. RELATIONS COSC-1321 Discrete Structures 1.
Chap. 7 Relations: The Second Time Around
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), (
Lecture 4.1: Relations Basics CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Week 8 - Monday.  What did we talk about last time?  Properties of functions  One-to-one  Onto  Inverses  Cardinality.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 41 May 7, 2008.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
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 is a relation on.
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
Relations and Their Properties
CSE 2813 Discrete Structures
Partial Orderings CSE 2813 Discrete Structures.
CSE15 Discrete Mathematics 05/03/17
Equivalence Relations
Relations Chapter 9.
Lecture # 14 Types of Relations
Representing Relations
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.
Formal Definition and Examples
CSE 321 Discrete Structures
9.5 Equivalence Relations
Lecture # 16 Inverse of Relations
Presentation transcript:

Discrete Structures Chapter 5 Relations Nurul Amelina Nasharuddin Multimedia Department

2 Objectives On completion of this topic, student should be able to: a.Determine the properties of relations – reflexive, symmetric, transitive, and antisymmetric b.Determine equivalence and partial order relations c.Represent relations using matrix and graph

Outline Properties of relations Matrix and graph representation of relations Equivalence relations Partial order relations 3

4 The most basic relation is “=” (e.g. x = y) Generally x R y  TRUE or FALSE ‒ R(x,y) is a more generic representation ‒ R is a binary relation between elements of some set A to some set B, where x  A and y  B Binary relations: x R y On sets x  X, y  Y R  X  Y Recall: Relations

5 Example “less than” relation from A={0,1,2} to B={1,2,3} Use traditional notation 0 < 1, 0 < 2, 0 < 3, 1 < 2, 1 < 3, 2 < 3 Or use set notation A  B={(0,1),(0,2),(0,3),(1,1),(1,2),(1,3),(2,1),(2,2), (2,3)} R={(0,1),(0,2),(0,3),(1,2),(1,3),(2,3)}  A  B Or use Arrow Diagrams

6 Reflexive: Let R be a binary relation on a set A Eg: Let A = {1,2,3,4} R 1 ={(1,1),(1,2),(2,2),(2,3),(3,3),(4,4)}  R 1 is reflexive R 2 = {(1,1),(2,2),(3,3)}  R 2 is not reflexive (why?) Properties of Relations

7 Symmetric: Let R be a binary relation on a set A Eg: Let A = {1,2,3} R 1 ={(1,2),(2,1),(1,3),(3,1)}  R 1 is symmetric R 2 = {(1,1),(2,2),(3,3),(2,3)}.  R 2 is not symmetric because (3,2)  R 2 Properties of Relations

8 Transitive: Let R be a binary relation on a set A Let A = {1,2,3,4} R = {(2,1),(3,1),(3,2),(4,1),(4,2),(4,3)} R is transitive because (3,2) & (2,1) → ( 3,1) (4,2) & (2,1) → (4,1) (4,3) & (3,1) → (4,1) (4,3) & (3,2) → (4,2) Properties of Relations

9 xRy or (x,y)  R for all x and y in A, 1.R is reflexive  for all x in A, (x,x)  R 2.R is symmetric  for all x and y in A, if (x,y)  R then (y,x)  R 3.R is transitive  for all x, y and z in A, if (x,y)  R and (y,z)  R then (x,z)  R

10 Example (1) Define a relation of A called R A = {2,3,4,5,6,7,8,9} R = {(4,4),(4,7),(7,4),(7,7),(2,2),(3,3),(3,6),(3,9), (6,6),(6,3),(6,9),(9,9),(9,3),(9,6)} Is R Reflexive? No Symmetric? Yes Transitive? Yes

11 Example (2) A = {0,1,2,3} R over A = {(0,0),(0,1),(0,3),(1,0), (1,1),(2,2),(3,0),(3,3)} Is R Reflexive? Yes. Symmetric? Yes. Transitive? No. (1,0),(0,3)  R but (1,3)  R

12 Proving Properties on Infinite Sets -“equal” relation (1) Define a relation R on R (the set of all real numbers): For all x, y  R, x R y ↔ x = y Is R reflexive? symmetric? transitive? R is reflexive iff  x  R, x R x. By definition of R, this means x = x, for all x  R. This is true, since every real number is equal to itself. Hence, R is reflexive

13 Proving Properties on Infinite Sets -“equal” relation (1) R is symmetric iff  x,y  R, if x R y then y R x. By definition of R, this means that  x,y  R, if x = y then y = x. So this is true; if one number is equal to a second, then the second is equal to the first. Hence, R is symmetric R is transitive iff  x,y  R, if x = y and y = z, then x = z. So this is true; if one real number equals to a second, and the second equals a third, then the first equals the third

14 Proving Properties on Infinite Sets -“less than” relation (1) Define a relation R on R (the set of all real numbers): For all x, y  R, x R y ↔ x < y Is R reflexive? symmetric? transitive?

15 Proving Properties on Infinite Sets -“less than” relation (2) R is reflexive iff  x  R, x R x. By definition of R, this means x < x, for all x  R. But this is false. Hence, R is not reflexive R is symmetric iff  x,y  R, if x R y then y R x. By definition of R. This means that  x,y  R, if x x. But this is false. Hence, R is not symmetric R is transitive iff  x,y,z  R, if x < y and y < z, then x < z. Hence, R is transitive

16 Properties of Congruence Modulo 3 (1) Define a relation R on Z: For all m,n  Z, m R n  3|(m – n) R is called congruence modulo 3 Is R reflexive? Is R symmetric? Is R transitive?

17 Properties of Congruence Modulo 3 (2) R is reflexive iff for all m in Z, m R m. By definition of R, this means 3|m – m or 3|0. This is true since 0 = 0. 3, so R is reflexive R is symmetric iff for all m,n in Z, m R n then n R m. By definition of R, this means if 3|(m – n) then 3|(n – m). This is true m – n = 3k, for some integer k n – m = - (m – n) = 3(-k) Hence 3|(n – m). Therefore R is symmetric

18 Properties of Congruence Modulo 3 (2) R transitive iff for all m,n,p  Z, if m R n and n R p then m R p. By definition of R, if 3|(m – n) and 3|(n – p) then 3|(m – p). So by definition of divide m – n = 3r for some r n – p = 3s for some s It is crucial to observe that (m – n) + (n – p) = m – p (m – n) + (n – p) = m – p = 3r + 3s m – p = 3(r + s) Hence 3|(m – p). Therefore, R is transitive

19 Matrix Representation of a Relation M R = [m ij ] (where i=row, j=col)  m ij ={1 iff (i,j)  R and 0 iff (i,j)  R} Eg: R : {1,2,3}  {1,2} where x > y R = {(2,1),(3,1),(3,2)}

20 Example Example: A = {1,2,3,4}, B = {w,x,y,z} R = {(1,x),(2,x),(3,y),(3,z)} = zero-one matrix

21 Graph Representation of a Relation Let A = {1,2,3,4} and R is relation on A where R = {(1,1),(1,2),(2,3),(3,2),(3,3),(3,4),(4,2)}

22 Union, Intersection, Difference and Composition of Relations R: A  B and S: A  B R: A  B and S: B  C

23 Composition of Relations Example: A = {1,2,3,4}, B = {w,x,y,z}, C = {5,6,7}, R 1 : A  B = {(1,x),(2,x),(3,y),(3,z)} and R 2 : B  C = {(w,5),(x,6)} Therefore, R 2 o R 1 = {(1,6),(2,6)}

24 Equivalence Relations Any binary relation that is: Reflexive Symmetric Transitive Eg: A = {1,2,3}, R = {(1,1),(2,2),(2,3),(3,2),(3,3)} R is reflexive, symmetric and transitive Therefore, R is an equivalence relation Recall example earlier: Congruence modulo 3 is an equivalence

25 Antisymmetry Relations Let R be a relation on a set A. R is antisymmetric iff for all a and b in A, if a R b and b R a then a = b In other words, a relation is antisymmetric iff there are no pairs of distinct elements a and b with a related to b and b related to a Eg: Let A = {0,1,2} R 1 = {(0,2),(1,2),(2,0)}. R 1 is not antisymmetric R 2 = {(0,0),(0,1),(0,2),(1,1),(1,2)}. R 2 is antisymmetric

26 Example (1) Let A = {1,2,3}, R = {(1,2),(2,1),(2,3)} R is not symmetric, (3,2)  R R is also not antisymmetric because (1,2),(2,1)  R Let A = {1,2,3}, S = {(1,1),(2,2)} S is both symmetric and antisymmetric

27 Example (2) Let R 1 be the divides relation (a|b) on Z + Is R 1 antisymmetric? Prove or give counterexample If a R 1 b and b R 1 a, then a = b a R 1 b means a|b → b = k 1 a b R 1 a means b|a → a = k 2 b It follows that, b = k 1 a = k 1 (k 2 b) = (k 1 k 2 )b Thus, k 1 = k 2 = 1. Hence a = b  R 1 antisymmetric

28 Example (2) Let R 2 be the divides relation on Z Is R 2 antisymmetric? Prove or give counterexample. Let a = 2, b = -2 Hence, a|b (-2 = -1(2)) and b|a (2 = -1(-2)) but a  b  R 2 is not antisymmetric

29 Partial Order Relations Any binary relation that is: Reflexive Antisymmetric Transitive Partial Order Set (POSET) (S,R) = R is a partial order relation on set S Examples: (Z,  ) (Z +,|){note: | symbolizes divides}

30 Quiz 5 Exercise 10.2 (No. 1, 2, 16) Exercise 10.5 (No. 2, 5) Send your answers in the next class!