HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Is the language L = {<M> | There exists an M' that stops on the same input words, but L(M) ≠ L(M')} in RE or R?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
samethewordsbutlanguageinputthatstopsexiststhere

Problem

Is the language $$L = \{M | \exists M' \text{ that stops on the same input words but L(M)} \neq L(M')\}$$ in RE or R?

I suspect that it's not in RE, since you'd have to first know for M all the inputs for which it halts, which you can't do in a finite time.

I wanted to show that $\overline {HP} \leq L$, and so because $\overline {HP} \notin RE$, also $L \notin RE$, but I can't seem to find a reduction function.

Thanks in advance

Solution

Notice, that all machines $M$ that don't halt on any input accept the same language, $\emptyset$.
Thus if $M$ doesn't halt on any input then also $\langle M \rangle \notin L$.

Now define the TM $M'$ for some TM $M$ such that on input $x$

  • $M'$ runs $M$ on $x$



  • $M'$ rejects if $M$ halts accepting



  • $M'$ accepts if $M$ halts rejecting



It's easy to see, that
$$M \text{ halts on } w \iff M' \text{ halts on } w$$
and that $L(M) \neq L(M')$ for all machines $M$ that halt on some input.
From this it follows that, if $M$ halts on some input, then $\langle M \rangle \in L$.

With this we have shown that
$$L = \{\langle M \rangle : M \text{ halts on some input}\}.$$
This language is known to be in $\texttt{RE} \setminus \texttt{R}$.

Context

StackExchange Computer Science Q#165494, answer score: 5

Revisions (0)

No revisions yet.