hw1-solutions

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

This preview shows pages 1–3. Sign up to view the full content.

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 { 0 , 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 ∈ { 0 , 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 Σ = { 0 , 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. Let us assume that 2 Σ * is countable and f be a one-one onto function from N (the set of natural numbers) to 2 Σ * (represented by set of all infinite 1

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

View Full Document
strings). We will show that there is an infinite string
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern