Definition
Turing Machine
A Turing machine consists of seven components:
where:
- is a finite set of states.
- is the input alphabet.
- is the tape alphabet.
- is a transition function.
- (left, right, stay) is the direction in which the head should move.
- is the initial state.
- is the blank symbol.
- are the accepting) states.
A Turing machine halts on the first occasion of a final state . In that case, is undefined.
Turing Machine (Boundary Symbols)
A Turing machine consists of eight components:
where:
- is a finite set of states.
- is the alphabet of the input tape.
- is the alphabet of the working tape.
- is a transition function
- (left, right, stay) is the direction in which the head should move.
- is the initial state.
- is the left boundary symbol on the working tape
- is the left boundary symbol on the input word
- is the right boundary symbol on the input word
- is the blank symbol.
- are the accepting) states.
A Turing machine halts on the first occasion of a final state .
li ```tikz
\begin{document}
\begin{tikzpicture}[x=0.9cm,y=0.9cm,>=stealth,line cap=round,line join=round]
% input tape
\draw[cyan!30!white,thick] (0,4.5) — (9,4.5);
\draw[cyan!30!white,thick] (0,3.6) — (9,3.6);
\foreach \x in {0,1,…,8} {
\draw[cyan!30!white,thick] (\x,3.6) — (\x,4.5);
}
\draw[cyan!30!white,thick] (9,3.6) — (9,4.5);
\node[text=cyan!30!white,font=\bfseries] at (7.7,4.9) {Input tape};
\node[text=cyan!30!white,font=\bfseries] at (0.5,4.05) {};
\node[text=cyan!30!white,font=\bfseries] at (1.5,4.05) {};
\node[text=cyan!30!white,font=\bfseries] at (2.5,4.05) {};
\node[text=cyan!30!white,font=\bfseries] at (7.5,4.05) {};
\node[text=cyan!30!white,font=\bfseries] at (8.5,4.05) {};% finite control
\draw[cyan!30!white,thick,fill=white,fill opacity=0.05] (3.6,1.6) rectangle (4.6,2.5);
\node[text=orange!30!white,font=\bfseries] at (4.1,2.05) {};% arrows between control and tapes
\draw[→,orange!30!white,thick] (0.5,3.6) — (0.5,2.95) — (3.6,2.95) — (3.6,2.5);
\draw[→,orange!30!white,thick] (4.1,1.6) — (4.1,1.0);
\draw[orange!30!white,thick] (4.1,1.0) — (2.2,1.0);
\draw[→,orange!30!white,thick] (2.2,1.0) — (2.2,0.65);
\node[right,text=orange!30!white,font=\bfseries] at (2.35,0.6) {Read / write};% work tape
\draw[cyan!30!white,thick] (0,0.2) — (9,0.2);
\draw[cyan!30!white,thick] (0,-0.7) — (9,-0.7);
\foreach \x in {0,1,…,8} {
\draw[cyan!30!white,thick] (\x,-0.7) — (\x,0.2);
}
\draw[cyan!30!white,thick] (9,-0.7) — (9,0.2);
\node[text=cyan!30!white,font=\bfseries] at (7.8,0.6) {Work tape};
\node[text=cyan!30!white,font=\bfseries] at (0.5,-0.25) {};
\node[text=cyan!30!white,font=\bfseries] at (1.5,-0.25) {};
\node[text=cyan!30!white,font=\bfseries] at (2.5,-0.25) {};
\node[text=cyan!30!white,font=\bfseries] at (8.5,-0.25) {};
\end{tikzpicture}
\end{document}
Tape
Definition
Link to originalTape (Turing Machine)
A tape is an infinite sequence of elements where each element can be blank or a state . Almost all cells are non-blank.
Configuration
Definition
Link to originalConfiguration (Turing Machine)
A configuration is a complete snapshot of a Turing machine at a single moment.
Move to left, i.e.: :
Move to right, i.e.: :
Move stays (no movement), i.e.: :
Language
Accepted Language
Accepted Language (Turing Machine)
The accepted language of a Turing machine are all words for which terminates:
Recursive Enumerable Language
Definition
Link to originalRecursively Enumerable Language
A language is recursively enumerable if there exists a Turing machine such that:
- for every , halts and accepts ,
- for every , either rejects or runs forever.
i.e., there exists a Turing machine that accepts .
Equivalently, there’s a program that enumerates all strings of (possibly with repetition) , every member of appears after finite time.
Recursive Language
Definition
Link to originalRecursive Language
A language is recursive (or decidable) if there exists a total Turing machine such that, for every input , halts and:
- if , accepts ;
- if , rejects .
Equivalently:
- The characteristic function is computable.
- Both and its complement are recursively enumerable.
- There exists a program that, given any string , decides membership in finite time.
Deterministic
Definition
Link to originalDeterministic Turing Machine
A Turing machine is called deterministic, if for all there exists at most one element , i.e.:
with . Denote .
Computation
Computation of an Arithmetic Function
Denote as the binary representation of an . The initial configuration of a Turing machine with alphabet . The input works on input:
where must not contain leading zeros.
The initial configuration of is where (blank symbol) separates each block.
Example Initial Configuration
Let and with binaries . Here, the initial configuration is:
The end configuration of a (function-computing) Turing machine is given by:
with (final state), (tape words), and emits .
Parsing " "
- The head is position at the leftmost bit because (final state) precedes .
- Right after the number there is a blank (a delimiter).
- The machine is in an accepting (final) state , i.e., it has halted.
- Therefore, the output is .
is arbitrary content elsewhere. It doesn’t matter what’s left in or .
Computation of
A Turing machine with input alphabet computes an arithmetic function if works on as input, and outputs . Denote .
Example with input
Let . Let be:
State/Input For instance, let be the input. Thus, the tape contains :
The Turing machine halts at . The output is , see final configuration.
The computed function is , whereby .
Note: The same Turing machine , when the pair is encoded on the tape as , computes , whereby:
Here is the binary length:
Examples
A machine for
The following two-tape Turing machine accepts exactly the language :
where:
The machine marks matching blocks of , , and symbols and accepts when the input is exhausted.