skip to content

questions

4

What does calling an evaluation model Turing complete require you to demonstrate about it?

level: middleimportance: must knowfreq 60%

answer

  1. power, not speed
  2. you cannot enumerate the functions
  3. reduce to a known-complete model
  4. unbounded storage, conditional, unbounded repetition
  5. a fixed depth cap breaks the simulation

basics

~20 s

Turing complete means the model can simulate an arbitrary Turing machine, so it computes exactly the functions a Turing machine computes. You demonstrate it by building an interpreter for an already-complete model, such as a register machine, inside the candidate.

solid answer

~40 s

The claim is that the model can **simulate any Turing machine**: for every machine and input you can mechanically construct something in the model whose evaluation reproduces that run. Nobody shows this by enumerating computable functions; you reduce to a model already known to be complete and build an interpreter for it inside the candidate. A register machine with a couple of unbounded counters, `increment` and `decrement-and-branch-if-zero` is the cheapest target, so in practice you show three ingredients: unbounded storage, a conditional, and repetition whose trip count no fixed cap bounds. Direction matters — simulating a Turing machine *inside* your model proves it is at least as powerful; being simulable *by* one proves it is no more powerful, and only both together give equality.

go deeper

for a junior

Recall the one-line meaning: a Turing complete system can express any computation a Turing machine can, and it needs unbounded storage plus repetition that is not capped in advance to get there.

for a middle

Explain that the claim is settled by simulation, not by inventory: you build an interpreter for an already-complete model inside the candidate, and the three ingredients you look for are unbounded storage, a conditional, and unbounded repetition.

for a senior

Show you can apply the test to something you own. Point at the cap in a real evaluator and say whether it is a genuine bound that no input can raise, or a limit a program can lift from inside.

for a principal

Frame completeness as a guarantee traded away rather than a capability gained. Once a specification carries no bound, no tool can bound an arbitrary input's evaluation, and that shapes what your platform can promise about the artefacts it runs.

## What the term actually claims A model of computation is **Turing complete** when it can simulate an arbitrary Turing machine: for every machine and every input there is something you can mechanically construct in the model whose evaluation reproduces that run — the same result when the machine halts, and no result when it does not. The claim is about **which functions** the model can compute. It says nothing about speed, memory use, or whether the model is pleasant to write in. Most models anyone asks about are also **Turing equivalent**: complete, and simulable *by* a Turing machine, so the two compute exactly the same class of functions. The direction is the easiest thing here to get backwards: - Simulating a Turing machine **inside** your model proves your model is **at least as powerful**. - Simulating your model **on** a Turing machine proves it is **no more powerful**. - Only both together give equality. The phrase *Turing complete* names the first direction alone. ## Why simulation is the only usable test You cannot establish completeness by listing the functions a model computes and ticking them off — the set is infinite and has no finite checklist. So every completeness argument is a **reduction**: take a model already known to be complete, and build an interpreter for it inside the candidate. If the candidate can run that interpreter, it can run anything that model can run, and completeness transfers to the candidate. That is why the same handful of small witnesses keeps appearing in these arguments. | Model | What holds the state | What one step does | |---|---|---| | Turing machine | a tape, a head position, a control state | rewrite the current cell, move the head, change state | | Lambda calculus | a single term | reduce one redex by substituting an argument into a body | | Register machine | finitely many unbounded counters | increment, or decrement-and-branch-if-zero | | Tag system | a queue of symbols | delete a fixed-length prefix, append a word chosen by the first symbol | | Cellular automaton | a line of cells with a fixed neighbourhood rule | update every cell simultaneously from its neighbours | A register machine with two unbounded counters and those two instructions is already complete, given a suitable encoding of the input. That is why it is usually the cheapest target: you only have to show the candidate can hold an unbounded number, test it against zero, and jump on the result. ## What a completeness argument looks like in practice 1. **Pick the target.** A counter machine or a bare applicative core, because each has a tiny instruction set and correspondingly little to encode. 2. **Find the three ingredients** in the candidate: unbounded storage, a conditional, and repetition whose number of iterations is not fixed in advance — general recursion, or a loop whose continuation depends on a computed value. 3. **Exhibit the encoding.** Say how a target state is represented in the candidate, and how one target step becomes one or more candidate steps. 4. **Check that nothing caps the run.** A fixed recursion depth, a fixed iteration count, or a ceiling on value size that no input can raise defeats the simulation. Such a system is *not* complete; it is a bounded approximation of a complete one, and every one of its evaluations terminates by construction. Step 4 is where real systems land. Take away the unbounded storage and you fall back to something a finite-state recogniser could do; take away unbounded repetition and evaluation always terminates, which is usually the property a format's designers wanted in the first place. ## The finiteness objection Every physical implementation has finite memory, so strictly speaking it is an enormous finite-state machine and not a Turing machine at all. That is true and mostly unhelpful. The label is applied to the **model** — the language as specified, with no bound written into it — and the point of the label is precisely that *the specification imposes no bound*, so no inspection of a program text tells you how long an arbitrary input will take. A candidate who answers "but real machines are finite" and stops has dodged the question rather than answered it. ## What completeness does not buy you - **Not speed.** Two complete models can differ by any amount of work on the same problem; the equivalence constrains the computable set, not the cost. - **Not engineering expressiveness.** A complete model may make ordinary tasks miserable. *Complete* and *convenient* are unrelated properties. - **Not capability.** Reading a file, opening a socket or reading a clock are not computation; a complete model has none of them unless something outside the model supplies them. - **Not analysability.** Crossing into completeness is exactly where an evaluator loses the ability to bound its own work by looking at its input — which is why formats that carry untrusted content treat the crossing as a decision, not a feature.

  • Does a language with a fixed maximum recursion depth count as Turing complete?
    No. If no input can raise the cap, every evaluation terminates by construction and the simulation of an arbitrary machine fails at whatever depth the cap bites. It is a bounded approximation: complete enough for the programs that fit, and analysable precisely because it is bounded. If a program can raise the cap at run time, the bound is not a bound and completeness comes back.
  • Why is simulating a two-counter register machine usually the cheapest route to the claim?
    Its whole instruction set is increment and decrement-and-branch-if-zero over unbounded counters, so the encoding you must exhibit is tiny: somewhere to keep an unbounded number, a zero test, and a jump. Anything more elaborate — a tape, substitution rules — means more machinery to encode for no extra strength, since all of these models compute the same functions.
  • What is the difference between saying a model is Turing complete and Turing equivalent?
    Complete is one direction: the model can simulate any Turing machine, so it is at least as powerful. Equivalent is both directions: it is also simulable by a Turing machine, so it is no more powerful either, and the two compute exactly the same class of functions. Every ordinary computational model is equivalent, so the words get used interchangeably — but the proofs are not the same proof.

Proving a new set of hand tools can build anything a full workshop can does not mean listing every object in the world. You use the tools to build the workshop's machines, and let those machines do the rest.

saying these in an interview costs you the question

  • Says Turing complete means the language can do anything, including network and file access
  • Assumes any loop or recursion construct makes a system complete, ignoring caps and finite storage
  • Claims a complete language is faster or more efficient than a restricted one
  • Treats simulating a Turing machine and being simulated by one as the same statement
  • Argues the term is meaningless because real machines are finite, and stops there
  • Tries to argue completeness by listing features rather than by a simulation
open as a page

A declarative configuration template language gained recursion, and some renders never finish — how do you make evaluation safe?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Conditionals plus recursion plus arithmetic over unbounded values pushed the format into Turing completeness, so no inspection of a template bounds its evaluation. The fix is to bound the evaluator itself: a step budget, an expansion-depth cap and an output-size cap, enforced deterministically.

open as a page

A configuration format's users want general loops; how do you decide whether to let it become Turing complete?

level: principalimportance: should knowfreq 33%

basics

~20 s

Decide by what the platform must keep promising. Staying below completeness keeps evaluation bounded by inspection, so files stay reviewable, cacheable and safe to run from untrusted sources. Ask which repetition users actually need before trading that away.

open as a page

Lambda calculus and register machines compute the same functions, so what does that equivalence not promise?

level: middleimportance: nice to knowfreq 26%

basics

~20 s

Equivalence fixes only which functions are computable. It promises nothing about running time, memory, ease of expression, or access to input and output, so two equivalent models can differ by any amount of work on the same problem.

open as a page