Lecture 6
Lecture 6
Adnane Saoud
1
Summary of lectures 1-5
Lectures 1-5
§ Automata and regular languages
§ Context free grammars and Pushdown automatas
Lecture 6
§ Turing machines
§ Recognizers and deciders
§ Equivalence of variants of the Turing machine model
§ Church-Turing Thesis
2
Turing machines
3
Turing Machines (TMs)
head
a b a b b ˽ ˽ ...
Finite
control read/write input tape
4
TM – example
TM recognizing 𝐵 = a! b! c! 𝑘 ≥ 0
1) Scan right until ˽ while checking if input is in a∗b∗c∗, reject if not.
2) Return head to left end.
3) Scan right, crossing off single a, b, and c.
4) If the last one of each symbol, accept.
5) If the last one of some symbol but not others, reject.
6) If all symbols remain, return to left end and repeat from (3).
head
input tape
Finite a a a b b b c c c ˽ ˽
control
accept
5
TM – example
Exercise:
How do we get the effect of “crossing off” with a Turing machine?
a) We add that feature to the model.
b) We use a tape alphabet Γ = {a, b, c, a, b, c, ˽ }.
c) All Turing machines come with an eraser.
6
TM – Formal Definition
7
TM – Example
TM recognizing
1. Zig-zag across the tape to corresponding positions on either side of the #
symbol to check whether these positions contain the same symbol. If they do
not, or if no # is found, reject. Cross off symbols as they are checked to keep
track of which symbols correspond.
2. When all symbols to the left of the # have been crossed off, check for any
remaining symbols to the right of the #. If any symbols remain, reject; otherwise,
accept.
8
TM – Example
9
TM Recognizers and Deciders
11
Multi-tape Turing machines
input tape
Finite
control
} work tapes, initially blank
...
all tapes read/write
12
Multi-tape Turing machines
a a b b a ˽ ˽ ...
multi-tape 𝑀 1 0 1 ˽ ...
...
c c c a ˽ ...
single tape 𝑆 a a b b a # 1 0 1 # … # c c c a ˽ ˽
13
Nondeterministic Turing machines
accept
14
Church-Turing Thesis
15
Church-Turing Thesis ~1936
Algorithm
Intuitive
Algorithm = Turing
machine
Intuitive Formal
17
Hilbert’s 10th Problem
In 1900 David Hilbert posed 23 problems
#10) Give an algorithm for solving Diophantine equations.
Diophantine equations:
Equations of polynomials where solutions must be integers.
Example: 3𝑥 " − 2𝑥𝑦 − 𝑦 " 𝑧 = 7 solution: 𝑥 = 1, 𝑦 = 2, 𝑧 = −2
Note: 𝐷 is T-recognizable.
18
Hilbert’s 10th Problem
Exercise:
Consider the set
If p has an integral root, M1 eventually will find it and accept. If p does not have an
integral root, M1 will run forever. For the multivariable case, we can present a similar
TM M that recognizes D. Here, M goes through all possible settings of its variables to
integral values.
19
Summary
20
Summary
1. Turing machines
2. Recognizers and deciders
3. Equivalence of variants of the Turing machine model
4. Church-Turing Thesis
21