retagged by
3,096 views
7 votes
7 votes

Which of the following is true for the given language?

$L=$ {<TM> | TM halts on every input}

<TM> is encoding of the Turing machine

(A) $L$ is Recursive and $\overline{L}$ is also Recursive

(B) $L$ is Recursive Enumerable and $\overline{L}$ is also Recursive Enumerable

(C) $L$ is Non Recursive Enumerable and $\overline{L}$ is Recursive Enumerable

(D) $L$ is Non Recursive Enumerable and $\overline{L}$ is Non Recursive Enumerable

retagged by

2 Answers

Best answer
9 votes
9 votes

Well, there is an easy solution to this- thanks to @Sonu.

L here describes the encoding of TM which halts for all inputs. In other words, L describes the encoding of TMs whose language is recursive. Now, this problem can be solved easily using Rice's theorem. (part 2).

L(TM) is recursive?  is a non-monotonic property, because we have a TM for which L(TM) is recursive - TMyes, and we can have another TM for which L(TM) is non-recursive- Mno and L(TMyes) subset of L(M)no. (For example L(TMyes) is ∅ and L(TMno) is any non-recursive language). Now, all non-monotonic property of language of TM are not-even semi decidable- their language is not recursively enumerable. So, L is not recursively enumerable. 

L' can be stated as is L(M) non-recursive? This is again a non-monotonic property as we can have L(TMyes) = a non recursive language and L(TMno) = Σ*, so that the subset condition holds. So, L' is also non-recursively enumerable. 

 

http://gatecse.in/wiki/Rice%27s_Theorem_with_Examples

selected by
5 votes
5 votes

The question describes a language which has the encoding of the TMs that halts for every input. Now, to say this language is recursive, we have to make another TM (this new TM is different from the encoding of TMs in L) which accept all strings in L (which are encoding of all halting TMs). If this new TM halts for all input, then the given language is recursive. If it halts for strings in L (may or may not halt for strings not in L), then the given language is recursively enumerable. 

(The given property is of TM and not its language. So, we can't use Rice's theorem sad)

So, only way is reduction. If we reduce halting problem to this problem (solve halting problem assuming solution to given problem), then we prove that L is not recursive as language of halting problem is proved to be non recursive. 

First we try to solve halting problem. We assume we have a TM M for accepting L, that is given an encoding of a TM, our TM will say "yes" if the encoded TM halts for all inputs and "no" otherwise. Now, we want to solve halting problem using this. Halting problem is to decide if a given TM halts for a given word w. We proceed as follows:


Given an instance of halting problem (an encoding of a TM H and a word w), we make another TM N which will take any input but simply erases that input from the input tape and simulates the moves of H on w. If H halts on w, N halts on all inputs. If H doesn't halt on w, N won't halt on any input - reduction is perfect. Now, we simply give the encoding of N to our assumed TM for L- M. If L says "yes"- we can say H halts on w, if L says "no"- we can say H does not halt on w - we have solved halting problem, which can never be done. Thus, our assumption is wrong and such an M can't exist. So, L is not recursive. 

To prove L is not RE is bit more tricky. One proof is given here:

http://www.inf.ed.ac.uk/teaching/courses/ci/documents/note09.pdf

To prove L' is not recursively enumerable: (It's easier as we can directly reduce from complement of halting problem)

$L' = \left\{<TM> \mid \text{ TM does not halt on some input } \right\}$

We can try reduction from complement of halting problem. Complement of halting problem is given a TM H and a word w, we have to say if H does not halt on w. We proceed as follows: (same reduction as done for halting problem).

We assume we have a TM M' which semi-decides L'- that is it says "yes" if we give encoding of a TM that does not halt on some input. (It may say "no" or loops, if the encoded TM halts on all inputs)

Given an instance of complement of halting problem (an encoding of a TM H and a word w), we make another TM N which will take any input but simply erases that input from the input tape and simulates the moves of H on w. If H halts on w, N halts on all inputs. If H doesn't halt on w, N won't halt on any input - reduction is perfect. Now, we give the encoding of N to our assumed TM for L'- M', and if M' says "yes", it means N does not halt on some input- possible only if H does not halt on w - we solved complement of halting problem using M' which is not possible. So, M' cannot possibly exist meaning L' is not recursively enumerable.

So, L is not recursive and L' is not recursively enumerable. The only matching option is (D) - we need not prove L is not RE. 

Related questions

2 votes
2 votes
0 answers
1
bts1jimin asked Jan 8, 2019
610 views
CONSIDER THE FLLOWING LANGUAGE L={<M>| M is a TM and L(M)=empty}Which of the following is true?a- Decidable RECB- Undecidable and REc-Undecidable and non REd- Decidable ...
17 votes
17 votes
4 answers
2
gatecse asked Aug 20, 2014
5,775 views
$L= \{\langle M\rangle \mid L(M)\text{ is infinite}\}$$L$ is RE but $L'$ is not REBoth $L$ and $L'$ are RE$L$ is not RE but $L'$ is REBoth $L$ and $L'$ are not RE
17 votes
17 votes
2 answers
3
gatecse asked Aug 20, 2014
2,370 views
$L= \{\langle M \rangle\mid L(M) = \Sigma^*\} $A. $L$ is RE but $L'$ is not REB. Both $L$ and $L'$ are REC. $L$ is not RE but $L'$ is RED. Both $L$ and $L'$ are not RE...