2

If ETM = {<M> ∣ M is a Turing Machine and L(M) = ∅}, how can I prove that the complement of ETM is semi-decidable?

Essie
  • 21
  • 1

2 Answers2

1

First, you have to find a way to enumerate the elements of $\overline{ETM}$. One way is to create a procedure which, in stage $n$, tests the first $n$ Turing machines for the first $n$ inputs for $n$ steps, outputing the code of a machine if it finds an input it accepts. If $M\in\overline{ETM}$, then, eventually, your procedure will find $M$, the input it accepts, and be in a stage where it simulates $M$ for enough steps.

Now, to see that it is semi-decidable and not decidable, you can, for example, find a reduction from the Halting problem to ETM. One possible way is to, given a machine $M$, construct a machine $M'$, which accepts an input $x$ whenever $M$ accepts $0$. Then, $L(M')$ is either $\mathbb{N}$ or $\emptyset$ and $M\in HALT$ if and only if $M'\in\overline{ETM}$.

Are you familiar with these constructions?

user6767509
  • 443
  • 4
  • 11
0

Consider an alphabet $\Sigma$, and let $w_1, w_2, w_3, \ldots$ denote all words in $\Sigma^*$ in minlex order, that is, for all $i < j$, one of the following holds: (1) either $|w_i| < |w_j|$, or (2) both $w_i$ and $w_j$ are of the same length, yet $w_i$ comes before $w_j$ in the lexicographic order. For example, $b <_{minlex} aa <_{minlex} ab$.

Now to show that $\overline{E_{TM}} \in \text{RE}$, we define a TM $T$ that, on input $\langle M\rangle$, simulates the run of $T$ on all words in $\Sigma^*$ in parallel, and checks if $M$ accepts at least one word, where $\Sigma$ is the input-alphabet of $M$. Formally, $T$ works in iterations $i = 1, 2, \ldots$, where in iteration $i$, $T$ simulates the run of $M$ on the words $w_1, w_2, \ldots, w_i$, for $i$ steps each. If $M$ accepts one of the words $w_1, w_2, \ldots, w_i$ within $i$ steps, then $T$ halts and accepts, otherwise, $T$ proceeds to the next iteration. So in the $i$'th iteration, we simulate the run of $M$ on the first $i$ words in minlex order.

Regarding correctness, if $T$ accepts in some iteration $i$, the clearly, one of the words $w_1, w_2, \ldots, w_i$ is accepted by $M$ and thus $L(M)\neq \emptyset$. Conversely, if $L(M)\neq \emptyset$, then there is $j\geq 1$ such that $w_j\in L(M)$. Let $t$ denote the number of steps that takes the machine $M$ to accept $w_j$, and consider $i = \max(t, j)$. Clearly, $w_j$ is one of the first $i$ words in minlex order. If $T$ survived all iterations and reached iteration number $i$ and got to the point where it simulates the run of $M$ on $w_j$ for $i \geq t$ steps, then it halts an accepts as $M$ accepts $w_j$ within $t$ steps, in particular, within $i$ steps.

Notes:

1- The fact that we traverse all words in $\Sigma^*$ in minlex order is crucial. For example, if $\Sigma = \{ a, b\}$, and we traverse all words following a lexicographic order, then if $M$ accepts only the input $b$, we will never find that out, as there are infinitely many words that start with $a$.

2- Note that $T$ need not halt, when $L(M)$ is empty, but this is okay as we're showing that $\overline{E_{TM}} \in \text{RE}$. In fact, we cannot do better as the language is not decidable.

Bader Abu Radi
  • 5,494
  • 1
  • 11
  • 41