skip to content

Each Chomsky tier is matched to a recogniser — what memory does each machine add over the tier below?

level: middleimportance: should knowfreq 52%

answer

  1. One rung, one kind of memory
  2. No memory beyond the state count
  3. Unbounded depth, only the newest readable
  4. Working space capped by input length
  5. Cap removed at the top rung

basics

~20 s

One rung, one kind of memory. A finite-state machine holds only its current state. A pushdown machine adds an unbounded store where only the newest symbol is readable. A linear-bounded machine adds re-readable space no larger than the input. A tape machine removes the size limit.

solid answer

~50 s

Each tier is matched to the weakest machine that accepts exactly its languages, and each rung differs from the one below by **one kind of memory**. Type 3 is accepted by a **finite automaton**: its only memory is which of finitely many states it is in. Type 2 is accepted by a **pushdown automaton**, which adds a store of unbounded depth whose newest symbol is the only one readable — enough for properly nested structure. Type 1 is accepted by a **linear-bounded automaton**, a nondeterministic tape machine whose working region is capped at a constant multiple of the input length, so it can re-read and compare distant parts of one input. Type 0 is accepted by a **Turing machine**, which is the same thing without the size cap; note it is only guaranteed to *accept* members, not to halt on non-members. Power comes from the memory's shape, never from its size.

go deeper

for a junior

Recall the pairing in order: finite-state, pushdown, linear-bounded, tape. Each one accepts exactly one tier of the hierarchy, and each is the weakest machine that can do its tier's job.

for a middle

Explain what memory each rung adds and why that shape matches the tier — bounded state, a store whose newest symbol is the only readable one, re-readable space the size of the input, then no size limit at all.

for a senior

Translate the ladder into a resource bill for a real validator: constant memory at a trust boundary, an input-controlled depth that needs a cap, or a check that forces you to buffer the whole input rather than stream it.

for a principal

Own the consequence for a system boundary. Which rung your input format sits on decides whether validation can be bounded in advance, whether it can run on a stream, and whether an attacker chooses how much memory you allocate.

## One rung, one kind of memory The hierarchy is usually first met as four restrictions on grammars. Its real force is that each restriction is matched, exactly, by a class of machine: the languages a tier's grammars generate are precisely the languages that tier's machine accepts. So the ladder can be read from either end — as "what shape may my rules have" or as "what must my validator be able to remember". The second reading is the one that survives into engineering work, because it tells you what a checker has to hold in memory while it runs. What changes from rung to rung is not how fast the machine is or how many states it has. It is the **shape of the memory** it is allowed to keep. ## The four recognisers | Tier | Recogniser | Working memory | What that memory can check | |---|---|---|---| | 3 | finite automaton | the current state, drawn from a fixed finite set | facts expressible as a bounded amount of "what I have seen so far" | | 2 | pushdown automaton | one store of unbounded depth, newest symbol readable | properly nested structure, one open context at a time | | 1 | linear-bounded automaton | a read/write region within a constant factor of the input length | relations between distant parts of a single input | | 0 | Turing machine | unbounded read/write tape | anything a mechanical procedure can confirm at all | - The **finite automaton** has no memory outside its state. Determinism is not the issue here: the nondeterministic and deterministic versions accept exactly the same languages, so nondeterminism buys convenience and state count, not power. - The **pushdown automaton** gains a store with unbounded capacity but a severe access rule — you see only what was written most recently. That is precisely the shape that matches nesting, because the innermost unclosed context is always the most recent one. - The **linear-bounded automaton** is defined as a nondeterministic tape machine that may use only the region its input occupies, up to a constant factor. It can overwrite, re-read, and walk back and forth across that region, which is what lets it compare two widely separated parts of the same input. It cannot grow scratch space beyond the input's size. - The **Turing machine** is the linear-bounded machine with the size cap removed. Because there is no bound, a run need not terminate: a type 0 machine is guaranteed to accept every member of its language, and is guaranteed nothing about a non-member. What follows from that belongs to the study of decidability, which is a neighbouring subject. ## What each memory cannot do 1. **Finite state cannot count without a bound.** It can distinguish only finitely many histories, so past some threshold two different prefixes become indistinguishable to it. If the language needed them treated differently, the machine is now wrong on some input. 2. **A last-in-first-out store cannot compare in the original order.** Reading it back gives the reverse of the order it was written, which is what makes mirrored structure easy and same-order repetition hard. 3. **Linear space cannot run an unbounded side computation.** Anything needing working space that grows faster than the input is out of reach. ## Why scaling a machine never promotes it A very common wrong answer is that a finite machine with enough states, or a pushdown machine with a deep enough store, reaches the next tier. It does not. "Finite" is the entire restriction at type 3: adding states moves the threshold at which two prefixes collide, but the threshold still exists, so the class of languages accepted is unchanged. In the same way, a pushdown store is already unbounded — the limitation is the access rule, not the capacity. Change the *shape* of the memory and the power really does change: give a machine two independent stores it can use freely, or a first-in-first-out store instead of a last-in-first-out one, and it reaches full tape power. Size is a constant; shape is a class. ## An honest gap at the type 1 rung The machine matched to type 1 is the **nondeterministic** linear-bounded automaton. Whether the deterministic version accepts the same class is a long-standing open question — it has not been settled either way. This is worth knowing for two reasons: it is the one rung of the ladder where the standard pairing carries a caveat, and quoting it accurately signals that you learned the hierarchy rather than a slogan about it. Contrast it with the finite-state rung, where the determinism question was settled long ago and the answer is that it makes no difference to the class. ## Reading the ladder at work When a validator is being designed, this table answers a practical question: what must the checker hold while it runs, and what does that cost on input you do not control? A constant-memory checker can be run at a trust boundary with no resource question at all. A checker with an unbounded nested-context store needs a depth limit, because the input controls how much it allocates. A checker that must re-read the whole input to relate two of its parts has to buffer the whole input, which rules out validating a stream as it arrives. The tier is not an academic label — it is the memory bill.

  • Why does adding states never lift a finite recogniser to the next tier?
    Because "finite" is the whole restriction. However many states you add, the machine can distinguish only finitely many prefixes, so somewhere past that count two prefixes that the language needs treated differently become identical to it. More states move the threshold; they never remove it. Scale changes the constant, not the class.
  • What does the linear-bounded machine's space limit mean in practice?
    Its working store is the input itself, up to a constant factor: it may overwrite and re-read the region the input occupies, but cannot grow past it. That is enough to check constraints that relate distant parts of one input, and not enough to run an unbounded computation alongside the check. Practically, it means the whole input must be buffered.

Think of the four recognisers as four note-taking budgets given to one clerk reading a form: a fixed set of facts held in the head, a spike of slips where only the topmost is readable, a scratch pad no bigger than the form itself, and an endless roll of paper. What each clerk can verify is exactly what their notes can hold.

saying these in an interview costs you the question

  • Says a finite automaton can count to any depth
  • Calls the type 1 recogniser a plain finite machine
  • Thinks a bigger state table makes a machine unbounded
  • Claims the linear-bounded machine has unlimited scratch space
  • Assumes a second unbounded store changes nothing about power