Introduction To The Theory of Computation: Part II: Computability Theory
Introduction To The Theory of Computation: Part II: Computability Theory
of Computation
Informal description:
input written on left-most squares of tape
rest of squares are blank
at each point, take a step determined by
current symbol being read
current state of finite control
a step consists of
writing new symbol
moving read/write head left or right
changing state
Turing Machine Diagrams
a → b,L
a→R
start state states
b→L (1 accept
_→R
qreject qaccept + 1 reject)
b → a,R
#→R
1 → x, R 1 → x, L
1 → _,R
q2 q4 q6 q8 q10
#→R _→L _→R #→R
0,1 → R 0,1 → R 0,1,# → L 0,1 → R x→R
TM Formal Definition
A TM is a 7-tuple
(Q, Σ, , δ, q0, qaccept, qreject) where:
Q is a finite set called the states
Σ is a finite set called the input alphabet
is a finite set called the tape alphabet, Σ{‘_’}
δ: Q x → Q x x {L, R} is a function called the
transition function
q0 is an element of Q called the start state
qaccept, qreject are the accept and reject states
Example TM Operation
program
for “binary
# 0 1 start successor”
# 0 1 start q σ δ(q,σ)
# 0 1 start start 0 (start, 0, R)
start 1 (start, 1, R)
# 0 1 start start _ (t, _, L)
# 0 1 start # (start, #, R)
t
t 0 (accept, 1, -)
# 0 0 t t 1 (t, 0, L)
t # (accept, #, R)
# 1 0 accept
TM Configurations
TM M:
L(M) is the language it recognizes
if M rejects every x L(M) it decides L
set of languages recognized by some TM is called
Turing-recognizable or recursively enumerable (RE)
set of languages decided by some TM is called
Turing-decidable or decidable or recursive
Classes of Languages
decidable
all languages
regular
languages
context free
languages RE
0 1 1 0 0 1 …
0 1 1 0 0 1 1 1 0 1 0 0 …
k-1 “work
…
tapes”
0 …
Multitape TMs
A TM is a 7-tuple
(Q, Σ, , δ, q0, qaccept, qreject) where:
everything is the same as a TM except the transition
function:
δ: Q x k → Q x k x {L, R}k
Proof:
Idea: simulate k-tape TM on a 1-tape TM.
Multitape TMs
# a b a b # a a # b b c d # ...
Multitape TMs
a b a b . . . Repeat:
• scan tape, remembering the symbols
a a ... under each virtual head in the state
(how many new states needed?)
# a b a b # a a # b b c d # ...
Nondeterministic TMs
Proof:
Idea: simulate NTM with a deterministic TM
Nondeterministic TMs
Simulating NTM M with a deterministic TM:
Cstart
• computations of M are a tree
• nodes are configurations
• fanout is b = maximum
number of choices in transition
rej acc function
• leaves are accept/reject
configurations.
Nondeterministic TMs
Proof:
() Let E be the enumerator. On input w:
Simulate E. Compare each string it outputs with w.
If w matches a string output by E, accept.
Recursive Enumerability