October 5, 1995 cs330 - Discrete Structures =========================== Fall 1995 Homework #3 Due: October 16, 1995 Exercise Page Points ------------------------------ 20 79 20 2 88 30 4 88 5 14 88 30 20 88 15 Problem 1 below 10 Problem 2 below 30 ------------------------------ Total 140 1) Let F(N) denote the set of all finite subsets of N (the set of natural numbers). We want to show that F(N) is countable; to do this we must find a bijection between between F(N) and N (this is what the definitions says). Another way to prove F(N) is countable is to find a bijection between F(N) and a set proven to be countable. Here we go: let B be the set of binary strings with no leading zeros, except for number 0. Example of strings in B are: 0 the binary representation of 0 1 the binary representation of 1 01 invalid because it has a leading 0 10 the binary representation of 2 101 the binary representation of 5 Obviously B is countable because each string correspons to a natural number. We define a function from B tp F(N) as follws: g:B -> F(N) g(bn...b1b0) = {i | bi=1} For instance g(0) = {} g(1) = {0} g(10) = {1} g(11) = {0, 1} g(110) = {1, 2} Show that g is a bijection. 2) For each of the following functions, state which one of the following properties holds: injective, surjective, bijective, none (meaning not injective, not surjective, not bijective). For each bijective function find its inverse. a) f:N -> N f(x) = x modulo 10 b) f:N -> N f(x) = if x is odd then (x-1) else (x+1) c) f:S -> power(S) S is any set and f(x) = {x} d) f:lists(S) -> power(S) S is any finite set f() = {x1, x2, ..., xn} lists(S) is the set of all lists over the set S. e) seq:N -> lists(N) is called the sequence function seq(n) = <0, 1,..., n> f) dist:Axlists(B) -> lists(AxB) is called the distribute function dist(x, ) = <, ,..., > Please remember to print your name on the front page of your work, together with your SSN.