“Draw a Turing machine for a^n b^n that marks each leftmost unmarked a as X, scans right to mark one matching b as Y, returns left to repeat, then checks that only Y symbols remain before accepting on blank.”
Die dahinterstehenden Entscheidungen verstehen.
qFindA selects one unmarked a at a time.
qFindB changes one corresponding b to Y.
qCheck accepts only after the remaining b block has all been marked.
Use a marking-and-return machine to recognize a non-regular language that requires matching counts.
Häufige Fragen
What language is being recognized?
Strings with the same number of a symbols followed by b symbols, such as ab, aabb and aaabbb.
Why are X and Y needed?
They mark symbols already paired, preventing the machine from counting the same a or b twice.
Why is this not a finite automaton task?
The machine must compare an unbounded number of a and b symbols, which requires more memory than finite states provide.