4.6.15 · D3Theory of Computation

Worked examples — Church-Turing thesis

3,214 words15 min readBack to topic

Before anything, four plain-word anchors so no symbol is unearned:

Two of the cells below name a machine-building trick we must define before we use it — otherwise the map below is meaningless:


The scenario matrix

Every exam problem on CTT is really the question "which of the three boxes does this land in, and why?" Here is the full grid of case-classes this topic can hand you:

Cell Case class The trap it tests
A Base / trivial function (constant, successor) Can you show it from the ground up?
B for-loop function (primitive recursive) Bounded search ⇒ always halts
C Fast-growing but still computable (Ackermann) for loops alone miss it; need the while search
D while-loop that may loop forever (partial) Where partial functions come from
E Model-swap invariance (multi-tape, quantum, RAM) "More powerful" faster, not more computable
F Real-world word problem (is prime?) Use CTT to skip drawing a TM
G Degenerate / zero input Does the recipe survive the empty/edge case?
H Limiting / impossible case (Halting) CTT turns "no TM" into "no algorithm at all"
I Exam twist (the "busy beaver"/oracle bait) Definable ≠ computable

The nine examples below hit every cell. Each is tagged with its cell letter.


The map you are sorting into

Now that for/while (primitive recursion / -minimization) are defined, the map is readable:

Figure — Church-Turing thesis

Look at the three nested regions. Everything primitive-recursive (for loops, cell B) sits inside everything reachable with the while search (cell D), which — by the theorem — equals Turing-computable. Cell C (Ackermann) lives in the ring between B and D: computable but not for-only. Cell H (Halting) sits outside the whole picture. Keep this figure in your head; every example is a dot on it.


The examples

Figure — Church-Turing thesis

The blue and yellow curves are what any for-loop cost can reach; the pink Ackermann-like curve blows past both on a log scale — a visual reason a for-only scheme can never keep up, so is genuinely needed to stay inside the computable region (cell C sits in the ring on the first figure).


Recall Rapid-fire self-test over the whole matrix

Which cell is each in? Answer before revealing. ::: Cell A — base composition, region B, total. ::: Cell B — primitive recursive, always halts. Ackermann ::: Cell C — total computable but NOT primitive recursive. ::: Cell D — partial (loops on odd ). A quantum computer's output function ::: Cell E — same set as a plain TM, only faster. "Is prime?" ::: Cell F — bounded loop, decidable, invoke CTT. Value of ::: Cell G — , the degenerate base, no loop runs. Halting problem ::: Cell H — undecidable; CTT makes it universal. Busy Beaver ::: Cell I — well-defined yet uncomputable.


See also: Turing Machine, Lambda Calculus, Mu-Recursive Functions, Halting Problem, Decidability and Recursive Languages, Universal Turing Machine, Computational Complexity, P vs NP.