Universal Turing Machines, Uncomputability




CS254

Chris Pollett

Feb 8, 2017

Outline

Machines as Strings

Universal Turing Machine

Theorem. There exists a TM `U` such that for every `x, alpha in {0, 1}^star`, `U(x, \alpha) = M_alpha(x)`, where `M_alpha` denote the TM represented by `alpha`. Moreover, if `M_alpha` halts within `T` steps then `U(x, \alpha)` halts within `CTlog T` steps, where `C` is a number independent of `|x|` and depending only on `M_alpha`'s alphabet size, number of tapes, and number of states.

Proof of relaxed version. `U` is given an input `x, \alpha`. We can assume `M_alpha` represents a TM with a single work tape, and uses only the alphabet `{Delta, square, 0, 1}` because last day we showed how to transform more general TM variants to this form. This transformation could also be carried out explicitly by `U` on more general encodings. Note also, from our proofs last day, these transformations could introduce a quadratic slowdown in the resulting machine, so we have to be more careful for the non-relaxed version of the result. To do a simulation of `M_alpha`, `U` will use three work tapes in addition to its input and output tapes. `U` uses one if its work tapes, and the input and output tape in exactly the same way as `M_alpha`. It uses its two other work tapes to store a table of `M_alpha`'s transition function on one, and to store `M_alpha`'s state on the other. To simulate one step of `M_alpha`, `U` reads the character from `M_alpha`'s work tape, reads the state from the state tape, and scans the transition table to tape to find what symbol to output to `M_alpha`'s work tape, what new state to write to its state tape, and which direction to move the work tape.

Uncomputability

Theorem. There exists a function `UC: {0, 1}^star -> {0,1}` that is not computable by any TM.

Proof. Define `UC` as: For every `alpha in {0, 1}^star`, if `M_alpha(alpha) = 1` then `UC(alpha) = 0`; otherwise, `UC(alpha) = 1`. Suppose for the sake of contradiction that `UC(alpha)` were computable. Then there would exist a TM `M` such that `M(alpha) = UC(alpha)` for all `alpha in {0, 1}^star`. Then `M(lfloor M rfloor) = UC(lfloor M rfloor)`. But this is impossible as by the definition of `UC`
`UC(lfloor M rfloor) = 1 iff M(lfloor M rfloor) ne 1`.

The Halting Problem

Theorem. `mbox(HALT)` is not computable by any TM.

Proof. Suppose `mbox(HALT)` was computable by some TM `M_(mbox(HALT))`. We will use `M_(mbox(HALT))` to make a TM `M_(UC)` for the function `UC` giving a contradiction to out last theorem. The machine `M_(UC)` operates as follows: on input `alpha`, `M_(UC)` computes `M_(mbox(HALT))(alpha, alpha)`. If the result is `0`, then `M_(UC)` outputs `1`; otherwise, `M_(UC)` outputs 0. If `mbox(HALT)` were computable then `M_(mbox(HALT))(alpha, alpha)` would halt in a finite number of steps and `M_(UC)` would be computable, giving a contradiction.

In-Class Exercise