We recall a few basic definitions. Let $ M$ be a Turing Machine over $\Sigma^*$ and $ f:\Sigma^*\rightarrow\{0,1\}$ be a decision problem. Then:

  • $ M$ accepts $ f$ $ \iff$ $ \forall w\in\Sigma^*: M(w) = 1 \iff f(w) = 1$ and $ M(w) = \bot \text{ otherwise }$
  • $ M$ decides $ f$ $ \iff$ $ M$ accepts $ f$ and $ M$ halts for all inputs.

We say:

  • $ f$ is recursively enumerable if $ f$ is accepted by some Turing Machine;
  • $ f$ is recursive if $ f$ is decided by some Turing Machine;

Let $ RE$ and $ R$ be the sets of recursively-enumerable and recursive functions, respectively. We say:

  • $ f$ is decidable $ \iff$ $ f$ it is recursive
  • $ f$ is semi-decidable $ \iff$ $ f$ it is recursively-enumerable, but not recursive
  • $ f$ is undecidable $ \iff$ $ f$ it is not recursive

We note that the former (semi-decidable / undecidable) may appear in the literature with slightly different meanings. Whenever we want no ambiguity, we prefer the terms recursive / recursively-enumerable.

Recursive / Recursively-enumerable problems

In order to show that a problem is recursive (resp. recursively-enumerable) it is sufficient to write Turing Machines which decide (resp. accept) the problem. Often, we specify these machines as pseudo-code, when the employed instructions (e.g. for each, if) are clearly representable by a Turing Machine.

The importance of such pseudocode is to highlight the (decidable) nature of the problem: can an answer to a problem instance always be given, or not?

Proving a problem is NOT recursive

The widely-known technique is called Turing-reduction. Suppose $ f:\Sigma^* \rightarrow \{0,1\}$ is a studied problem. The reduction technique implies the following:

  1. select a problem $ g:\Sigma^* \rightarrow \{0,1\}$ which is not recursive (we know this a priori)
  2. construct a transformation $ T:\Sigma^*\rightarrow\Sigma^*$ such that:
    1. $ T$ can be implemented as a Turing Machine which always halts
    2. $ \forall w\in\Sigma^*: g(w) = 1 \iff f(T(w))=1$ (this double implication must be proven in steps)

Once such a transformation is shown to exist for a particular $ g$ , we say:

  • $ g$ is Turing-reducible to $ f$ , and write $ g\leq_T f$

The informal intuition is that problem $ f$ is at least as hard as problem $ g$ , since, if we can solve (decide) $ f$ , we are guaranteed to solve (decide) $ g$ . The argument is as follows:

  • suppose $ M_f$ decides $ f$ .
  • we construct $ M_g(w) = M_f(T(w))$ . Then:
    • $ M_g$ always halts, since: (i) $ T$ always halts (ii) $ M_f$ always halts (since it decides $ f$ )
    • $ M_g(w) = 1 \iff g(w) = 1$ , due to the above properties of $ T$ (see above)
  • we have shown $ M_g$ decides $ g$ .

Finally, having shown $ g\leq_T f$ , we have constructed a reductio-ad-absurdum argument. If we recall point 1: $ g$ is not decidable. However, by assuming $ f$ is decidable, we have shown we can decide $ g$ . Contradiction!

How to choose $ T$ and $ g$

There is no general rule on how to choose $ g$ and how to construct $ T$ , when studying a particular problem $ g$ . As in any other activity, a lot of practice helps. Sometimes, reductions from similar problems seem to be easier.

One general observation is that $ T$ and $ g$ must be thought of in tandem, such that condition b. can be proven (usually, the trickiest part of a reduction)

Some undecidable problems

There are many undecidable problems of practical interest for us, apart from the halting problem. We enumerate a few:

  • Determining the validity of a sentence from First-Order Logic (FOL). FOL has numerous applications in databases, artificial intelligence, knowledge representation.
  • Diophantine equations: finding a general algorithm for solving any diophantine equation is one of famous Hilbert problems - some of the hardest problems in mathematics at the beginning of the 1900s. It is now known that solving an arbitrary diophantine equation is undecidable. Solving diophantine equations has many applications in:
    • chemistry (balancing out molecular values in chemical equations)
    • cryptography (finding strong encryption keys which are not vulnerable to brute-force attacks)
  • Post's correspondence problem - with applications in group theory and combinatorics on words
  • The tiling problem - with applications in molecular biology

We do not study these problems for the following reason:

  • reduction proofs for each of these problems is technically hard (some reductions have taken considerable research effort)
  • the problems themselves and their applications requires more background than what is covered at this lecture

Instead, we study simpler problems, where we can focus more on each of the reduction steps, and less on the reduction itself.

Exercises

Show that the following problems are not recursive. Which of them are recursively-enumerable? How can we prove a problem is not recursively-enumerable?

Halting on all inputs

$$ f_1(M) = \left\{\begin{array}{ll} 1 & M \text{ halts on all inputs } \\ 0 & \text{ otherwise }\end{array}\right.$$

Halting on some word

$$ f_2(M) = \left\{\begin{array}{ll} 1 & M \text{ halts on word } v \\ 0 & \text{ otherwise }\end{array}\right.$$

Machine equivalence

$$ f_3(M_1,M_2) = \left\{\begin{array}{ll} 1 & M_1 \text{ and } M_2 \text{ halt on exactly the same inputs } \\ 0 & \text{ otherwise }\end{array}\right.$$

Computing the reverse

$$ f_4(M) = \left\{\begin{array}{ll} 1 & M(w) = \text{reverse}(w) \\ 0 & \text{ otherwise }\end{array}\right.$$

Halting on own encoding

$$ f_5(M) = \left\{\begin{array}{ll} 1 & M(enc(M)) \text{ halts } \\ 0 & \text{ otherwise }\end{array}\right.$$

More stuff

  • When discussing the reduction scheme, we assumed both problems ($ f$ and $ g$ ) are defined over the same alphabet. Should this generally be the case? Can we bypass this restriction?
  • Mathematically, $\leq_T \subseteq \mathbb{H}om(\mathbb{N},\{0,1\}) \times \mathbb{H}om(\mathbb{N},\{0,1\})$, i.e. $\leq_T$ is a relation over decision problems. What properties does $\leq_T$ have?
  • (i.e. is it: reflexive, symmetric, antisymmetric, transitive.)
  • how can we use these properties in real-life?
  • In a lot of literature, a decision problem is also modelled as a language, that is, a set $ L$ of words - a subset of $ \Sigma^*$ . The words in $ L$ are the set of yes-instances of the problem, while those outside $ L$ - the set of no-instances. This is very similar in spirit with our dual definition for interpretations (as functions, or as sets). This definition for problems will be employed in the 3-rd year lecture on formal languages (LFA).