hw1-solutions - Solutions for Homework 1 of COM S 381 Fall...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the 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 one-one on-to 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 one-one 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 i-th 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 i-th 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

Page1 / 5

hw1-solutions - Solutions for Homework 1 of COM S 381 Fall...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online