COS 550 F08 HW #3 DUE Thursday 9/25/08 p. 25 Problem 2, 15 points p. 25 Problem 3, 15 points p. 25 Problem 7, 15 points p. 28 Problem 1, 10 points p. 28 Problem 3, 15 points Problem 1 Below, 15 points Problem 2 Below, 15 points ********** Problem Notes *********, For the first 5 problems, be sure to test your answer by writing a program in SmallBASIC or some similar language. Be sure to include a listing of your program and the appropriate output as part of your homework. PROBLEM 1: In class, I described a bijection between the natural numbers and finite length strings over the alphabet {a, b} based on ordering the strings first by length, and then alphabetically. Using any reasonable computer language, code two functions, f and g, corresponding to the bijection I just described, and having the following properties. f takes a natural number and outputs the string corresponding to that number. g takes a finite length string composed of a's and b's and returns the number giving its place in the order we talked about. Include the source code and some sample output for your program. PROBLEM 2: Let f: N -> NxN be given by f(n) = (n,0), and g: NxN -> be given by g(a,b) = 2^a * 3^b. In class, I described how the proof of the SB Theorem constructs a bijection between N and NxN. Using your favorite computer language, produce two functions fb and gb such that fb:N -> NxN and gb:NxN -> N are the bijections based on the functions f and g given in this problem. Submit the source code and some sample output for your program.