Turing Machines: I Part II: computability We would like to study problems that can and cannot be solved by computers We need a more powerful model Finite automata: small memory (states) PDA: unlimited memory (stack) by push/pop Turing machine: unlimited and unrestricted memory This is about everything a real computer can do Thus problems not solved by Turing machines ⇒ beyond the limit of computation November 17, 2020 1 / 8
Turing Machines: II A TM has a tape as the memory CPU tape 0 1 1 0 · · · Differences from finite automata write/read tape head moves left/right infinite space in the tape rejecting/accepting take immediate effect machine goes on forever, otherwise November 17, 2020 2 / 8
Turing Machines: III Example B = { w # w | w ∈ { 0 , 1 } ∗ } This language is known to be not a CFL (example 2.22; details not discussed) Running a sample input. Figure 3.2 ⊔ : blank symbol We assume infinite ⊔ ’s after the input sequence Strategy: zig-zag to the corresponding places on the two sides of the # and determine whether they match. November 17, 2020 3 / 8
Turing Machines: IV 0 1 1 0 0 0 # 0 1 1 0 0 0 ⊔ x 1 1 0 0 0 # 0 1 1 0 0 0 ⊔ x 1 1 0 0 0 # x 1 1 0 0 0 ⊔ Algorithm: scan to check # 1 check w and w 2 November 17, 2020 4 / 8
Formal definition of TM I It’s complicated and seldom used δ : Q × Γ → Q × Γ × { L , R } Example: δ ( q , a ) = ( r , b , L ) q : current state a : pointed in tape r : next state b : replace a with b L : head then moved to the left November 17, 2020 5 / 8
Formal definition of TM II ( Q , Σ , Γ , δ, q 0 , q accept , q reject ) Q : states Σ: input alphabet (blank: ⊔ / ∈ Σ) Γ: tape alphabet, ⊔ ∈ Γ , Σ ⊂ Γ δ : Q × Γ → Q × Γ × { L , R } q 0 ∈ Q , start q accept ∈ Q q reject ∈ Q , q reject � = q accept Single q accept , q reject November 17, 2020 6 / 8
Formal definition of TM III The input w 1 · · · w n is put in positions 1 . . . , n of the tape in the beginning Assume ⊔ in all the rest of the tape If head points to first position and δ ( q , ?) = ( r , ? , L ) then the head stays at the same position November 17, 2020 7 / 8
Formal definition of TM IV CPU tape 0 1 1 0 · · · November 17, 2020 8 / 8
Recommend
More recommend