Home Algorithms
Home Algorithms
Home Algorithms
4) The language L={<M> | M is a TM and there exists w such that M halts on w in less
than |<M>| steps} is decidable. To prove this, we can construct a decider D for L as
follows:
D = "On input <M>:
Since M’ simulates M on input w for at most |<M>| steps, it will halt if and only if M
halts on w within |<M>| steps. Therefore, D accepts <M> if and only if L(M) is
recognizable.
5) a. L is not a decidable language. To prove this, we can use a reduction from the
Halting problem to show that L is undecidable. Suppose there exists a decider D for L.
We can construct a decider E for the Halting problem as follows:
If M halts on w, then L(M’) contains an even-length string and does not contain an odd-
length string, so <M’> ∈ L. If M does not halt on w, then L(M’) contains an odd-length
string and does not contain an even-length string, so <M’> ∉ L. Therefore, E decides the
Halting problem if D decides L.
Since the Halting problem is undecidable, we have shown that L is also undecidable.