## 13.3. ` `The Halting Problem

Description: Let M be a Turing Machine and S be a sequence of 0's and 1's.

Question: Is there a Turing Machine that can decide if
M ever halts when given S as input?

Notice that any machine solving this problem receives as input two strings of 0's and 1's, the first one encoding
a TM M and the second a string that will
play the role of input to M. The output of this hypothetical TM should
be ``yes'' or ``no'',
depending on whether the machine M stops or not
when given the second input string as
input.

One could think that some kind of universal
TM could solve this problem; nevertheless, as we show below, this
problem is noncomputable.

Let us suppose that there is a TM H that can solve

The Halting Problem.` `

If this is the case, let us build
another TM H' that computes as follows:

-- machine H' takes an input x, duplicates it
and gives the resulting strings to machine H.
-- if the machine H answers ``yes'', then machine H'
enters an infinite loop -- it runs forever -- if H
answers ``no'', then machine H' stops.

Machine H' is shown in the following figure:

Turing machine H'

It should be clear that machine H' can be built if machine H can.` `
Now let us argue why it is that H' is not a
feasible machine; that is, H' is theoretically possible but in reality is impossible to implement.` `
Since we know that
a TM can be encoded into 0's and 1's, let us give H' its own encoding as input.` `
Machine H' duplicates its own
code and gives it to machine H; if machine H answers ``yes''
-- to mean that machine H' halts when given its own encoding as input --
machine H' loops forever.` `
If machine H answers ``no''
-- to mean machine H' when given its own encoding loops forever --
machine H' stops.` `

We can then infer that machine H'
stops when given its own encoding if and only if it does not stop when given
its own encoding.` `
Clearly, this is a contradiction.` `
Hence machine H cannot exist.` `

Such as ``The Halting Problem'',
there are many other noncomputable problems.` `

Created by *unroff & hp-tools.*
© by Hans-Peter Bischof. All Rights Reserved (1998).
Last modified: 27/July/98 (12:14)