Consider the following languages?

  • L1 = { | M is a Turing machine that rejects all inputs of even length}.
  • L2 = { | M is a Turing machine that halts on an empty input}.
  • L3 = { | there is some input x ∈ {0, 1}∗ such that M accepts x in less than 100 steps}.

Then,
(A) L1 and L2 are decidable, L3 is undecidable.
(B) L1 is undecidable, L2 and L3 are decidable.
(C) L1 and L2 are undecidable, L3 is decidable.
(D) L1 is decidable, L2 and L3 are undecidable.


Answer: (C)

Explanation:

  • L1 is undecidable. To see this, assume on the contrary that there exists some TM R1 that decides L1, and we use R1 to construct a TM S1 that decides ATM: S1 = “On input :
    1. Construct TM M1 that on input x, accept if |x| is odd. If |x| is even, it simulates M on input w. If M accepts w, M1 enters the reject state. If M rejects w, M1 enters the accept state. If M loops, M1 also loops.
    2. Run R1 on input .
    3. Accept if R1 accepts, and reject if R1 rejects.”

    Observe that if M accepts w, then M1 is a Turing machine that rejects all inputs of even length. If M rejects or loops on input w, then M1 is a Turing machine that for each input of even length, either loops or accepts.

  • L2 is undecidable. To see this, assume on the contrary that there exists some TM R2 that decides L2, and we use R2 to construct a TM S2 that decides ATM: S2 = “On input :
    1. Construct TM M2 that ignores its input and simulates M on input w and accept (and halt) if M does. If M rejects w, M2 keeps moving right upon reading any input (thereby looping).
    2. Run R2 on input .
    3. Accept if R2 accepts, and reject if R2 rejects.”

    Observe that if M accepts w, then M2 is a Turing machine that halts on an empty input. If M rejects or loops on input w, then M2 is a Turing machine that loops on an empty input.

  • L3 is decidable. First, observe that if hMi ∈ L3, then there exists some string x of length at most 100 such that M accepts x in less than 100 steps. This is because M cannot read beyond the 100th position of its input in less than 100 steps. Therefore, to check whether an input hMi is in L3, it suffices to simulate M over all strings of length at most 100 for at most 99 steps, and accept if M accepts one of these strings, and reject otherwise.

So, option (C) is correct.

Quiz of this Question


  • Last Updated : 12 Dec, 2018

Share your thoughts in the comments