2

Exercise 9.2.3(c) of the book by Hoffman, Motwani, Ullman states

In fact a definition of the RE-but-not-recursive languages is that they can be enumerated but not in numerical order

How do we show this equivalent to the following definition? RE-but-not-recursive languages are those, that are accepted by a TM, but do not halt on at least one input.

My take:
If enumeration in order is possible, then it is implied (?) that the TM halts on all inputs. So, it is recursive.

I am not sure on how to show the "it is implied" part in the above statement.

muser
  • 160
  • 5

2 Answers2

2

A language $L$ is recursively enumerable but not recursive if:

  1. There is a Turing machine that halts on an input $x$ if and only if $x \in L$.
  2. There is no Turing machine that on $x \in L$ halts and prints Yes, and on $x \notin L$ halts and prints No. We say that such a machine decides $L$.

In order to show that this is equivalent to "can be enumerated but not in numerical order", it suffices to prove that a language is recursive iff it can be enumerated in numerical order (since we already know, presumably, that a language is recursively enumerable iff it can be enumerated).

If a language is recursive then it can be enumerated in numerical order: just go over all inputs in order, and for each one, determine if it belongs to the language, and if so, add it to the enumeration.

The crux of the proof of Exercise 9.2.3(c) is the opposite direction: if a language can be enumerated in numerical order then it is recursive. This means that if there is a Turing machine that enumerates $L$ in numerical order, then there is a (possibly different) Turing machines that decides $L$.

Enumerators and deciders are different types of beasts:

  • An enumerator has no input, and generates a (possibly infinite) output.
  • A decider gets an input, and outputs either Yes or No.

In particular, an enumerator will usually not be a decider. Therefore your proof strategy, as stated, cannot work. Instead, you need to show how to construct a decider using an enumerator.

Yuval Filmus
  • 280,205
  • 27
  • 317
  • 514
0

If a language $L$ can be enumerated in numerical order, that means that you can construct an algorithm that enumerates positive instances in numerical order, for example $1, 5, 9, 129, 238, 387846, …$.

If that's the case, then $L$ is recursive. Indeed, to solve any instance $x$, you just have to enumerate positives instances of $L$ until a number is greater or equal than $x$. If this number is equal to $x$, then $x$ is a positive instance, otherwise $x$ is a negative instance.

Conversely, if $L$ is recursive, then there exists an algorithm $A$ solving $L$, and then you can enumerate all positive instances in numerical order:

n ← 0
while true:
   if A(n):
      print(n)
   n ← n + 1
Nathaniel
  • 18,309
  • 2
  • 30
  • 58