Lecture 16 NotesIn this lecture we look at the following topics:
InversesWe will first talk about inverse relations. Let be a relation. Its inverse is defined as Note that . In other words, we flip the domain and co-domain of R. We also flip the tuples in . I.e., if then and vice versa. ExampleAs an example, write down the inverse of the following relation: Example-2Consider the relation defined as . Show that . Answer
To show that, we will first show that if then . Let . We have . Therefore, . Therefore, if then . Now, it is easy to show that (a) and (b) . Inverse of a FunctionThe inverse of a function is always a relation. On the other hand, the inverse of a function need not always be a function. For the figures below, say whether the function represented has an inverse or not. The top left function has an inverse. The others do not. We can look at graphs of functions to check if an inverse exists. Does the function depicted below have an inverse? We will expand on these topics when we learn about one-to-one and onto functions in the next lecture. Compositions of Relations and FunctionsGiven two functions or two relations, we can talk about the functional and relational compositions, respectively. Function CompositionLet us take two functions and . Function composition captures the application of followed by to get a new function , defined by The order of composition is important. Please note. Examples of Function CompositionWe will now do some examples. Example 1Take where and with . What is and ? Explain the difference by writing them out in closed form. Answer says that we first apply to and then apply on the result. Therefore we obtain . says that we first apply and then apply to yield . The order of composition can be really confusing. Relation CompositionRelation composition is similar to function composition. It is an important operation in databases and is therefore called a join of two relations in database jargon. Let and be two relations. We say that the composition of and is a relation such that The picture below provides an illustration: We see that and . Therefore . What other tuples exist in ? Answer . Example-2Suppose we provide a social network between people in the class in the form of the Friends relation, where iff is a friend of . How do we find friends of friends? Answer Simply do . Example-3Suppose we have a relation on movie stars wherein signifies that person and acted in the same film together. We wish to find out all people with six degrees of separation from Kevin Bacon. How do we do that? The answer is to find the relation Invertibility of FunctionsLet us now investigate the question of invertibility of functions. Suppose is a function from to , under what conditions does have an inverse function? Informally we can say the following:
Therefore, we define the following properties of functions:
|