Title

ECS 120 Theory of Computation
Undecidability
Julian Panetta
University of California, Davis

Undecidability

  • We now study the absolute limits of what can be computed by algorithms.
  • Whereas \(\NP\)-complete problems are not (known to be) solvable by efficient algorithms,
    certain problems are not solvable by any algorithm no longer how much time is allowed.
  • The first example of such a problem is the halting problem: \[ \probHALT = \setbuild{\encoding{M, w}}{M \text{ is a Turing machine that halts on } w} \]

Recall the terminology for TM computation:

A language \(A\) is called Turing-recognizable (or Turing-acceptable, recursively enumerable, or
computably enumerable) if some Turing machine \(M\) recognizes it (\(L(M) = A\)).

A language \(A\) is called Turing-decidable if there exists a total Turing machine \(M\) (a decider) such that \(L(M) = A\). In other words \(M\) accepts all \(w \in A\) and rejects all \(w \notin A\).

Recognizing \(\probHALT\)

  • A recognizer is easy to write for \(\probHALT\):
    • Given \(\encoding{M, w}\), run \(M\) on \(w\).
    • If \(M\) halts, accept.
    • Otherwise, we can simply run forever.
def halt_recognizer(M, w):
  """
  M: a Python function
    (stand-in for a Turing machine)
  w: an input string
  """
  M(w)
  return True
def M1(w):
  count = 0
  for c in w:
      if c == 'a':
          count += 1
  return count > 5

w = 'abcabcaaabcaa'
halt_recognizer(M1, w) # returns True
def M2(w):
  i = 0
  while i < len(w):
      if w[i] != 'c':
          i += 1
  return w

w = 'abcabcaaabcaa'
halt_recognizer(M2, w) # never returns...

Theorem (Turing): \(\probHALT\) is not decidable.

Once we prove this, we can use Turing reductions to show that many other problems are also undecidable.

Turing Reductions

  • To prove a problem \(A\) is undecidable, we can reduce from \(\probHALT\).
    • We show how \(\probHALT\) can be decided by a decider for \(A\).
    • Since \(\probHALT\) is not decidable, the decider for \(A\) cannot exist.
  • The reductions we use for decidability are more general than the “mapping reductions” we used to prove \(\NP\)-hardness.
  • The reduction we used from \(\NP\)-hard problem \(A\) to prove \(B\) is \(\NP\)-hard:
    • Used input conversion function \(f\) that runs in polynomial time.
    • Returned \(M_B(f(x))\) (ran \(M_B\) exactly once and returned its output unmodified).
  • Turing reductions relax these requirements, allowing:
    • arbitrary time complexity for \(f\),
    • multiple calls to \(M_B\) on potentially different inputs, and
    • arbitrary (but finite) computation on the results.