Linear Bounded Automata (LBA): Definition, Tape Restriction, and an LBA for
A Linear Bounded Automaton (LBA) is a Turing-machine model whose computation is memory-bounded: on an input string of length , the automaton is allowed to use only a tape segment of size at most linear in . 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 tape cells. Formally, if the input length is , there exists a constant such that the machine may not visit tape cells outside a segment of length (equivalently, it cannot require more than 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
-
(Tooling unavailable) ↩
Linear Bounded Automata (LBA) and Context-Sensitive Languages (Overview)
Tape length restriction: what “linear bounded” means
Let the input be with . 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 , the machine is constrained to operate only within some tape interval whose size is for a constant 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 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 cells vs. cells). For LBA constructions, the usual assumption is: the head never needs more than a linear number of tape cells in terms of .
Target language
We design an LBA for:
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 tape cells.
Key idea:
- Repeatedly pick the leftmost unmarked and mark it (e.g., change it to ).
- Then find the leftmost unmarked and mark it (change to ).
- Then find the leftmost unmarked and mark it (change to ).
- If at any stage the required symbol is missing, reject.
- Accept when all , , and 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\}$
- 1Step 1
Scan from the left end. Verify all symbols are until the first region, then only ’s, then only ’s, and finally no other symbols. If the pattern is violated, reject.
- 2Step 2
Starting at the left end, find the first that is not marked (i.e., still an rather than ). If none exists, proceed to the final verification step.
- 3Step 3
Replace the selected by a marked symbol , then move right to search for the leftmost unmarked .
- 4Step 4
Scan rightward until you find a that has not been marked (still ). If no such exists, reject. Otherwise, replace it with .
- 5Step 5
Continue scanning rightward until you find an unmarked (still ). If no such exists, reject. Otherwise, replace it with .
- 6Step 6
Return (by moving left) to the start of the tape (or at least to the beginning of the region) and repeat the marking cycle.
- 7Step 7
When no unmarked remains, verify that there are no unmarked or left. If every and is marked, accept; otherwise reject.
Why this LBA decides
Correctness (sketch):
-
If the input is of the form :
- Each iteration consumes exactly one , one , and one by marking them.
- After iterations, all , , and are marked.
- The final verification passes, so the LBA accepts.
-
If the input is not in :
- If there are more ’s than ’s or more ’s than ’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., before finishing all ), the initial structural scan rejects.
- If there are extra symbols after a region (e.g., leftover ’s after ’s begin), the structural scan or final verification rejects.
So the machine accepts exactly the strings with equal counts of , , and 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., , , ). 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 space
Let . 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 (),
- 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 bounds the number of input cells, and we only use at most those cells for marking and scanning, the space used is:
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
Knowledge Check
In an LBA, how is tape usage restricted relative to the input length ?
Explore Related Topics
Convert an NFA to a DFA (Subset Construction) and Describe the Accepted Language
CYK Membership Test for the String “baaba”
Which Automaton Accepts Regular Languages? The Correct Answer Is DFA
The deterministic finite automaton (DFA) is the canonical model that exactly accepts regular languages, whereas PDA, LBA, and Turing machines recognize strictly larger language families.
- A language is regular iff some DFA accepts it: .
- DFA ↔ regular languages; PDA ↔ context‑free; LBA ↔ context‑sensitive; Turing machine ↔ recursively enumerable.
- Regular languages form the base of the hierarchy: .
- DFA’s finite memory limits it to patterns like “ends with 01” or “even number of 1’s”, but it cannot handle unbounded counting such as .