Exercises - Functions and Relations - With Answers
Exercises - Functions and Relations - With Answers
Functions
1) Consider the diagrams ( ), ( ) and ( ) below.
2) The diagram below show the composition of the two functions and : ∘
Answer:
: Not injectiive, not surjective, not bijective.
: Surjective, not injective, not bijective.
: Injective, not surjective, not bijective.
: Not injective, not surjective, not bijective.
: Injective, surjective and bijective.
4) Which of the functions depicted in exercise 3) have inverse functions? For each of the functions
which has an inverse, draw a diagram of the inverse function.
Answer: Only the function has an inverse function:
Consider the function : {−2, −1, 0, 1, 2} → ℤ defined by ( ) = | |.
a. Draw a graph of the function.
Answer:
Answer:
Relations
5) Consider the binary relation between the sets = {1, 2, 3} and = { , , , } given by =
{(1, ), (1, ), (3, ), (3, )}.
a. Draw an arrow diagram of .
b. Draw a table over
Answer:
6) Consider the binary relation from the set = {1,2,3,4} to the set = {0,3,5,8} defined by
( , ) ∈ for ( , ) ∈ × iff ≤ .
a. Draw an arrow diagram of the relation
b. Write as a subset of ×
Answer: = {( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), ( , ), }
c. Draw a table over the relation
Anwer (a and c):
7) Consider the relations Actors, Directors and Movies given below.
Carry out the following operations (hint: if you do not want to write big tables by hand, you can copy and
modify the tables from this document instead) :
a) Selection: Title Pulp Fiction (Actors)
Answer:
Name Title
b) Projection: Π , (Movies)
Answer:
Title Year
Godfather 1972
Godfather II 1974
Answer:
Name Title
Answer:
Name Title
Coppola Godfather
Coppola Godfather II
Answer: