7.1 Turing Machine Acceptance ProblemWilliam Umboh
The University of Melbourne
The TM Acceptance problem is as follows: given an encoding
⟨ M ⟩ \langle M \rangle ⟨ M ⟩ of a Turing machine M M M and an input string w w w ,
does M M M accept w w w ?
Equivalently, we define the language A T M A_{TM} A TM to consist of strings
⟨ M , w ⟩ \langle M, w \rangle ⟨ M , w ⟩ such that M M M is a Turing machine and M M M accepts
w w w .
The following Turing machine U U U recognizes A T M A_{TM} A TM :
On input ⟨ M , w ⟩ \langle M, w \rangle ⟨ M , w ⟩ : Simulate M M M on input w w w Accept if M M M
halts and accepts Reject if M M M halts and rejects
The simulation can be done in a similar fashion as for DFAs. Details
omitted.
To prove that it recognizes A T M A_{TM} A TM , we need to show that U U U accepts
⟨ M , w ⟩ \langle M, w \rangle ⟨ M , w ⟩ if and only if M M M accepts w w w . There are three
possible cases when M M M is run on w w w :
M M M halts and accepts
M M M halts and rejects
M M M runs forever
By definition, if M M M accepts, then U U U accepts. In the other cases, U U U
either rejects or runs forever. Thus, U U U accepts ⟨ M , w ⟩ \langle M, w \rangle ⟨ M , w ⟩
if and only if M M M accepts w w w , as desired.
It is tempting to claim that the following TM decides A T M A_{TM} A TM .
On input ⟨ M , w ⟩ \langle M, w\rangle ⟨ M , w ⟩ :
Simulate M M M on input w w w
Accept if M M M halts and accepts
Reject if M M M halts and rejects
Reject if M M M runs forever
The issue is that “Reject if M runs forever” is not a valid TM action.
An actual run of the TM.
7.1.1 Universal Turing machines ¶ The fact that we can design a Turing machine that takes as input an
encoding of another Turing machine and simulate it is referred to as the
“universal” nature of Turing machines. In contrast, finite automata and
pushdown automata do not have this feature: there is no universal finite
automaton (pushdown automaton, resp.) that can take an encoding of a
finite automaton (pushdown automaton, resp.) and simulate it.
Universality also has huge practical importance. For example, your
mobile phone is not a single-purpose device: by loading different apps,
it can take on other functionality. Without universality, you need one
device to browse the Internet, a separate one to play music, and a
separate one to make
calls .
7.1.2 Decider for TM Acceptance too good to be true ¶ It turns out that TM Acceptance is undecidable. Before we show that,
let’s build some intuition first by showing that a decider for TM
acceptance is too good to be true: using such a decider, we can turn any
recognizer into a decider.
Suppose that A T M A_{TM} A TM is decidable. Then, for every language L L L , if L L L
is recognizable, then L L L is decidable.
Let M M M be a recognizer of L L L and let U U U be a decider for A T M A_{TM} A TM .
Now we are going to define a TM D D D that decides L L L .
On input w w w :
Run U U U on ⟨ M , w ⟩ \langle M,w \rangle ⟨ M , w ⟩
Accept if U U U accepts
Reject if U U U rejects
Since U U U is a decider, it always accepts or rejects, it never runs
forever. Thus, D D D also always halts. Moreover, for every string w w w ,
D D D accepts it if and only if M M M accepts w w w . Therefore,
L ( D ) = L ( M ) = L L(D) = L(M) = L L ( D ) = L ( M ) = L and so D D D decides L L L .