next up previous contents
Next: The Undecidability of First-Order Up: Turing Machines Previous: Examples

The Halting Problem

Recall that for every Turing machine M there is a corresponding natural number nM (the Gödel number of M); and recall as well that Mi, where $i \in$ N, is the ith Turing machine. (Remember that we have previously established an enumeration M1, M2, M3, $\ldots$ of all Turing machines.) We will now prove that the following function is not Turing-computable. The Halting Problem is the problem of computing this function; hence we will show that the Halting Problem cannot be solved by a Turing machine.

\begin{displaymath}h(n^M,m)=\left\{
\begin{array}{rl}
2 & \mbox{if $M: m \longri...
... \mbox{if $M: m \longrightarrow \infty,$}
\end{array} \right.
\end{displaymath}

To begin the proof that h is cannot be solved by a Turing machine, suppose the opposite: suppose that h is Turing-computable; then there exists some Turing machine H that computes this function. We know that there exists a Turing machine Mk which, when given an unbroken string of k 1's as input, produces a copy of this string with an intervening blank square. For example, if M4 were started in the configuration
1 1 1 1 $\ldots$
it would produce
1 1 1 1   1 1 1 1 $\ldots$
It is also clear that there exists a machine $M^\star$ which is such that

\begin{displaymath}M^\star: \; n \longrightarrow \mbox{ halt iff } h(n,n) =1.\end{displaymath}

The specification of $M^\star$ is shown in the following figure, which shows the composite machine Mm that chains together Mk, H, and $M^\star$. As you can verify upon reflection,

\begin{displaymath}\mbox{For every $n$}: M_m: \; \longrightarrow \mbox{ halt iff } h(n,n)
=1.\end{displaymath}

Then, instantiating n to m:

\begin{displaymath}M_m: \; m \longrightarrow \mbox{ halt iff } h(m,m)
=1,\end{displaymath}

which is to say

\begin{displaymath}M_m: \; m \longrightarrow \mbox{ halt iff } M_m: \; \longrightarrow
\infty,\end{displaymath}

which is in turn

\begin{displaymath}M_m: \; m \longrightarrow \mbox{ halt iff not } M_m: \;
\longrightarrow
\mbox{ halt},\end{displaymath}

an outright contradiction. QED


next up previous contents
Next: The Undecidability of First-Order Up: Turing Machines Previous: Examples
Selmer Bringsjord
1999-04-19