A DTM consists of:
A TM computes by executing its “program.” This program specifies, for each combination of state and current symbol under the read/write head, its next action.
This next action has 3 components:
To compute, an input string is written at the initial portion of the tape, the machine is reset to the start state, and its read/write head is placed on the first cell. The machine then consults its program, and dutifully follows its instructions.
This computation may never halt, in which case we say that the TM loops on that particular input.
However, if any computation step causes the machine to enter the accept state or the reject state, computation stops and we says that the TM halts. If it halts in the accept state, we say that the TM accepts the input; if it halts in the reject state, we say that the TM rejects the input.
A Deterministic Turing Machine (DTM) is a tuple \((Q, \Sigma, \Gamma, \delta, q_0, q_{accept}, q_{reject})\), where
A TM configuration \(uqv\) is a string representing a snapshot of a TM computation at a particular moment when the TM is in state \(q\), with the non-blank portion of the tape has the string \(uv\), and the read/write head positioned at cell containing the first character of \(v\).
On input \(w\), the TM starts in its start configuration \(q_0w\).
An accepting configuration is one whose state is \(q_{accept}\).
A rejecting configuration is one whose state is \(q_{reject}\).
A halting configuration is one that is either accepting or rejecting.
For TM configurations \(C\), \(C'\), we say that \(C\) yields \(C'\), and write \(C\vdash_M C'\), to mean that the TM in configuration \(C\) can legally go to configuration \(C'\) in one computation step.
The language recognized by TM \(M\), written \(L(M)\), is the set of all strings accepted by \(M\). Note that any string that is not accepted by \(M\) may cause \(M\) to reject or loop.
A TM decider (or decider) is a TM that halts on every input.
A language \(A\) is said to be Turing-recognizable (or recursively enumerable) if there exists a TM such that \(L(M)=A\)
A language \(A\) is said to be decidable (or recursive) if there exists a decider \(M\) such that \(L(M)=A\)
There are variations in TM definition.
Prove that all the above TM variants are equivalent to the regular variant defined in Sipser. (Hint: Simulation.)
Let \(k\) be a positive integer. A \(k\)-tape DTM has \(k\) input tapes and \(k\) independent read/write heads. In one computation step, a \(k\)-DTM does the following 3 things.
At the start of computation, input string is written on tape 1, and each head is positioned at the initial cell of its tape.
The machine is defined to accept, reject, or loop in exactly the same way as for 1-DTM.
A \(k\)-tape Deterministic Turing Machine (\(k\)-DTM) is a tuple \((Q, \Sigma, \Gamma, \delta, q_0, q_{accept}, q_{reject})\), where
Theorem. Every language that is recognized by some \(k\)-DTM can be recognized by some 1-DTM.
Proof idea. Simulation.
A string \(w\) is accepted by an NTM \(N\) if there exists some accepting computation of \(q_0w\) on \(N\).
The language of the NTM \(N\) is the set of all strings that has an accepting computation on \(N\).
An NTM \(N\) is called an NTM decider if the computation of every input on every branch of \(N\) halts.
Theorem 3.16. Every NTM has an equivalent DTM.
Corollary 3.18. A language is Turing-recognizable iff some NTM recognizes it.
Corollary 3.19. A language is decidable iff some NTM decides it.
(Sipser Exercise 3.4) Formalize the definition of an enumerator as a 2-tape TM that takes no input and uses its second tape as the printer. Include the definition of the enumerated language. (Won’t do this but will define a 1-tape enumerator instead.)
A Turing Machine Enumerator is a tuple \((Q, \Sigma, \Gamma, \delta, q_0, q_{print})\), where
An enumerator starts its computation in state \(q_0\), on a blank tape, having its read/write head placed on the initial cell.
A string \(w\in\Sigma^*\) is said to be printed by the enumerator \(E\) if at some point during \(E\)’s computation, \(w\) appears at the beginning of the tape with the remaining cells blank, and \(E\) is in state \(q_{print}\).
The language of the enumerator \(E\), written \(L(E)\), is the set \[\{ w : w \textrm{ is printed by } E \textrm{ at least once} \}.\]
Note that an enumerator can print a string more than once.
Theorem. A language is Turing-recognizable if and only if it is the language of some enumerator.
Proof. First let \(A\) be a TR language with TM \(M\) recognizing it. Let’s called the strings of \(\Sigma^*\) in string order \(w_1\), \(w_2\), \(w_3\), … Construct an enumerator \(E\), where
E = "for i = 1, 2, 3, ... do {
for j = 1 to i do {
erase tape, write w_j, and simulate M on w_j for i steps;
if M accepts w_j within these i steps then {
erase tape, write w_j, and enter q_{print};
}
}
}"
We see that any string \(w\) is printed by \(E\) iff \(w\in A\).
Now let \(A\) be the language of an enumerator \(E\). Construct a TM \(M\) that works like this
M = "On input w:
simulate E on a blank tape,
each time E enters q_{print}, with say x on the tape,
we compare x with w, if they are equal then accept."
We see that a string \(w\) is printed by \(E\) iff \(w\in A\). \[\tag*{$\Box$}\]
Encoding of an object \(O\) when \(O\) is to be an input to a TM is written \(\langle O\rangle\).
Encoding of a list of objects \((O_1, \dots, O_k)\) is written \(\langle O_1, \dots, O_k\rangle\).
For example,