BU CS 332 – Theory of Computation
Lecture 10:
- Turing Machines
- TM Variants
Reading: Sipser Ch 3.1‐3.2
Mark Bun February 26, 2020
BU CS 332 Theory of Computation Lecture 10: Reading: Turing - - PowerPoint PPT Presentation
BU CS 332 Theory of Computation Lecture 10: Reading: Turing Machines Sipser Ch 3.1 3.2 TM Variants Mark Bun February 26, 2020 Turing Machines Motivation So far in this class weve seen several limited models of computation
Reading: Sipser Ch 3.1‐3.2
Mark Bun February 26, 2020
So far in this class we’ve seen several limited models of computation Finite Automata / Regular Expressions
parity, addition
Pushdown Automata / Context‐Free Grammars
2/26/2020 CS332 ‐ Theory of Computation 2
Goal: Define a model of computation that is 1) General purpose. Captures all algorithms that can be implemented in any programming language. 2) Mathematically simple. We can hope to prove that things are not computable in this model.
2/26/2020 CS332 ‐ Theory of Computation 3
2/26/2020 CS332 ‐ Theory of Computation 4
2/26/2020 CS332 ‐ Theory of Computation 5
David Hilbert 1862‐1943
Given a Diophantine equation with any number of unknown quantities and with rational integral numerical coefficients: To devise a process according to which it can be determined in a finite number of
solvable in rational integers.
2/26/2020 CS332 ‐ Theory of Computation 6
David Hilbert 1862‐1943
The “Decision Problem” Is there an algorithm which takes as input a formula (in first‐order logic) and decides whether it’s logically valid?
Wilhelm Ackermann 1896‐1962
2/26/2020 CS332 ‐ Theory of Computation 7
Alonzo Church 1903‐1995 Alan Turing 1912‐1954
"An unsolvable problem of elementary number theory“ Model of computation: 𝜇‐calculus (CS 320) “On computable numbers, with an application to the Entscheidungsproblem” Model of computation: Turing Machine
2/26/2020 CS332 ‐ Theory of Computation 8
2/26/2020 CS332 ‐ Theory of Computation 9
Tape 𝑏 𝑐 𝑏 𝑏 Finite control …
Input
0 → 0, 𝑆 ⊔ → ⊔, 𝑆
accept reject
0 → 0, 𝑆 ⊔ → ⊔, 𝑆
𝑟0 𝑟1
0 → 0, 𝑆 ⊔ → ⊔, 𝑆
accept reject
0 → 0, 𝑆 ⊔ → ⊔, 𝑆 0 → 0, 𝑆 ⊔ → ⊔, 𝑀 𝑟0 𝑟1 𝑟3
2/26/2020 CS332 ‐ Theory of Computation 12
High‐Level Description An algorithm (like CS 330) Implementation‐Level Description Describe (in English) the instructions for a TM
Low‐Level Description State diagram or formal specification
2/26/2020 CS332 ‐ Theory of Computation 13
Decide if
Repeat the following:
, reject
2/26/2020 CS332 ‐ Theory of Computation 14
Decide if
a) Cross off every other 0 b) If there is exactly one 0 when we reach the right end of the tape, accept c) If there is an odd number of 0s when we reach the right end of the tape, reject
2/26/2020 CS332 ‐ Theory of Computation 15
Decide if
2/26/2020 CS332 ‐ Theory of Computation 16
A TM is a 7‐tuple
and )
)
2/26/2020 CS332 ‐ Theory of Computation 17
means “move left” and means “move right” means:
means:
which case don’t move
2/26/2020 CS332 ‐ Theory of Computation 18
A string with captures the state of a TM together with the contents of the tape
2/26/2020 CS332 ‐ Theory of Computation 19
A configuration is a string where and
∗
(followed by blanks )
2/26/2020 CS332 ‐ Theory of Computation 20
Start configuration: One step of computation:
if
if
if Accepting configuration: = Rejecting configuration: =
2/26/2020 CS332 ‐ Theory of Computation 21