UTMs, Diagonalization, Hierarchy Theorems, co-r.e. sets, Reductions




CS154

Chris Pollett

Apr. 27, 2020

Outline

Simulation of Nondeterministic Turing Machines

At the end of last Wednesday, we introudced Nondeterministic Turing Machines and had an In-Class Exercise about them. We now show how to simulate these machines using deterministic machines.

Theorem Any language decidable by an NTM is decidable by a 3-tape deterministic TM. Further, `\mbox{NTIME}(f(n))` is contained in `cup_{c > 1}\mbox{TIME}(c^{f(n)})`.

Proof: Let `N` be a NTM that recognizes some language. We will make a Turing Machine `D` to simulate `N`. The idea is to have `D` try all possible branches of `N`'s computation. If `D` ever finds an accept state of `N` on any of the branches then `D` accepts. So that we don't get stuck on infinite branches we will do our simulation in an iterated deepening, breadth first manner. `D` will have three tapes: the input tape, a simulation tape, and an address tape. `D` operates as follows:

  1. Initially the input tape has the input and the other two tapes are blank.
  2. `D` copies the input tape to the simulation tape.
  3. `D` then simulate `N` according to the nondeterministic choices on the address tape. To do this:
    • Let `c` be the finite maximum number of choices in any given state reading a given symbol for a next state.
    • On the address tape we are going to write strings over the alphabet `0, 1, 2, ldots, c-1`, starting with the empty string and proceeding in lexicographical order
    • If the address tape is blank, `D` checks to see if `N` immediately accepts. Otherwise, `D` writes a `0` on the address tape and simulates `N` one step using the first possible nondeterministic choice. If this doesn't accept, then `D` writes a `1`, erases the simulation tape, and simulate `N` according to the second nondeterministic choice. Once we have tried all single step computations, we then cycle over computations of length 2, etc.

Notice the runtime of this algorithm to simulate `f(n)` steps is `O(1 + c + c^2 + ...+ c^{f(n)}) = O(c^{f(n)+1}) = O(c^{f(n)})` so will be in `mbox{TIME}(c^{f(n)})` by linear speed-up.

Decidability and Encodings

More Decidability

Universal Turing Machines -- Take 1

Universal Turing Machines -- Take 2

Quiz

Which of the following is true?

  1. If L is in TIME(`n^2`), we can use our speed-up theorem from last week to show it is in TIME(`n`).
  2. Our RAM machine model can be simulated by a TM with at most a cubic slowdown.
  3. There are languages recognized by two tape Turing machines which cannot be recognized by one tape Turing machines.

Diagonalization

Example Use of the Diagonalization Theorem

Corollary. A countable set `A` is not the same size as its `P(A)`.

Proof. Let `f:A -> P(A)` be a supposed bijection. Since `A` is countable, we have some function `a(k)` to list out its elements `a(0), a(1), a(2), ldots`. An element `X={a(2), a(5), ldots} in P(A)` can be view as an binary sequence `(0, 0, 1, 0, 0, 1, ldots)` where we have a `1` if `a(i)` is in `X` and a 0 otherwise. So the map `f` to the `P(A)` gives us a map to sequences that satisfies the Diagonalization theorem. A complement of the diagonal for `f` will still be in `P(A)` but not mapped to by `f`.

Non-Recursively Enumerable Languages

Another corollary to the Diagonalization Theorem is the following (recall Turing Recognizable, recursively enumerable, and computably enumerable all mean the same thing):

Corollary. Some languages are not recursive enumerable.

Proof. The set of infinite sequences over `{0,1}` is uncountable, as we just indicated in the last proof there is a bijection between this set and `P(NN)`. On the other hand, each encoding `langle M rangle` of a Turing Machine is a finite string over a finite alphabet. The set of finite strings over an alphabet is countable: a map from the natural numbers first maps to strings of length `0` in lex order, then strings of length `1`, etc.

`A_{TM}` is not Recursive

Theorem. The language `A_{TM}={ langle M,w rangle | mbox{M is a TM and M accepts w}}` is not recursive.

Proof. Suppose `A` is a decider for `A_{TM}`. Fix `M_i` and consider `w's` of the form `langle M_j rangle` for some other TM, `M_j`. Then listing out encodings of TM's in lex order `langle M_0 rangle, langle M_1 rangle, ldots` we can create an infinite binary sequence where we have a `1` in the `j`th slot if `langle M_j rangle` causes `M_i` to halt and a `0` otherwise. If `A` is a decider for `A_{TM}` then we can consider a variant on the complement of the diagonal of the map
`f: langle M_i rangle |-> (A(langle M_i,langle M_0 rangle), A(langle M_i, langle M_1 rangle rangle), ldots)`.
In particular, we can let `D` be the machine:
`D=`"On input `langle M rangle`, where `M` is a TM:

Since `A` is supposed to be a decision procedure for `A_{TM}`, `A` halts on all inputs. Now consider `D(langle D rangle)`. Machine `D` halts if and only if `A` on input `langle D, langle D rangle rangle` rejects. But `A` on input `langle D, langle D rangle rangle` rejects means that `D` did not halt on input `langle D rangle`. This is contradictory. A similar argument can be made about if `D` does not halt `langle D rangle`. Since assuming the existence of `A` leads to a contradiction, hence `A` must not exist. Q.E.D.

Another way to look at this is if you give an `A` which purports to be a decider for `A_{TM}` then we can give a specific input, `langle D, langle D rangle rangle`, which is calculated based on `A` on which `A` fails to decide `A_{TM}`.