# Deciding Recursive/Recursively Enumerable when given Turning machine encoding as a language

Let $L_{1}$ and $L_{2}$ be two languages defined as follows :
$L_1 = \{ \langle M\rangle \mid L(M) \neq \emptyset \}$
$L_2 = \{ \langle M\rangle \mid L(M) = \emptyset \}$
where $\langle M\rangle$ denotes the encoding of a Turing Machine $M$. $L_{1}$ is the set of encodings of TMs that accept at least one string (i.e. the with non-empty languages), and $L_{2}$ is the set of encodings of TMs that do not accept any string (i.e. with empty lanugages). By making a language out of such encodings, I am essentially asking a Turing Machine to decide on another Turing machine as to whether the second TM has an empty language or not. This is essentially the halting problem, and so both languages are undecidable.

Now, I am not able to characterize $L_{1}$ and $L_{2}$ from among

• not recursively enumerable
• recursively enumerable but not recursive
• recursive
• I notice that you've posted several questions along the same lines in quick succession. Perhaps it would help your learning to wait a moment and see the answers you receive, as your questions are closely related. Or do you have an assignment due today? Jan 10, 2013 at 3:57
• No @LukeMathieson I did not have an assignment due. These are questions that I have sat on for some time now. My examination is approaching, so I put them all in one shot to the wrong site (unfortunately) Jan 14, 2013 at 7:28
• @ArjunJRao, good luck in your exam then! Jan 14, 2013 at 8:56

Note that $L_{1} = \overline{L_{2}}$, so if they were both recursively enumerable, then they would both be recursive, so we know at least one is not even recursively enumerable.
It turns out that $L_{1}$ is recursively enumerable, given an input $\langle M\rangle$ we can simulate $M$ on all strings over the alphabet by interleaving the execution of $M$ on each string. It may take a long time, but if $M$ accepts something, we eventually (in finite time) find it, so we can recognise that $\langle M\rangle \in L_{1}$.
Then simply by logical deduction, $L_{2}$ can't be recursively enumerable, as it is already co-r.e., but not recursive.
• @ArjunJRao The technique is also called dovetailing; in phase $i$, you execute $i$ steps in each of the tasks $1,\dots,i$.