Vous êtes sur la page 1sur 9

CS 205 Quiz #5A Oct 18, 2012

NAME: _________________________SOLUTIONS_______________________________________

RUID:___________________________________________________________________________

Electronic Devices are not permitted during the quiz. These include but are not restricted to calculators, computers and cell phones. No communication between students or anyone outside of class is permitted during the quiz. Textbooks, notes and any other written materials are not permitted during the quiz.

DO NOT OPEN UNTIL INSTRUCTED TO DO SO

1. Do the following relations satisfy the definitions of the listed terms? For each blank, write True if the relation satisfies the definition, False if it does not satisfy the definition or Insufficient if there is not enough information to conclude if the relation satisfies the definition. 1 point each blank a) f(x) = 2x - 1, where f : R R

______True_________ ______True_________ ______True_________

Function Surjective Function Invertible Function

______True_________ ______True_________

Injective Function Bijective Function

______False_________ Partial Function (not a Total Function)

Inverse is f(y) = (y + 1) / 2 b) f(x) = 2x - 1, where f : Z Z

______True_________

Function

______True_________

Injective Function

______False_________ Surjective Function ______False_________ Invertible Function

______False_________ Bijective Function ______False_________ Partial Function (not a Total Function)

Given the domain, it is impossible to reach every value in the codomain. For example, 0 is unreachable. So it is not surjective. Also note that strictly increasing implies it is injective. c) f(x) = x2, where f : Z Z

______True_________

Function

______False_________ Injective Function ______False_________ Bijective Function ______False_________ Partial Function (not a Total Function)

______False_________ Surjective Function ______False_________ Invertible Function

f(1) = f(-1), so not injective. Negative integers are unreachable, so not surjective. (Non-perfect squares also unreachable)

1. cont) d) f(x) = 2x, where f : Z R

______True_________

Function

______True_________

Injective Function

______False_________ Surjective Function ______False_________ Invertible Function

______False_________ Bijective Function ______False_________ Partial Function (not a Total Function)

Strictly increasing, so injective. Negative numbers unreachable, so not surjective. e) f(x) = (x + 1) / (x 2), where f : Z R

______False_________ Function ______False_________ Surjective Function ______False_________ Invertible Function

______False_________ Injective Function ______False_________ Bijective Function ______True_________ Partial Function (not a Total Function)

f(2) is undefined, so it is not a function since 2 Z (the domain) f) f(m, n) = 2m - n, where f : Z Z Z

______True_________ ______True_________

Function Surjective Function

______False_________ Injective Function ______False_________ Bijective Function ______False_________ Partial Function (not a Total Function)

______False_________ Invertible Function

f(0, -n) = n, so it is surjective. f(0,0) = f(1,2), so it is not injective.

1. cont) g) f(m, n) = m n, where f : R R R

______True_________ ______True_________

Function Surjective Function

______False_________ Injective Function ______False_________ Bijective Function ______False_________ Partial Function (not a Total Function)

______False_________ Invertible Function

f(1, n) = n, so it is surjective. f(1, 2) = f(2,1), so it is not injective. h) f(m, n) = 5, where f : R R R

______True_________

Function

______False_________ Injective Function ______False_________ Bijective Function

______False_________ Surjective Function ______False_________ Invertible Function

______False_________ Partial Function (not a Total Function) Everything maps to the same value in the codomain, so it is neither injective nor surjective.

2. For each of the following, you are given some amount of information regarding a relation. The task is to determine if the relation is invertible. In each blank write True if the corresponding relation is invertible, False if it is not invertible, or Insufficient if there is not enough information to determine whether or not it is invertible. 3 points each blank ______True________ a) A bijective function from the domain of all integers to the codomain of all integers. The function is also surjective. All bijections are invertible. All bijections are also surjections. ______False_______ b) A function from the domain of all real numbers to the codomain of the positive integers less than 100. The domain is much larger than the codomain, so it is impossible for it to be injective. ____Insufficient_____ c) A partial function from the domain of all real numbers to the codomain of the positive integers less than 100. Unlike (a), this is a partial function, so it is conceivable to make it both surjective and injective. So, it could be invertable. ____Insufficient_____ d) A strictly decreasing function. This is injective, but we cannot tell if it is surjective. ______False_______ e) An injective function that is not surjective. The functions domain and codomain are both the real numbers. It must be surjective to be invertible. ____Insufficient_____ f) A relation g from A to B, where: a A, g(a) = b such that b B (a1, a2) A A, a1 a2 g(a1) g(a2) The first point tells us it is a function. The second tells us it is injective. We do not know if it is surjective.

______True________

g) A relation h from A to B, where A = { 2, 1, 3 } B = { 6, 1, -2 } h(x) = x2 - 3 Over the specified domain and codomain, this is a bijection.

______True________

h) A function where every unique element in the codomain has a unique preimage. Since every element in the codomain is covered, it is surjective. Since every element in the codomain has a unique preimage, it must be injective, otherwise an element in the codomain would have more than one preimage.

____Insufficient_____

i)

A surjective function where both the domain and codomain are the positive integers. We cannot tell if this is injective.

______True________

j)

The relation, f, from the set of U.S. states to its alphabetical ordinal rank id. (i.e. f(Alabama) = 1, f(Alaska) = 2, , f(Wyoming) = 50). The codomain is the positive integers less than or equal to 50. This is a bijection.

3. For each of the following sets of tuples, determine if there exists a functional dependency between the first and second elements. That is: 2 points each blank i. If R = {(a1,b1), (a2,b2), ... }, does R = {(x, f(x)) | x {a1, a2, ...} } for some function f ?

We can also say there is an inverse functional dependency if there is a functional dependency between the first and second elements as well as an inverse for that same function. That is: ii. Using R and f from (i) above, does R = {(f-1(y), y) | y {b1, b2, ...} } ?

Answer True in blanks where the corresponding definition is met, otherwise answer False.

a) { (1,1), (2,2), (3,3), (4,4) }

______True________

Functional Dependency

________True________

Inverse Functional Dependency

b) { (1,1), (2,1), (3,1), (4,1) } Inverse Functional Dependency

______True________

Functional Dependency

________False________

c) { (1,1), (1,2), (1,3), (1,4) } Inverse Functional Functional Dependency ________False*________ Dependency

________False_______

d) { (4,1), (2,2), (1,3), (3,4) } Inverse Functional Dependency

______True________

Functional Dependency

________True________

* True is also accepted here because it matches Prof. Imielinskis discussion of an inverse functional dependency

4. Let f be a function from A to B. Let S be a subset of B. We define the inverse image as F-1(S) = { a A | f(a) S } 4 points possible for each Answer the following questions. Example: If f: R R and f(x) = x2, what is F-1({ y R | 0 < y < 1 }) ? Answer: { a R | -1 < a < 0 0 < a < 1 } a) If f: R R and f(x) = -x, what is F-1( { 0, 1, 2 } ) ?

{ -2, -1, 0 }

b) If f: R R and f(x) = x2, what is F-1( { y R | y > 4 } ) ?

{ a R | a < -2 2 > a }

c) If f: R Z and f(x) = x, what is F-1( { 0, 1, 2 } ) ?

{ a R | -1 < a

2 }

d) If f: R R and f(x) = x mod 5, what is F-1( { 2 } ) ? { a Z+ | 5 \ (a-2) } (all positive integers divisible by 5 after being decreased by 2) Alternatively, { 2, 7, 12, 17, 22, ... } e) If f: R R and f(x) = lg x, what is F-1( { y R | 1 < y < 10 } ) ? (lg is logarithm base 2) 21 = 2 and 210 = 1024, so { a R | 2 < a 1024 }

5. Suppose we wish to define a function f: A B where A = { 1, 2, 3, 4, 5 } and B = { 1, 2, 3, 4, 5, 6 }. (Note: If calculations are too difficult, you do not have to simplify to a single number.) 4 points each blank

______7776___________ a) How many total functions are possible? 6 x 6 x 6 x 6 x 6 = 65 _______720___________ b) How many injective functions are possible? 6 x 5 x 4 x 3 x 2 _________0__________ c) How many surjective functions are possible? The domain is smaller than the codomain, so no surjective function is possible

6. Suppose Y is the set of all functions from A to B, where |A| = m and |B| = n. How many total functions are possible from X to Y if |X| = p ? |Y| = nm, so the number of functions from X to Y is nm ^ p 8 points possible (extra credit)

Vous aimerez peut-être aussi