This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Solutions for Homework 1 of COM S 381 Fall 2006 September 4, 2006 Problem 1 (a) We want to give a oneone onto mapping f from { , 1 } * to the set of natural numbers. Define f ( ) = 1, f (0) = 2 , f (1) = 3 , f (00) = 4 , f (01) = 5 , f (10) = 6 , f (11) = 7 and so on. More precisely, for a string x { , 1 } * , let  x  be the length of x and let number( x ) be the natural number x represents if we interpret it as a natural number written in binary. Define f ( x ) = 2  x  + number( x ) . (1) This gives the desired one to one and on to mapping. (b) We will prove the claim by a contradiction. Let = { , 1 } . Since * is countable, we can find a oneone onto function from N to * (one example of such a function is the inverse of the function defined in the last part). If a string x is assigned to the natural number i , we call it the ith string. We represent a subset S of strings by an infinite string s (called the characteristic string of the set S ), s [ i ] = 1 if the ith string is in the set, s [ i ] = 0 otherwise. Please note that each infinite binary string represents a unique subset of * and each subset has a string representing it. Therefore, the set of all subsets of * is same as the set of all infinite binary strings....
View Full
Document
 Fall '06
 HOPCROFT

Click to edit the document details