Presentation is loading. Please wait.

Presentation is loading. Please wait.

Relations Relations between sets are like functions, but with a more general definition (given later). presentations: a set, a binary matrix, a graph…

Similar presentations


Presentation on theme: "Relations Relations between sets are like functions, but with a more general definition (given later). presentations: a set, a binary matrix, a graph…"— Presentation transcript:

1 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

2 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

3 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.

4 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?

5 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 ”

6 Inverse functions A domainB codomain f a c d p q r f -1 A codomain a c d B domain p q r

7 Composing functions A domainB codomain f a b c d p q r B domain p q r g C codomain 2 15 4 codomain composite domain a b c d A domain C codomain 2 15 4

8 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?

9 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

10 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.

11 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

12 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

13 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

14 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

15 Inverse relations A B R a c d p q r b R -1 A a c d B p q r b

16 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) }

17 Inverse relations A B R a c d p q r b R -1 A a c d B p q r b

18 Composing relations A B R a b c d p q r B p q r S C 2 15 4 composite a b c d A C 2 15 4

19 Distinguished types of relation A function from set A to set B is a relation between A and B such that

20 Distinguished types of relation A reflexive relation on set A is a relation on A such that

21 Distinguished types of relation A symmetric relation on set A is a relation on A such that

22 Distinguished types of relation An antisymmetric relation on set A is a relation on A such that

23 Distinguished types of relation A transitive relation on set A is a relation on A such that

24 Distinguished types of relation A partial ordering on set A is a reflexive, antisymmetric and transitive relation on A

25 Distinguished types of relation A total ordering on set A is a partial ordering on A with

26 Distinguished types of relation An equivalence relation on set A is a relation on A which is reflexive, symmetric and transitive.


Download ppt "Relations Relations between sets are like functions, but with a more general definition (given later). presentations: a set, a binary matrix, a graph…"

Similar presentations


Ads by Google