Discussion #26 Chapter 5, Sections 3.4-4.5 1/15 Discussion #26 Binary Relations: Operations & Properties.

Slides:



Advertisements
Similar presentations
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
Advertisements

Discussion #27 Chapter 5, Sections /15 Discussion #27 Closures & Equivalence Relations.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
Basic Properties of Relations
Discrete Mathematics Lecture # 16 Inverse of Relations.
Discrete Structures Chapter 5 Relations Nurul Amelina Nasharuddin Multimedia Department.
Chapter 3 Review MATH130 Heidi Burgiel. Relation A relation R from X to Y is any subset of X x Y The matrix of a Relation R is a matrix that has a 1 in.
1 Representing Relations Part 2: directed graphs.
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.
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.
1 Representing Relations Epp section ??? CS 202 Aaron Bloomfield.
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Math 3121 Abstract Algebra I Lecture 3 Sections 2-4: Binary Operations, Definition of Group.
Relations: Operations & Properties. Power Sets Set of all subsets of a set A. –A = {1,2} –P(A) = 2 A = { {}, {1}, {2}, {1,2} } We note that each element.
1 Relations and Their Properties Epp, section ??? CS 202 Aaron Bloomfield.
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.
Module #21 - Relations Representing Relations Rosen 6 th ed., Ch. 8.
Module #18: Relations, part I
Chapter 4 Relations and Digraphs
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.
INM175 Topic 7 1 Module INM175 Discrete Mathematics Topic 7 Set Theoretic Models.
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.
R. Johnsonbaugh, Discrete Mathematics 5 th edition, 2001 Chapter 2 The Language of Mathematics.
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.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
1 Relations and Their Properties Rosen, section 7.1 CS/APMA 202 Aaron Bloomfield.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Relations.
Discrete Mathematics Relation.
Relations and their Properties
CHAPTER 3 FUZZY RELATION and COMPOSITION. 3.1 Crisp relation Product set Definition (Product set) Let A and B be two non-empty sets, the product.
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
CS 103 Discrete Structures Lecture 19 Relations. Chapter 9.
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
1 Discrete and Combinatorial Mathematics R. P. Grimaldi, 5 th edition, 2004 Chapter 5 Relations and Functions.
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.
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,
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
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.
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.
Relations Compare with function – Function: Set of ordered pairs where x’s don’t repeat x’s come from domain; y’s come from co-domain Purpose: to transform.
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), (
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
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.
Chapter8 Relations 8.1: Relations and their properties.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Chapter 5 Relations and Operations
Relations and Their Properties
Relations Chapter 9.
Relations and Digraphs
Representing Relations
RELATION KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS )
Dr. Ameria Eldosoky Discrete mathematics
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Relations and Their Properties
Relations: Operations & Properties
CSNB 143 Discrete Mathematical Structures
Relations and Their Properties
8.1 Relations and Their Properties
Combining relations via relational composition
Agenda Lecture Content: Relations (Relasi)
Lecture # 16 Inverse of Relations
Relations 12/7/2019.
Presentation transcript:

Discussion #26 Chapter 5, Sections /15 Discussion #26 Binary Relations: Operations & Properties

Discussion #26 Chapter 5, Sections /15 Topics Inverse (converse) Set operations Extensions and restrictions Compositions Properties –reflexive, irreflexive –symmetric, antisymmetric, asymmetric –transitive

Discussion #26 Chapter 5, Sections /15 Inverse If R: A  B, then the inverse of R is R ~ : B  A. R -1 is also a common notation R ~ is defined by {(y,x) | (x,y)  R}. –If R = {(a,b), (a,c)}, then R ~ = {(b,a), (c,a)} –> is the inverse of < on the reals Note that R ~  ~R –The complement of < is  –But the inverse of (sometimes called converse)

Discussion #26 Chapter 5, Sections /15 Set Operations Since relations are sets, set operations apply (just like relational algebra). The arity must be the same  indeed, the sets for the domain space and range space must be the same (just like in relational algebra).

Discussion #26 Chapter 5, Sections /15 Restriction & Extension Restriction decreases the domain space or range space. Example: Let < be the relation {(1,2), (1,3), (2,3)}. The restriction of the domain space to {1} restricts < to {(1,2), (1,3)}. Extensions increase the domain space or range space. Example: Let < be the relation {(1,2), (1,3), (2,3)}. The extension of both the domain space and range space to {1,2,3,4} extends < to {(1,2), (1,3), (1,4), (2,3), (2,4), (3,4)} Extensions and restrictions need not change the relation. –Suppose {M 1, M 2, M 3 } are three males and {F 1, F 2, F 3 } are three females and married_to is {(M 1,F 3 ), (M 2,F 2 )}. –Removing the unmarried male M 3 or the unmarried female F 1 does nothing to the relation, and adding the unmarried male M 4 or the unmarried female F 4 does nothing to the relation.

Discussion #26 Chapter 5, Sections / Composition Let R:A  B and S:B  C be two relations. The composition of R and S, denoted by R  S, contains the pairs (x,z) if and only if there is an intermediate object y such that (x,y) is in R and (y,z) is in S. Given R:A  B and S:B  C, with A = {1,2,3,4}, B = {1,2,3,4,5}, C = {1,2,3,4}, and R = {(1,3), (4,2), (1,1)} and S = {(3,4), (2,1), (4,2)}, we have: R  S = {(1,4), (4,1)} S  R = {(3,2), (2,3), (2,1)} (i.e. not commutative) R  (S  R) = {(1,2), (4,3), (4,1)} (R  S)  R = {(1,2), (4,3), (4,1)} (i.e. is associative) R S Graphically:

Discussion #26 Chapter 5, Sections /15 Composition & Matrix Multiplication Relation matrices only contain 0’s and 1’s. For relational matrix multiplication, use  for *,  for +, with 1=T and 0=F R S R  S (1,1) = (1  0)  (0  1)  (1  0)  (0  0)  (0  0) = RSRS  = R  S = {(1,4), (4,1)}

Discussion #26 Chapter 5, Sections /15 Combined Operations All operations we have discussed can be combined so long as the compatibility requirements are met. Example: R = {(1,1), (3,1), (1,2)} S = {(1,1), (2,3)} (R  S) ~  R = {(1,1), (3,1), (1,2), (2,3)} ~  R = {(1,1), (1,3), (2,1), (3,2)}  R = {(1,1), (1,2), (2,1), (2,2)} R: A  B S: B  A A = {1,2,3} B = {1,2,3}

Discussion #26 Chapter 5, Sections /15 Properties of Binary Relations Properties of binary relations on a set R: A  A help us with lots of things  groupings, orderings, … Because there is only one set A: –matrices are square |A|  |A| –graphs can be drawn with only one set of nodes R = {(1,3), (4,2), (3,3), (3,4)}

Discussion #26 Chapter 5, Sections /15 Reflexivity Reflexive:  x(xRx) Irreflexive:  x(xRx) = is reflexive  is irreflexive  is reflexive< is irreflexive “is in same major as” is reflexive “is sibling of” is irreflexive “loves” (unfortunately) is not reflexive, neither is it irreflexive Reflexive IrreflexiveNeither

Discussion #26 Chapter 5, Sections /15 Symmetry Symmetric:  x  y(xRy  yRx) Antisymmetric:  x  y(xRy  yRx  x = y) Asymmetric:  x  y(xRy  yRx) “sibling” is symmetric “brother_of” is not symmetric, in general, but symmetric if restricted to males  is antisymmetric (if a  b and b  a, then a=b) < is asymmetric and antisymmetric = is symmetric and antisymmetric  is antisymmetric “loves” (unfortunately) is not symmetric, neither is it antisymmetric nor asymmetric

Discussion #26 Chapter 5, Sections /15 Symmetry (continued…) symmetric: antisymmetric: SymmetricAntisymmetric (Asymmetric too, if no 1’s on the diagonal) No symmetry properties (always both ways) (but to self is ok) (never both ways) asymmetric: (and never to self) (never both ways)

Discussion #26 Chapter 5, Sections /15 Transitivity Transitive:  x  y  z(xRy  yRz  xRz) “taller” is transitive < is transitivex<y<z “ancestor” is transitive “brother-in-law” is not transitive Transitive: “If I can get there in two, then I can get there in one.” (for every x, y, z) if and then x y z

Discussion #26 Chapter 5, Sections /15 Transitivity (continued…) Note: xRy  yRz corresponds to xR  Rz, which is equivalent to xR×Rz = xR 2 z; thus we can define transitivity as:  x  y  z(xR 2 z  xRz) “If I can get there in two, then I can get there in one.” For transitivity: –if reachable through an intermediate, then reachable directly is required. –if (x,z)  R 2, then (x,z)  R  (x,z)  R 2  (x,z)  R  R 2  R ( recall our def. of subset: x  A  x  B, then A  B)

Discussion #26 Chapter 5, Sections /15 Transitivity (continued…)  =  = R R R 2  R R R Not Transitive Transitive 1 2 3