We have seen the limits of regular and context-free languages. Today we will look at a more powerful type of automata, the Turing machine, which can recognize some languages that are not regular or context-free.
Like a PDA, a Turing machine has an unlimited memory. However, it is able to read and write any portion of it, at any time.
The memory is called a "tape". Initially, the tape begins with the input string stored on it. The tape extends infinitely to the right. Tape locations past the input length are initialized with the blank symbol: $\sqcup$
Turing machines are able to do any of the following operations:
The following language is not regular, and also not context-free: $\{w\#w \ |\ w \in \{0, 1\}^\ast\}$.
How would a Turing machine that recognizes this language operate?
Formally, a Turing machine is defined as:
The transition function input is the current state, and tape symbol under the read head. The output is the next state, the symbol to write, and either $L$ or $R$, which indicates that we move the head left or right.
The accept and reject states take effect immediately in a Turing machine.
Below is a diagram of the Turing machine which recognizes $\{w\#w \ |\ w \in \{0, 1\}^\ast\}$:
Like other automata, we say that the collection of strings which a Turing machine $M$ accepts is the language of $M$, denoted as $L(M)$.
A language is Turing-recognizable if some Turing machine recognizes it.
With a DFA, NFA, or PDA, the automata will always stop at some point. This is not true of a Turing machine. With a Turing machine, it's possible to create infinite loops.
With a Turing machine, there are three possible outcomes:
If a Turing machine always halts, no matter the input, it is a decider. The language of a decider is decidable language.
Some languages are Turing-recognizable but not decidable.
Describing a Turing machine in detail, as in the example above, is usually too tedious for complex languages.
Instead, we will describe the behavior of the machine informally. The Turing machine above can be described as follows:
$M_1 = $ "On input string $w$:
These descriptions must be sufficiently detailed that we can envision exactly the steps the Turing machine will take.
Is this Turing machine a decider?
Copyright © 2024 Ian Finlayson | Licensed under a Creative Commons BY-NC-SA 4.0 License.