hmwk_1 - 4 Halting Problem Suppose you are given a program...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Discrete Structures Aug 24 2011 Assignment 1: Due at beginning of class Wed, Sept 7 Prof. Hopcroft 1 Sets For each of the following, if possible, give 4 examples of elements from each set: a. { 0 i 1 | i N } b. S 1 = { 0 i 10 i +1 1 | i N } * c. S 2 = { 1 }{ 0 i 10 i +1 1 | i N }{ 0 } * { 1 } d. S 1 S 2 2 Rational Numbers 2.1 Prove each of the following: a. Every rational number is a terminating real or a repeating real number. b. The converse of ( a ): every terminating real number is rational and every repeating real number is a rational number. Hint: Prove that { 0 . 1 i 10 i 10 i · · · | i N } is rational and if a = bc and two of a, b, c are rational then the third is rational. c. An integer is either a perfect square or its square root is irrational. 3 Countability Is the collection of all finite subsets of integers countable?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4 Halting Problem Suppose you are given a program P that can be given input I . In some cases computing P on I may run forever (not halt). This can happen if P contains an infinite loop. It would be nice to detect when this will happen for any given input I . Suppose you could write a computer program D does exactly that: D takes P and I as input and returns whether or not P will halt given I . Is this possible? If not why not? What contradiction would this lead to? Hint: Could you compute something that is not computable? 5 Diagonalization Is the class of subsets of integers countably infinite? 1...
View Full Document

This note was uploaded on 11/11/2011 for the course CS 2800 at Cornell University (Engineering School).

Ask a homework question - tutors are online