Turing Machines


12th lecture, July 5, 2019

Language Theory and Compilers


Martin J. Dürst


© 2005-19 Martin J. Dürst 青山学院大学

Today's Schedule


Summary of Previous Lecture


Example Solution for bison Homework

(paper only)


Remaining Schedule


Final Exam


Formal Language Hierarchy

(Chomsky hierarchy)

Grammar Type Language (family) Automaton
phrase structure grammar (psg) 0 phrase structure language Turing machine
context-sensitive grammar (csg) 1 context-sensitive language linear bounded automaton
context-free grammar (cfg) 2 context-free language pushdown automaton
regular grammar (rg) 3 regular language finite state automaton


Historic Background


Automata Commonalities


Automata Differences


How a Turing Machine Works


Turing Machine Example: State Transition Table

Current state Current tape symbol New tape symbol Movement direction Shortcut Next state
→1 0 1 R 0/1;R 2
→1 1 0 L 1/0;L 1
→1 _ 1 R _/1;R 2
2 0 0 R 0/0;R 2
2 1 1 R 1/1;R 2
2 _ _ L _/_;L 3*


Explanations for Example


Turing Machine Definition



Using Turing Machines for Input Recognition


Techniques and Tricks for Programming



It can be shown that all these extensions (and many more) can be simulated on a plain Turing machine.


Universal Turing Machine


Wolfram's 2,3 Turing Machine

Current state Current tape symbol New tape symbol Movement direction Shortcut Next state
→1 a b L a/b;L 1
→1 b a L b/a;L 1
→1 _ b R _/b;R 2
2 b a R b/a;R 2
2 a _ R a/_;R 1
2 _ a L _/a;L 1

See proof of universality and other details


Computability is Everywhere

It turns out that there are many other mechanisms that can simulate an (universal) Turing machine:

All these mechanisms can simulate each other, and have the same power.

All these mechanisms are very simple, but simulation is very slow.


Church-Turing Thesis

It is unclear whether this applies to Physics in general.


Turing Completeness


Other Contributions





Deadline: July 11, 2019 (Thursday), 19:00

Where to submit: Box in front of room O-529 (building O, 5th floor)

Format: A4 single page (using both sides is okay; NO cover page, staple in top left corner if more than one page is necessary), easily readable handwriting (NO printouts), name (kanji and kana) and student number at the top right

For the Turing machine given by the following state transition table (this Turing machine always starts on the rightmost non-blank symbol):

Current state Current tape symbol New tape symbol Movement direction Next state
→1 0 1 L 1
→1 1 0 R 2
→1 _ _ L 3*
2 0 0 R 2
2 1 1 R 2
2 _ _ L 3*
  1. Draw the state transition diagram for this machine
  2. Show in detail how this machine processes the input ..._1101000_...
  3. Explain what kind of calculation this machine does if the tape contains only a single contiguous sequence of '0'es and '1'es (surrounded by blanks), and the leftmost non-blank symbol is a '1'



rote learning
universal turing machine
lambda calculus
partial recursive function
unary numbers
一進法 (1, 11, 111, 1111,...)
Turing complete(ness)
チューリング完全 (性)
computable number
halting problem