CS 390 Solutions to Homework 1



Textbook pp. 32 - 40:

1.1(f) {{ tex2html_wrap_inline35 and tex2html_wrap_inline37 } tex2html_wrap_inline39 tex2html_wrap_inline41 }.

1.4(d) tex2html_wrap_inline43
tex2html_wrap_inline45 .

1.8(b) tex2html_wrap_inline49 , since tex2html_wrap_inline51 for all n.
1.8(h) tex2html_wrap_inline59 and tex2html_wrap_inline61 .

1.22 (e) It is one-to-one. For if if p(x) = p(y), then the fraction part of x must equal that of y. Hence their integer parts must also be equal.
The range of p is the set of nonnegative real numbers whose integer part are even. For let x = i + f, where i is the integer part of x and f is the fraction part of x. Then p(x) = 2i + f because the floor of x is equal to i. So the integer part of p(x) is 2i and the fraction part is f.

1.57(b) tex2html_wrap_inline79 ?
Let tex2html_wrap_inline81 . Then tex2html_wrap_inline83 or tex2html_wrap_inline85 .
If tex2html_wrap_inline83 , then tex2html_wrap_inline89 and y = f(x).
Hence tex2html_wrap_inline93 and y = f(x).
Hence tex2html_wrap_inline97 .
Similarly for the case tex2html_wrap_inline85 .
Hence tex2html_wrap_inline79 .

1.23 f is onto but g is not necessarily onto.
g is one-to-one but f is not necessarily one-to-one.

1.24(a) There are altogether eight of them, for example
g(7) = 2, g(8) = 4, g(9) = 3, g(10) = 6.