CS 381 Solutins to Homework 12


Textbook pp. 146 - 147

2 (b) It is a function
   (c) It is not a function because f(-2) and f(2) are not defined.

4 (a) Domain: The set of natural numbers     Range: {0, 1, ..., 9}
   (c) Doamin: The set of binary numbers     Range: The set of natural numbers

12 (c) one-to-one
     (d) Not one-to-one because for example f(1) = f(2) = 1.

16 (a) f(x) = x2
     (c) f(x) = x + 1 if x is even and f(x) = x - 1 if x is odd.

18 (a) Bijection
     (b) Not a bijection

28 (a) The set of even numbers


Textbook pp. 191 - 192

2 (a) It is O(x2).
   (c) It is O(x2).
   (e) It is not O(x2).

8 (a) n = 4.

14 (c) Yes, x3 is O(x2 + x3).
    (d) Yes, x3 is O(x2 + x4).
    (e) Yes, x3 is O(3x).

20 (b) 6n (= 2n3n)
     (c) nnn!