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
Functions Recall a function f from set A to set B gave a unique element of B for every element of A. A domainB codomain f Also partial functions allow some domain elements without images
Describing functions using pairs Functions on finite sets can be defined by listing pairs (x, f(x)) A domainB codomain f a b c d p q r 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.
Describing functions using a table Functions on finite sets can be defined using a table A domainB codomain f a b c d p q r Notice that all columns sum to 1 - why?
Reading or writing functions A domainB codomain f a b c d p q r Writef(a) = p or say“ f of a is p ” or“ f maps a to p ” or“ the image of a under f is p ”
Inverse functions A domainB codomain f a c d p q r f -1 A codomain a c d B domain p q r
Composing functions A domainB codomain f a b c d p q r B domain p q r g C codomain codomain composite domain a b c d A domain C codomain
Relations Some relations between sets don’t give functions. AB Q: why isn’t this a function from A to B? Q: why isn’t it a function from B to A?
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. A B a b c d p q r R
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.
Using a binary matrix to describe a relation There are no restrictions on the entries in this binary matrix for relations A B a b c d p q r
Reading or writing relations A B a b c d p q r WriteaRp ora is related to p under R orR relates a to p or saya is related to p R
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
Inverse relations A B R a c d p q r b R -1 A a c d B p q r b
Inverse relations A B R a c d p q r b R -1 A a c d B p q r b R = { (a,p), (a,r), (c,q), (d,p), (d,q) } R -1 = { (p,a), (r,a), (q,c), (p,d), (q,d) }
Inverse relations A B R a c d p q r b R -1 A a c d B p q r b
Composing relations A B R a b c d p q r B p q r S C composite a b c d A C
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.