Question text is in black, solutions in blue.
Q1: 10 points Q2: 10 points Q3: 10 points Q4: 10 points Q5: 10 points Q6: 25 points Q7: 15 points Q8: 30+15 points Total: 120+15 points
Correction in orange added 20 March 2015.
If C is any class of computers, such as DFA's, CFG's, LBA's TM, strange variant TM's, etc.:
The language DECIDER is the set {(M): M halts (either accepts or rejects) on every input}.
Recall that if A and B are two languages, A is mapping reducible to B, written A ≤m B, if there exists a function f: Σ* → Σ* such that for any string w, w ∈ A ↔ f(w) ∈ B.
A language A is Turing recognizable (TR) if it equals L(M) for some Turing machine M.
A is Turing decidable if A = L(M) for some Turing machine M that always halts.
A function f is Turing computable if there exists a Turing machine M such that for any string w, M when started on w halts with f(w) on its tape.
A stupid Turing machine (STM) has one tape which "wraps around" -- moving left from its leftmost cell takes you to its rightmost cell, and moving right from its leftmost cell takes you to its leftmost cell. It begins with the input string filling the entire tape.
A very stupid Turing machine (VSTM) is like an STM except that for some of its state-letter pairs it may replace the current cell with two cells, writing to both of them, instead of just writing to the current cell. Thus its transition function is δ (Q × Σ) ↔ (Q × (Σ ∪ (Σ × Σ)) × {L, R}).
The function S from N × N to N is defined as follows. Consider all the k-state Turing machines with tape alphabet {0, 1, blank} and consider all input strings in {0, 1}n. S(k, n) is the number of steps taken by the longest of any of the halting computations of any of these machines on any of these inputs. (This is similar to the "busy beaver function" but is not exactly the same thing.)
TRUE. The size of the tape never changes. On input w of length n, if the STM runs for more than |Q||Σ|n + 1 steps, it must have repeated a configuration and (since it is deterministic) it must be in a loop. So an ordinary TM can simulate the STM for that many steps and reject if it hasn't halted at the end of them.
FALSE.. ATM ≤m AVSTM. We convert an arbitrary one-tape TM M into an equivalent VSTM M' by having it use the two-cell write to add a blank cell to the right end of the tape when needed. We also put markers on M' so that it will never use its wraparound. Then the reduction has (M, w) ∈ ATM if and only if (M', w) ∈ AVSTM.
TRUE. An STM can simulate a DFA by marking the first cell of its tape, simulating the DFA until it sees the first square again, then accepting if and only if the DFA is in a final state.
FALSE. It is true that REGCFL ≤m REGTM. Given a CFG G, our reduction function just needs to output a Turing machine MG that has the same language as G. On input w, MG can run the CKY algorithm, or the slower decision procedure for ACFG given in Sipser, to test whether w is in L(G). Thus (G) ∈ REGCFG ⇔ (MG) ∈ REGTM.
TRUE. Every TR language is L(M) for some Turing machine M. Every TM M is represented by a finite string (M) over {0, 1}. The set of strings over any finite alphabet is in bijection with N and thus is countably infinite. The (M) strings are a subset of this countably infinite set and are thus countable. It remains to show that the set of TR languages is infinite -- this follows, for example, from the fact that every singleton language {w} is TR.
COMPNFA = {(N, N'): L(N) = Σ* ∖ L(N')}. We need an always-halting TM that will decide whether the languages of N and N' are complements, given input (N, N'). It will first construct DFA's D and D' with L(D) = L(N) and L(D') = L(N') by the subset construction. Then it builds another DFA D'' such that L(D'') is the symmetric difference of L(D) and L(D') -- the set of strings that are in both L(D) and L(D'), or are in neither. Finally it searches the graph of D'' to see whether there is a path from its start state, with any labels, to any final state. If so it rejects, if not it accepts.
It is NOT Turing decidable. Let G∅ be a fixed grammar with no rules, so that L(G∅) = ∅. Given any grammar G, define f(G) to be the pair (G, G∅). Then G ∈ ALLCFG ⇔ (G, G∅) ∈ COMPCFG. This reduction proves that ALLCFG ≤m COMPCFG. Since ALLCFG is not TD, neither is COMPCFG.
Here is a decider for ATM, given the assumption that the
function S exists. On input (M, w), recode M and w if necessary
so that M's tape alphabet is {0, 1, blank} and w is in {0,
1}*.
Then let k be the number of states in M and let n = |w|. Simulate
M on w for at most S(k, n) steps. If it halts, accept or reject
as it does. If it runs out of time, reject.
If M halts on w, by the definition of S it must do so within
S(k, n) steps. So this decider accepts (M, w) if and only if M
accepts w, and thus it decides the undecidable language ATM.
We reduce ATM to DECIDER. Given a pair (M, w), let f(M, w) be the TM N that ignores its input and then runs M on w, accepting if M accepts w and going into an infinite loop if M rejects w. If (M, w) ∈ ATM, N halts on any input and thus (N) ∈ DECIDER. But if (M, w) ∉ ATM, then N never halts on any input and thus N ∉ DECIDER. This f is the desired reduction, and thus DECIDER must be undecidable because ATM is.
Define the following machine D. On input w, D obtains its own
description
(D). If w and (D) are not the same string, D accepts w.
Otherwise, D uses the assumption to decide whether (D) ∈
DECIDER.
If it is, D runs forever, and if it is not, D accepts.
Thus D halts on all inputs if and only if (D) ∉ DECIDER,
which is a contradiction.
Many people wanted to allow the DECIDER-decider to obtain its
own description, but the Recursion Theorem only says that you can
design a new machine to obtain its own description and then do
something with it.
We show ALLTM ≤m DECIDER. Let f((M)) be (M'), so that M' is a machine that runs forever on input w if M rejects w, and accepts w if M accepts w. (It does not halt on w if M does not halt on w.) Then (M) ∈ ALLTM ⇔ (M') ∈ DECIDER.
Given any Turing machine M, let f(M) = (M, M') where M' is a machine
that accepts a string w if and only if M halts and rejects it. If (M)
∈ DECIDER, (M, M') is in COMPTM because every string
is either accepted or rejected by M, but not both, so that L(M) and
L(M') are complements. If (M) ∉ DECIDER, then there exists a
string w such that M does not halt on w, and this w is in neither L(M)
nor L(M'), so that L(M) and L(M') are not complements.
Together with (c), this proves that COMPTM is not TR.
Together with (e), it proves that COMPTM is
Π2 hard.
Let A satisfy the statement ∀w: [w ∈ A ⇔
∀x:∃y: (w, x, y) ∈ B] for some TD language B.
Given any string w, let M be a TM that on input x, looks for a y
such that (w, x, y) is in B, by trying all y's in parallel by
dovetailing. (For example, for each n in succession it could run the
test for each of the first n y's, for n steps each.)
Now w ∈ A ⇔ ∀x:∃y: (w, x, y) ∈ B
⇔ ∀x: halts on input x ⇔ (M) ∈ DECIDER.
(An alternate proof is to observe that we proved A ≤m
ALLTM on the homework, and then use part (d) and the
transitivity of ≤m.)
Last modifie 20 March 2015