CS 381 Solutions to Homework 12



Textbook pp. 67 - 68:



2
a) Not a function because it gives two values for every $n$ except 0.
c) Not a function because $f(2)$ is not defined.



4
a) Domain: The set of nonnegative integers
Range: { 0, 1, 2, ..., 9 }



c) Domain: The set of bit strings
Range: The set of natural numbers



10
a) It is one-to-one. For if $x \neq y$, then $ x - 1 \neq y - 1$, and if $ x - 1 \neq y - 1$ then $x \neq y$.
b) It is not one-to-one because $f(2) = f(-2) = 5$ for example.



14
a) Bijection
b) Not bijection (not one-to-one)
c) Not bijection ($f(-2)$ is not defined)
d) Bijection (keeps increasing as x increases)



18 b) The set of even natural numbers.



Textbook pp. 90 - 91:



2
a) $(17x + 11)/x^{2} = 17/x + 11/x^{2} \rightarrow 0$ as $x \rightarrow \infty$.
Hence it is $O(x^{2})$
d) $x^{4}/2x^{2} = x^{2}/2 \rightarrow \infty$ as $x \rightarrow \infty$.
Hence it is not $O(x^{2})$. e) We need L'Hospital's rule here.
$\lim_{x \rightarrow \infty} 2^{x}/x^{2}$
$= \lim_{x \rightarrow \infty} (\ln 2)2^{x}/2x$
$= \lim_{x \rightarrow \infty} (\ln 2)^{2}2^{x}/2$
$= \infty$
Hence it is not $O(x^{2})$.



6. $\lim_{x \rightarrow \infty}[(x^{3} + 2x)/(2x + 1)]/x^{2}$
= $\lim_{x \rightarrow \infty}(x^{3} + 2x)/(2x^{3} + x^{2})$
= $\lim_{x \rightarrow \infty}(3x^{2} + 2)/(6x^{2} + 2x)$ by L'Hospital's rule
= $\lim_{x \rightarrow \infty} 6x /(12x + 2)$ by L'Hospital's rule
= $\lim_{x \rightarrow \infty} 6 /12$ by L'Hospital's rule
=$1/2$
Hence $(x^{3} + 2x)/(2x + 1)$ is $O(x^{2}$.



14
a) $x^{2}/x^{3} = 1/x$. Hence $x^{3}$ is not $O(x^{2})$.
c) $(x^{2} +x^{3})/x^{3} = 1/x + 1$. Hence $x^{3}$ is $O(x^{2})$.
e) $\lim_{x \rightarrow \infty} 3^{x}/x^{3} $
$= \lim_{x \rightarrow \infty} (\ln 3)^{3} 3^{x}/3!$
$= \infty$.
Hence $x^{3}$ is $O(3^{x})$.



20
b) $g(n) = 6^{n} (= 2^{n}*3^{n})$. Apply the L'Hspital's rule to verify.
c) $g(n) = n^{n}*n!$.
Note that $n!$ is $O(n^{n})$ because each factor of $n^{n}$, which is $n$, is not less than any factor of $n!$. Also any factor of $5^{n}$ is less than any factor of $n!$ except the first five factors of $n!$.