Homework
First of all, a set of strings is decidable if you can tell whether
or not a string is in the set. The way we implemented that is by having a machine that takes any string as input and halts with a yes (

) or no (anything else) as output.
A set of strings is enumerable if there is a machine that eventually prints every member of the set and nothing else.
Given an enumeration of a set, we can tell if a string is in the set: It will eventually get enumerated, at which point the answer is yes. However, we cannot tell if a string is not inally prints every member of the set and nothing else.
Given an enumeration of a set, we can tell if a string is in the set: It will eventually get enumerated, at which point the answer is yes. However, we cannot tell if a string is not in the set: All we know is that it hasn't been listed yet, we have no computable way to know that it won't eventually be listed. R.e. sets are occasionally called "semi-decidable."
Enumerating a set: Lots of you forgot the empty string. No one exhibited a register machine that does the job, and it isn't that hard, so let's do it. Arbitrarily, pick the alphabet 0–9.
0 PRINT
1 IF

is empty THEN 2 ELSE 4 7 10 13 16 19 22 25 28 31 34
2 LET

3 IF

is empty THEN 0 ELSE 37 37 37 37 37 37 37 37 37
4 LET

5 LET

6 IF

is empty THEN 0 ELSE 37 37 37 37 37 37 37 37 37
.
.
.
34 LET

35 LET

36 GOTO 1
37 LET

38 LET

39 IF

is empty THEN 0 ELSE 37 37 37 37 37 37 37 37 37 37
40 HALT
Homework: We have two alphabets,

and

and a function

from

to

. # is a symbol not in either alphabet.
Prove that the following are equivalent:
-
is computable.
-
is enumerable.
-
is decidable.
Proof: To show three things equivalent, we show

,

, and

.

: We are given that

is computable. We show how to enumerate the set:
We take a machine that enumerates

and do the following: for each output

, we compute

, form

, and print it. We then go to the next member of

.

:
Given an enumeration of the set, we must show how to decide if a word in

is in the set.
Step 1. See if the word is of the form

, where

and

. If not, the word is not in the set.
Step 2. Start listing members of the set. For each one, check to see if the part before the # is the same as the part before the # in the word we are testing. If it is, check to see if the two words are the same. If yes, our word is in; if no, it is not. Since

is a function, the enumeration includes exactly one word that begins with each possible

, and so this procedure always terminates.

: We have that the set is decidable. We must show that

is computable. Given a word

, list all words of the form

for all

, and test each one for membership in the set. When you find one that is in, print the corresponding

and halt.
Show that a set

is r.e. if and only if there is a program

such that for

,

and for

,

One direction is "easy." For the other direction, we need to "simultaneously" run the machine on all inputs. We do that by running it on the first input for one step, then the first two inputs for two steps, and so forth.
To do that, we are making use of the idea that one machine can simulate another. That is, we are using an intuitive version of something like the following theorem:
(There is a universal Turing machine.)
-- ProfessorShaughanLavine? - 14 Feb 2005