We can add the following facilities to a Turing machines:
Multiple tapes.
Multiple heads.
Two-way tape.
Random access memory.
Two-dimensional memory.
A stack, multiple Turing machines in a Turing machine.
These extensions may increase the efficiency of Turing machine, However, none of these facilities will increase the power of Turning mahcines.
Church-Turing Thesis
Turing machines are the ultimate computational devices. Turing machines = algorithms. Never be proved or denied.
Any Turing machine solvable problems can be solved by using modern computers. Any Tuting machine sovlable problems can be solved by using algorithms. If a problem is unsolvable by using Turing machine, it's unsolvable for modern computer either. Therefore, no algorithm for solving such problem.
Design Turing Machine
Define a Turing machine by using the mathematical model is inconvenient. Understanding a Turing machine via its formal definition is not easy. Design Turing machine by using machine schema.
Turing Equivalence
A computational device which can simulate Turing machine is called Turing Equivalence or Turing Complete.
Machine Schema
For finite automata, transition diagrams are easier to understand than formal models of finite automata, We can use a similar methodology to design Turing machine.
Represent Turing machine operations as basic instructions.
Code more instructions using these basic instructions.
Create complex instructions by using the available instructions.
Program advanced Turing machine by using this instructions set.
Draw flowcharts to represent Turing machine.
Design Turing machine by using the following method:
Represent instructions by using symbols.
Create subroutines to form complex instructions.
Draw Turing machine by using flowcharts (Directed Graphs)
Vertices: symbols of instructions and subroutines.
Arcs: conditional / unconditional branches or loops.
Basic Machines
Use simple Turing machine as basic instruction, for example:
Writing an a in the tape represented by the symbol 'a'.
Moving right, represented by 'R'.
Moving left, represented by 'L'.
R a R: Means move right, write an 'a' and move right.
Conditional branches: if encounter an a move right:
Unconditional branches: just jump to there, and move right:
until encountering a certain symbol: : move left until encountering a '#'. : move right until encounter a non-'#' symbol
Example
Copy machine: copy the string in the input tape and stop at the '#' between the two strings.
Multiple Tape
We can use multiple tapes to keep the input, intermediate results, or results. Multiple tapes simplify Turing machine design. Use superscripts to indicate tape indices.
// Move right in tape 1, write an 'a' in tape 2.
// Move left in tape 1 and 2, write a '#' in tape 1 and 2.
Functions
如果有一個 Function 可以被 Turing machine 計算,就稱之為 Recursive Functions。
Turing machines can be used to compute functions. However, not all functions are computable by Turing machines!
A k-ary function takes k arguments and produce one result.
Basic Functions
Some functions are so basic that we can design Turing machine computing them directly.
Complicated Functions
More complicated functions can be defined by using functional operators.
These functional operators are Turing machine computable!
Functional operators:
function composition
recursive definition
definition by cases
minimalization
Primitive Recursive Functions
Definition: The primitive recursive function class includes:
Basic functions
Functions defined by using function composition
Functions defined by using recursive definition
Primitive Recursive Predicates
A function can be not only numerical but also logical. Definition: a primitive recursive function which return 1 or 0 is a primitive recursive predicate.
Partial Recursive Functions
Definition: The partial recursive functions class includes:
Basic functions
Functions defined by using function composition
Functions defined by using recursive definition
Functions defined by using minimalization
Unrestricted Grammar
Definition
is an alphabet. (Variables + Terminals)
is a subset of , the set of terminals
is the set of grammar rules:
is a start variable.
Unrestricted and Context Free Grammars
Their definitions are very similar. However, only one non-terminal appears at the left hand sides of Context Free Grammar rules:
Derivation String
To derive a string:
Strarting with the initial symbol, a non-terminal.
Applying a grammar rule to replace a substring of the current string with another sub-string in each step.
Grammar and CFG
Every Context-Free Grammar is a simplified grammar.
A grammar is not necessarily a Context-Free Grammar.
So Grammar > Context-Free Grammar
Grammar and Turing Machines
Theorem: Unrestricted grammars are equivalent to Turing machines.
Grammer: language generators
Turing Machine: language recognizers.
Recursively Enumerable Languages
Theorem: The languages generated by unrestricted grammars are recursively enumerable languages.
is generated by a grammar if and only if is semi-decidable by a Turing machine.