Automata, Grammars and Languages: Discourse 05
Automata, Grammars and Languages: Discourse 05
Discourse 05
Turing Machines
Fixed # bits b a0 a1 a2 a3 a4 ⊔ ⊔
R/W head
• Model of ``effectively computable procedure” (including all
algorithms)
• Primitive as possible (math. simplicity & constructions)
• Arbitrary definition choice, but standard
• Easy comparison with other models (RAM, etc.)
• Finitely describable (just a formatted string)
• 1 machine = 1 procedure (no stored program -- different
FSA for each TM)
• Computes in discrete steps (moves); each step physically
trivial
• Simple complexity measures (steps=time, cells=space)
C SC 473 Automata, Grammars & Languages 2
The TM Model
0 1 2 3
b
Finite-
state
control
• Control unit: FSA with state set Q
Input: character in cell under R/W head
Output: new state & overstrike character & head moves L or R
Initial state, accept state, reject state:
q0 , qaccept , qreject ∈ Q
• Tape unit
Finite length string of characters with blanks ⊔⊔⊔⊔⋯ to right
⊔ marks R end of input
{⊔}
Fixed alphabet ( ⊔ ); input alphabet Σ ⊆ Γ −
Tape bounded on left & unbounded on right
⊔ ⊔, L
⊔ ⊔, L
qreject qaccept
Note: Below says you can move left from leftmost cell, although you don’t
really move left! This convention makes accept, reject the only halt states.
qbv q ' cv ⇔ δ (q, b) = (q ', c, L )
*
• w* is accepted by M q0 w uqaccept v
*
• Language recognized by M:
L( M ) = {w ∈ Γ* | (∃u , v) q0 w uqaccept v}
*
• TM-recognizable language – a set S such that
(∃ TM M ) S = L( M )
• Configuration I is halting: (¬ ∃C ') C C'
Nowhere to move: from definition, only 2 ways to halt:
A rejecting or accepting configuration: uq
reject v, uqaccept v
“procedure” “algorithm”
Note: ``yes’’ means enters qaccept and halts
``no’’ means enters qreject and halts
B B, R A A, R AA, L
aa, L
q5 bb, L
B B, R
qreject
C C, R cc, L
⊔ ⊔, L
q6 C C, R
All transitions not shown go to qreject
⊔ ⊔, L (See dotted example)
So halts rejecting unless accepting
qaccept state reached
is a computation of length (time) t
• Computation I 0 I1 I2 K is in a tight loop iff
+
∃k I 0 Ik & Ik Ik
*
(a config. repeats)
q0 w = C0 Ca = uqaccept v
*
(1) How does a TM accept w?
(2) How does a TM reject w?
q0 w = C0 C1 C2 K
in a tight loop
*
•
Regular A
∃ Finite Automaton rec. A
D
∃ Turing-recognizer for D
ATM
ATM Halting Problem
¬ ∃ recognizer for E !!
E
i Γ′ = (Γ ∪ Γˆ ) k
Tape alphabet is head sweeps L to R until
B
store k scanned chars. In
a b c d e f B ... states. Sweep R to L & mark B
Mk 0 1 2 3 … changes. Sweep L to R then R to L to move
head marks. End cycle scanning cell 0.
A B C D E F G ...
0 1 2 3 …
δ : (Q −{qa , qr }) ×Γk → Q ×Γk ×{L , R }k a b ĉ d e f B . . .
M1 A B C D E F̂ G . . .
δ : Q′×Γ′ → Q′×Γ′×{L , R }
w ∈ L( M ) ⇔ ∃ sequence of configurations
q0 w = I0 I1 I2 K I t = α qaccept γ
L L I 2b1 I 2b 2 L I 2bb L
Choice sequence
2b1 → I0 I2 I 2b I 2b1
[ 0 ] [ 1 ] ... [ 0 ] B B B ...
worktape of M state of M
Intuitive concept
of algorithm
= Turing-machine
algorithm
Intuitive concept
of algorithm = RAM
algorithm
Intuitive concept
of algorithm
= Markov
algorithm
M
All methods also agree on what is a “decidable set” and
what is a “recognizable set”
C SC 473 Automata, Grammars & Languages 31
``Effectively Computable’’ (cont’d)
Both decision problems (Hilberts 10th, 1st Order Predicate
Calculus) eventually shown to be undecidable
In our terminology, a decision problem is translated into a
language. The problem is decidable iff the language has a
Turing decider.
None of the following languages have a decider; they are
undecidable languages.
A10 th = { p | p is a multi-variable polynomial such
that p = 0 has an integer solution }
APC = {e| e is a true formula (theorem) of
the 1st order predicate calculus }
A TM = { M , w | M is a TM and w ∈ L( M ) }
This last is called the Halting or Membership Problem.
C SC 473 Automata, Grammars & Languages 32