Linear Bounded Automata (LBA): Definition, Tape Restriction, and an LBA for anbncn\\{a^n b^n c^n\\}

Linear Bounded Automata (LBA): Definition, Tape Restriction, and an LBA for anbncn\\{a^n b^n c^n\\}

Verified Sources
Sep 13, 2026

A Linear Bounded Automaton (LBA) is a Turing-machine model whose computation is memory-bounded: on an input string ww of length nn, the automaton is allowed to use only a tape segment of size at most linear in nn. This “linear boundedness” is what makes LBAs capture exactly the class of context-sensitive languages.

Intuitively, the LBA can still move the head and rewrite symbols, but it cannot use more than O(n)O(n) tape cells. Formally, if the input length is nn, there exists a constant kk such that the machine may not visit tape cells outside a segment of length knk n (equivalently, it cannot require more than knk n working tape space). This restriction is the key difference between an LBA and an unrestricted Turing machine, and it is what prevents “too much workspace” for the machine to decide arbitrary languages.

Context-sensitive languages (CSL) and LBAs are tightly connected: LBAs recognize precisely the CSL class. This connection is standard in automata theory texts and is commonly presented via the equivalence between LBAs and context-sensitive grammars (details depend on the specific variant of the formal model).

Footnotes

  1. (Tooling unavailable)

Linear Bounded Automata (LBA) and Context-Sensitive Languages (Overview)

Tape length restriction: what “linear bounded” means

Let the input be ww with w=n|w|=n. An LBA is a Turing-machine-like device where there is a fixed linear bound on how far the head can go from the input region. A typical formal statement is:

  • the tape is conceptually infinite, but
  • for every input of length nn, the machine is constrained to operate only within some tape interval whose size is kn\le k n for a constant kk independent of the input.

So the machine cannot “grow” its used tape capacity beyond a linear function of input size. This restriction is exactly what yields the recognition power of context-sensitive languages rather than the full power of general Turing machines.

Working tape in an LBA is therefore limited to O(n)O(n) cells. If the machine tried to access a cell outside that bounded region, its computation would be deemed invalid (or it would halt/reject depending on the formal convention used).

Important modeling convention

Different textbooks specify LBA tape bounds slightly differently (e.g., exactly nn cells vs. knk n cells). For LBA constructions, the usual assumption is: the head never needs more than a linear number of tape cells in terms of w|w|.

Target language

We design an LBA for:

L={anbncnn1}.L=\{a^n b^n c^n \mid n\ge 1\}.

This language is context-sensitive (and thus recognizable by an LBA), but it is not context-free. The LBA construction will follow the standard “match counts using marked symbols” idea, while ensuring the machine never uses more than O(n)O(n) tape cells.

Key idea:

  1. Repeatedly pick the leftmost unmarked aa and mark it (e.g., change it to XX).
  2. Then find the leftmost unmarked bb and mark it (change to YY).
  3. Then find the leftmost unmarked cc and mark it (change to ZZ).
  4. If at any stage the required symbol is missing, reject.
  5. Accept when all aa, bb, and cc symbols have been marked and no extra symbols remain.

Because each marking pass never needs additional tape beyond what the input already uses (we only overwrite symbols in-place), the tape usage remains linear in the input length.

We will describe an explicit LBA strategy below.

Design an LBA for $\{a^n b^n c^n\}$

  1. 1
    Step 1

    Scan from the left end. Verify all symbols are aa until the first bb region, then only bb’s, then only cc’s, and finally no other symbols. If the pattern is violated, reject.

  2. 2
    Step 2

    Starting at the left end, find the first aa that is not marked (i.e., still an aa rather than XX). If none exists, proceed to the final verification step.

  3. 3
    Step 3

    Replace the selected aa by a marked symbol XX, then move right to search for the leftmost unmarked bb.

  4. 4
    Step 4

    Scan rightward until you find a bb that has not been marked (still bb). If no such bb exists, reject. Otherwise, replace it with YY.

  5. 5
    Step 5

    Continue scanning rightward until you find an unmarked cc (still cc). If no such cc exists, reject. Otherwise, replace it with ZZ.

  6. 6
    Step 6

    Return (by moving left) to the start of the tape (or at least to the beginning of the aa region) and repeat the marking cycle.

  7. 7
    Step 7

    When no unmarked aa remains, verify that there are no unmarked bb or cc left. If every bb and cc is marked, accept; otherwise reject.

Why this LBA decides LL

Correctness (sketch):

  • If the input is of the form anbncna^n b^n c^n:

    • Each iteration consumes exactly one aa, one bb, and one cc by marking them.
    • After nn iterations, all aa, bb, and cc are marked.
    • The final verification passes, so the LBA accepts.
  • If the input is not in LL:

    • If there are more aa’s than bb’s or more bb’s than cc’s, then at some iteration one of the required “next unmarked symbol” types will not exist, and the LBA rejects.
    • If the input has symbols out of order (e.g., bb before finishing all aa), the initial structural scan rejects.
    • If there are extra symbols after a region (e.g., leftover aa’s after bb’s begin), the structural scan or final verification rejects.

So the machine accepts exactly the strings with equal counts of aa, bb, and cc and in that specific order.

In-place marking keeps tape usage linear

Marking can be done by overwriting symbols on the existing tape cells (e.g., aXa\to X, bYb\to Y, cZc\to Z). No extra counters are stored on new cells, so the used tape never needs to exceed the input’s tape footprint up to a constant factor.

Tape-length restriction: how we ensure O(n)O(n) space

Let n=wn=|w|. The construction above:

  • performs scans left-to-right and right-to-left over the tape region containing the input,
  • overwrites each symbol in-place with one of a finite set of marked variants (X,Y,ZX,Y,Z),
  • never introduces new unbounded work storage like writing long counters on fresh blank cells.

Therefore, the machine’s active region never needs to extend beyond a constant-factor multiple of the original input segment. Since nn bounds the number of input cells, and we only use at most those cells for marking and scanning, the space used is:

space used=O(n).\text{space used} = O(n).

Hence the machine is an LBA by definition.

Visualizing the marking cycle

Space usage intuition for the LBA construction

The LBA overwrites symbols in place and only scans; it does not allocate unbounded extra tape.

Common edge questions

LBA & Construction Key Terms

1 / 4
Question · Term

[Linear Bounded Automaton (LBA)]

Click to reveal
Answer · Definition

A TM restricted to using at most O(n)O(n) tape cells on inputs of length nn; recognizes exactly context-sensitive languages (CSL).

Knowledge Check

Question 1 of 4
Q1Single choice

In an LBA, how is tape usage restricted relative to the input length n=wn=|w|?