TEST 2 CS/APMA 202 Name:_________________________ This exam is closed book and closed notes. You may not consult any notes, textbooks, homeworks, or other materials. Calculators and other calculating devices are prohibited. (20)1. Use mathematical induction to prove that 1*1! + 2*2! + … + n*n! = (n + 1)! – 1 whenever n is a positive integer. (20)2. Consider the set S defined by: (1) 1 S. x y (2) S whenever x S, y S, and z S. z (a) Identify the set S using set builder notation. (e.g. If the set S was the set of integers greater than 7 [which it is not] then you would write S = {x Z | x > 7 }.) (b) Explain (using English prose) the reasoning that led you to your answer for part (a). (16)3. Let m: A B denote a map from A to B. For each of the following, answer: (1) Is m: A B a function? - If not, why not? - If so, then proceed to answer (2) and (3): (2) Is m: A B one-to-one? If not, why not? (3) Is m: A B onto? If not, why not? (a) Let A = Z, B = Z, and define m: Z Z by the rule m(a) = 7. (b) Let A = R, B = R, and define m: R R by the rule m(a) = a 1 . a2 (c) Let A = Z, B = Z, and define m: Z Z by the rule m(a) = a2 . (d) Let A = N, B = Z, and define m: N Z by the rule m(a) = a. (12)4. Let {an } be a sequence. We will use N to index our sequences. That is {an } is a0, a1, a2, (a) List the first ten terms of the sequence defined by a0 = 1, and ak + 1 = kj = 0 aj for k 0. (b) For the sequence in part (a), evaluate 9j = 0 aj. (c) List the first ten terms of the sequence defined by bk = k. (d) For the sequence in part (c), evaluate 9j = 0 bj. 2 (12)5. Recall the Fundamental Theorem of Arithmetic: Any positive integer can be written uniquely as the product of primes, where the prime factors are written in increasing order. (a) Give the prime factorization of 924. (b) Give the prime factorization of 495. (c) Find gcd( 924, 495 ). (d) Find lcm( 924, 495 ). (20)6. Recall that P(N) denotes the power set of N (that is, the set of all subsets of N). Now let D = { S P(N) | S is finite }. That is, D is the set of all finite subsets of N. Clearly from the definition of D, D P(N). We know that P(N) is uncountable. However, it turns out that D is countable. (a) Give a one-to-one correspondence f: N D. [Hint: Use the fact that any member of P(N) can be denoted by an infinite sequence of bits b0b1b2b3… where the bit bk is a 1 if the natural number k is in the set that b0b1b2b3… represents and bit bk is a 0 otherwise. So if any member of P(N) can be denoted by an infinite sequence of bits then clearly any member of D can be denoted by an infinite sequence of bits as well (since D P(N)). So your one-to-one correspondence f should map natural numbers to infinite bit sequences.] (b) Show that your function from part (a) is onto. That is, given any S D [remember that members of D are finite subsets of N], tell me which natural number maps to it. Pledge: I pledge that I have neither given nor received unauthorized aid on this exam, and that I have not used a calculator during the exam. _____________________ (sign pledge) 3