Turing Machine · Theory of Computation
13 questions · asked in 12 of 27 years (2000–2026)
MCQ 12 · MSQ 11-mark 6 · 2-mark 7
2000Questions per year2026
Questions 11–13 of 13
Define languages L0 and L1 as follows :
L0 = {< M, w, 0 > | M halts on w}
L1 = {< M, w, 1 > | M does not halts on w} Here is a triplet, whose first component. M is an encoding of a Turing Machine, second component, w, is a string, and third component, i, is a bit. Let . Which of the following is true ?Answer: (D)
Suppose is recursively enumerable, so some TM accepts exactly the strings of .
For any : if M halts on w, and if M does not halt on w. Exactly one of the two triplets is in .
Run on both triplets in parallel, a step at a time on each, because one run may never stop. One of them is in , so accepts it. If it is the one with bit 0, M halts on w; if it is the one with bit 1, M does not halt. That decides the halting problem, which is impossible. So is not recursively enumerable.
The same works for : if M does not halt on w, and if M halts on w. Again exactly one of the two triplets is in . If were recursively enumerable, with a machine , running on both triplets in parallel would decide halting. So is not recursively enumerable either.
Neither nor is recursively enumerable.
Answer: (D)
For any : if M halts on w, and if M does not halt on w. Exactly one of the two triplets is in .
Run on both triplets in parallel, a step at a time on each, because one run may never stop. One of them is in , so accepts it. If it is the one with bit 0, M halts on w; if it is the one with bit 1, M does not halt. That decides the halting problem, which is impossible. So is not recursively enumerable.
The same works for : if M does not halt on w, and if M halts on w. Again exactly one of the two triplets is in . If were recursively enumerable, with a machine , running on both triplets in parallel would decide halting. So is not recursively enumerable either.
Neither nor is recursively enumerable.
Answer: (D)
A single tape Turing Machine M has two states q0 and q1, of which q0 is the starting state. The tape alphabet of M is {0, 1, B} and its input alphabet is {0, 1}. The symbol B is the blank symbol used to indicate end of an input string. The transition function of M is described in the following table
The table is interpreted as illustrated below. The entry (q1, 1, R) in row q0 and column 1 signifies that if M is in state q0 and reads 1 on the current tape square, then it writes 1 on the same tape square, moves its tape head one position to the right and transitions to state q1. Which of the following statements is true about M ?
The table is interpreted as illustrated below. The entry (q1, 1, R) in row q0 and column 1 signifies that if M is in state q0 and reads 1 on the current tape square, then it writes 1 on the same tape square, moves its tape head one position to the right and transitions to state q1. Which of the following statements is true about M ?
Answer: (A)
M halts only if it is in q0 and reads B. Trace any non-empty string.
Step 1: in q0 the first symbol is 0 or 1. Both entries are (q1, 1, R), so M writes 1 on it, moves right and enters q1.
In q1: on 0 it writes 1 and moves right, staying in q1 (so every 0 in the input turns into 1). On 1 it goes to q0 and moves left. On B (the cell just after the input) it writes B, goes to q0 and moves left.
So q1 always ends by moving left into q0. The cell it moves onto is an input cell, and every input cell the head has passed holds 1 by now. So q0 reads 1, writes 1, moves right and enters q1 again. The blank B is never read in q0.
Example on input 1: q0 reads 1, moves right to B in q1, goes back left to q0, reads 1 again, and repeats forever. Input 00: q0 turns the first 0 into 1 and moves right; q1 turns the second 0 into 1 and moves right to B; q1 moves left to q0 on a 1; and the loop goes on.
So M never halts on any string of . Only the empty string halts, because q0 reads B at once.
Why the others fail: includes the empty string, on which M halts, so (B) is false. Strings ending in 0 or in 1 are non-empty, so M loops on them, which makes (C) and (D) false.
Answer: (A)
Step 1: in q0 the first symbol is 0 or 1. Both entries are (q1, 1, R), so M writes 1 on it, moves right and enters q1.
In q1: on 0 it writes 1 and moves right, staying in q1 (so every 0 in the input turns into 1). On 1 it goes to q0 and moves left. On B (the cell just after the input) it writes B, goes to q0 and moves left.
So q1 always ends by moving left into q0. The cell it moves onto is an input cell, and every input cell the head has passed holds 1 by now. So q0 reads 1, writes 1, moves right and enters q1 again. The blank B is never read in q0.
Example on input 1: q0 reads 1, moves right to B in q1, goes back left to q0, reads 1 again, and repeats forever. Input 00: q0 turns the first 0 into 1 and moves right; q1 turns the second 0 into 1 and moves right to B; q1 moves left to q0 on a 1; and the loop goes on.
So M never halts on any string of . Only the empty string halts, because q0 reads B at once.
Why the others fail: includes the empty string, on which M halts, so (B) is false. Strings ending in 0 or in 1 are non-empty, so M loops on them, which makes (C) and (D) false.
Answer: (A)
Consider the following problem x .
Given a Turing machine M over the input alphabet , any state q of M. And a word w ) does the computation of M on w visit the state q ?
Which of the following statements about x is correct ?
Given a Turing machine M over the input alphabet , any state q of M. And a word w ) does the computation of M on w visit the state q ?
Which of the following statements about x is correct ?
Answer: (B)
Partially decidable. Take the TM and make its only final state (all other final states become non-final), with M' stopping as soon as it enters . Run on this new machine . If M reaches on (the yes case), accepts. So the problem is partially decidable. If M never reaches , may run forever, so it gives no answer in the no case.
Undecidable. Reduce the halting problem to it. Given , build from M by adding a new state , and making every halting situation of M (a state and symbol with no move) go to . Then visits on exactly when M halts on w. A decider for the state entry problem would then decide the halting problem, which is impossible.
So x is undecidable but partially decidable.
Answer: (B)
Undecidable. Reduce the halting problem to it. Given , build from M by adding a new state , and making every halting situation of M (a state and symbol with no move) go to . Then visits on exactly when M halts on w. A decider for the state entry problem would then decide the halting problem, which is impossible.
So x is undecidable but partially decidable.
Answer: (B)
Keep practising