Self-Assessment Quiz: Computability and the Halting Problem
Twenty questions to check your understanding. Answer before opening the key. Aim for 16+. Throughout, "program" means "Turing machine" (the Church–Turing thesis lets us use the words interchangeably).
Question 1
A Turing machine is required to have a finite set of states and a finite transition function, but one component is unbounded. Which?
A) the input alphabet $\Sigma$ B) the tape C) the set of accept states D) the number of directions the head can move
Question 2
On a given input, a Turing machine has exactly how many possible fates?
A) one (it always accepts) B) two (accept or reject) C) three (accept, reject, or loop forever) D) infinitely many
Question 3
The single capability a Turing machine has that a DFA (Chapter 35) lacks, and which makes "loop forever" possible, is:
A) a larger alphabet B) a writable, unbounded tape that the head can revisit C) more than one accept state D) nondeterminism
Question 4
The Church–Turing thesis is best described as:
A) a theorem proved by Turing in 1936 B) a definition of "Turing machine" C) an evidence-backed claim equating "computable by an algorithm" with "computable by a Turing machine" D) a conjecture that has since been disproved
Question 5 (True/False, justify)
True or false: Because the lambda calculus, general recursive functions, and Turing machines were all proved to compute the same functions, the Church–Turing thesis is therefore proved. Justify in one sentence.
Question 6
The single difference between a decider and a recognizer for a language $L$ is:
A) a decider accepts members of $L$; a recognizer does not B) a decider may loop on members; a recognizer may not C) a decider halts on every input; a recognizer may loop forever on non-members D) there is no difference
Question 7
"Run program $P$ on input $x$ and accept if it stops" is:
A) a decider for the halting problem B) a recognizer for the halting problem, but not a decider C) neither a recognizer nor a decider D) a decider for the complement of the halting problem
Question 8
Which containment is correct?
A) recognizable $\subsetneq$ decidable B) decidable $\subsetneq$ recognizable C) decidable $=$ recognizable D) decidable and recognizable are disjoint
Question 9
In the halting-problem proof, the single assumption made for contradiction is:
A) that programs are uncountable B) that a decider $H$ for the halting problem exists C) that the program $D$ halts on all inputs D) that the tape is finite
Question 10
The contrarian program $D$ in the proof is defined to:
A) always halt B) always loop C) run $H(P,P)$ and then do the opposite of what $H$ predicts D) simulate $P$ on $x$ step by step
Question 11
The contradiction that ends the halting proof is the statement:
A) "$H$ is both a decider and a recognizer" B) "$D$ halts on $D$ if and only if $D$ does not halt on $D$" C) "programs are both countable and uncountable" D) "$D$ accepts every input and rejects every input"
Question 12 (True/False, justify)
True or false: The procedure "simulate $P$ on $x$ for $10^6$ steps; if it halted say 'halts,' else say 'loops'" decides the halting problem because it always terminates. Justify in one sentence.
Question 13
"$A \le B$" (problem $A$ reduces to problem $B$) means:
A) $A$ is at least as hard as $B$ B) $B$ is at least as hard as $A$ — a solver for $B$ would solve $A$ C) $A$ and $B$ are equally hard, always D) $A$ is decidable and $B$ is not
Question 14
To prove a new problem $B$ is undecidable by reduction, you must show:
A) $B \le \mathrm{HALT}$ B) $\mathrm{HALT} \le B$ C) $B \le B$ D) $B$ is recognizable
Question 15
In the reduction proving the empty-acceptance problem ($\mathrm{EMPTY}$) undecidable, the constructed program $P'$ is built so that:
A) $P'$ halts iff $P$ loops B) $P'$ accepts nothing iff $P$ loops on $x$ C) $P'$ accepts everything iff $P$ loops on $x$ D) $P'$ is identical to $P$
Question 16
Why is it essential that building the gadget $P'$ does not require running $P$?
A) running $P$ would be too slow B) if building $P'$ required running $P$, the reduction itself might never halt and so would not be an algorithm C) $P$ might modify $P'$ D) it isn't essential; running $P$ is fine
Question 17 (True/False, justify)
True or false: The problem "does program $P$ halt on input $x$ within 10,000 steps?" is undecidable, just like the unbounded halting problem. Justify in one sentence.
Question 18
A static analyzer that is sound but incomplete has which property?
A) every bug it reports is real, but it misses some real bugs B) it reports every real bug, but some reports are false alarms C) it reports exactly the real bugs and nothing else D) it never reports anything
Question 19
Undecidability forces a behavioral program-analysis tool to give up at least one of soundness and completeness because:
A) hardware is too slow B) a tool that was both sound and complete for a nontrivial behavioral property would decide an undecidable problem C) programmers prefer false alarms D) the Church–Turing thesis forbids it
Question 20 (Short answer)
Name two distinct strategies real tools use to cope with an undecidable question, with a one-word example of each (drawn from §36.6).
Answer Key
| Q | Ans | Note |
|---|---|---|
| 1 | B | Only the tape is unbounded; states, alphabets, and $\delta$ are all finite. |
| 2 | C | Accept, reject, or loop forever — the third fate is what creates undecidability. |
| 3 | B | A writable, unbounded, revisitable tape; a DFA must halt when its finite input ends. |
| 4 | C | It equates a precise notion with an informal one — a claim, not a theorem. |
| 5 | False | Those equivalences are theorems, but the thesis links the formalism to the informal "any mechanical procedure," which cannot be formally proved. |
| 6 | C | A decider halts on every input; a recognizer may loop forever on non-members. |
| 7 | B | It accepts every halting case but loops forever (never says "no") on non-halting ones — a recognizer, not a decider. |
| 8 | B | Every decidable language is recognizable; HALT is recognizable but not decidable, so the containment is proper. |
| 9 | B | The lone assumption is that a halting decider $H$ exists. |
| 10 | C | $D$ runs $H(P,P)$ and does the opposite — the self-defeating construction. |
| 11 | B | "$D$ halts on $D$ $\iff$ $D$ does not halt on $D$" — a statement equivalent to its own negation. |
| 12 | False | It always terminates but is not correct: a program halting at step 1,000,001 is wrongly labeled "loops." Correctness and halting are both required. |
| 13 | B | Reductions transfer power down and impossibility up: $B$ is at least as hard as $A$. |
| 14 | B | Reduce the known-hard problem to the new one ($\mathrm{HALT} \le B$); the other direction proves nothing. |
| 15 | B | $P'$ ignores its input and runs $P$ on $x$, so it accepts nothing exactly when $P$ loops. |
| 16 | B | The reduction must be a finite algorithm; running $P$ could loop forever, breaking that. |
| 17 | False | The bounded question is decidable — simulate at most 10,000 steps; only the unbounded halting problem is undecidable. |
| 18 | A | Sound = every warning is real; incomplete = some real bugs are missed. |
| 19 | B | Sound-and-complete for a nontrivial behavioral property would decide the undecidable (Rice's theorem). |
| 20 | — | Any two of: bound the resource (timeout/gas), restrict the language (regex/SQL, non-Turing-complete), be conservative (type checker), ask a human (proof assistant). |
Topics to review by question
| Questions | Topic |
|---|---|
| 1–3 | The Turing machine model and the three fates (§36.1) |
| 4–5 | The Church–Turing thesis: status and evidence (§36.2) |
| 6–8 | Decidable vs. recognizable; the containment (§36.3) |
| 9–12 | The halting-problem proof: assumption, $D$, the biconditional, the bounded-simulation trap (§36.4) |
| 13–16 | Reductions: direction and the gadget-builder (§36.5) |
| 17–20 | Consequences for engineering: bounded questions, soundness vs. completeness, coping strategies (§36.6) |