270 likes | 518 Views
Relations Relations between sets are like functions, but with a more general definition (given later). presentations: a set, a binary matrix, a graph… distinguished types: orderings, symmetric, reflexive, transitive,... By the end of the next two weeks you should be able to.
E N D
Relations Relations between sets are like functions, but with a more general definition (given later). presentations: a set, a binary matrix, a graph… distinguished types: orderings, symmetric, reflexive, transitive,... By the end of the next two weeks you should be able to say what a relation is translate between different presentations recognise (and prove) if a relation is of a certain type
f A domain B codomain Functions Recall a function f from set A to set B gave a unique element of B for every element of A. Also partial functions allow some domain elements without images
f a p b q c r d A domain B codomain Describing functions using pairs Functions on finite sets can be defined by listing pairs (x, f(x)) f can be given by the set {(a,p), (b,p), (d,p), (c,q) }, a subset of the Cartesian product of A and B.
f a p b q c r d A domain B codomain Describing functions using a table Functions on finite sets can be defined using a table Notice that all columns sum to 1 - why?
f a p b q c r d A domain B codomain Reading or writing functions Write f(a) = p or say “ f of a is p ” or “ f maps a to p ” or “ the image of a under f is p ”
f a p q c r d A domain B codomain f-1 a p q c r d A codomain B domain Inverse functions
f g a p p 2 b q q 15 c r r 4 d A domain B codomain B domain C codomain composite a 2 b 15 c 4 d A domain domain C codomain codomain Composing functions
Relations Some relations between sets don’t give functions. A B Q: why isn’t this a function from A to B? Q: why isn’t it a function from B to A?
R a p b q c r d A B Using pairs to describe a relation Relations can be defined using a set of pairs R is a relation between sets A and B . R can be given by the set {(a,p), (b,p), (b,q), (d,p), (c,q) }, a subset of the Cartesian product of A and B.
Formal definition of a relation A relation R between two sets A and B is a subset of the Cartesian product of A and B.
a p b q c r d A B Using a binary matrix to describe a relation There are no restrictions on the entries in this binary matrix for relations
Reading or writing relations R a p b q c r d A B Write aRp or a is related to p under R or R relates a to p or say a is related to p
A relation between two sets Given the set A = {(1,0), (2,0), (3,4), (1,1)} and the set B = {1, 2, 3, 4, 5} aRb iff a is at least distance b from the origin (0,0) Describe this relation using dots and arrows , using a set of pairs and using a binary matrix
A relation “on a set” On the set A = {1, 2, 3, 4} we can say that “3 is less than 4” (and other examples). The template “- is less than -” gives a relation between the set A and the set A (gives a relation “on the set A”) Describe this relation using dots and arrows , using a set of pairs and using a binary matrix
R a p q b c r d A B R-1 p a q b c r d A B Inverse relations
R a p q b c r d A B R-1 p a q b c r d A B Inverse relations R = { (a,p), (a,r), (c,q), (d,p), (d,q) } R -1 = { (p,a), (r,a), (q,c), (p,d), (q,d) }
R a p q b c r d A B R-1 p a q b c r d A B Inverse relations
a 2 b 15 c 4 d A C Composing relations R S a p p 2 b q q 15 c r r 4 d A B B C composite
Distinguished types of relation A function from set A to set B is a relation between A and B such that
Distinguished types of relation A reflexive relation on set A is a relation on A such that
Distinguished types of relation A symmetric relation on set A is a relation on A such that
Distinguished types of relation An antisymmetric relation on set A is a relation on A such that
Distinguished types of relation A transitive relation on set A is a relation on A such that
Distinguished types of relation A partial ordering on set A is a reflexive, antisymmetric and transitive relation on A
Distinguished types of relation A total ordering on set A is a partial ordering on A with
Distinguished types of relation An equivalence relation on set A is a relation on A which is reflexive, symmetric and transitive.