bu cs 332 theory of computation
play

BU CS 332 Theory of Computation Lecture 11: Reading: TM Variants - PowerPoint PPT Presentation

BU CS 332 Theory of Computation Lecture 11: Reading: TM Variants Sipser Ch 3.2 Closure Properties Mark Bun March 1, 2020 The Basic Turing Machine (TM) Input Tape Finite control Input is written on an


  1. BU CS 332 – Theory of Computation Lecture 11: Reading: • TM Variants Sipser Ch 3.2 • Closure Properties Mark Bun March 1, 2020

  2. The Basic Turing Machine (TM) Input 𝑏 𝑐 𝑏 𝑏 Tape … Finite control • Input is written on an infinitely long tape • Head can both read and write, and move in both directions • Computation halts when control reaches “accept” or “reject” state 3/3/2020 CS332 ‐ Theory of Computation 2

  3. Example ⊔ → ⊔ , 𝑆 0 → 0, 𝑆 𝑟 0 𝑟 1 accept 0 → 0, 𝑆 ⊔ → ⊔ , 𝑆 reject

  4. Formal Definition of a TM A TM is a 7 ‐ tuple � ������ ������ • is a finite set of states • is the input alphabet (does not include ) • is the tape alphabet (contains and ) • is the transition function …more on this later • is the start state � • is the accept state ������ • is the reject state ( ������ ������ ) ������ 3/3/2020 CS332 ‐ Theory of Computation 4

  5. TM Transition Function means “move left” and means “move right” means: • Replace 𝑏 with 𝑐 in current cell • Transition from state 𝑞 to state 𝑟 • Move tape head right means: • Replace 𝑏 with 𝑐 in current cell • Transition from state 𝑞 to state 𝑟 • Move tape head left UNLESS we are at left end of tape, in which case don’t move 3/3/2020 CS332 ‐ Theory of Computation 5

  6. Configuration of a TM A string with captures the state of a TM together with the contents of the tape … � 3/3/2020 CS332 ‐ Theory of Computation 6

  7. Configuration of a TM: Formally ∗ A configuration is a string where and • Tape contents = (followed by blanks ) • Current state = • Tape head on first symbol of … � 3/3/2020 CS332 ‐ Theory of Computation 7

  8. How a TM Computes Start configuration: � One step of computation: • yields if • yields if • yields if Accepting configuration: = ������ Rejecting configuration: = ������ 3/3/2020 CS332 ‐ Theory of Computation 8

  9. How a TM Computes accepts input if there is a sequence of configurations � such that: � • � = � • � yields ��� for every • � is an accepting configuration the set of all strings which accepts is Turing ‐ recognizable if for some TM : • halts on in state ������ • halts on in state ������ OR runs forever 3/3/2020 CS332 ‐ Theory of Computation 9

  10. Recognizers vs. Deciders the set of all strings which accepts is Turing ‐ recognizable if for some TM : • halts on in state ������ • halts on in state ������ OR runs forever is (Turing ‐ )decidable if for some TM which halts on every input • halts on in state ������ • halts on in state ������ 3/3/2020 CS332 ‐ Theory of Computation 10

  11. Back to Hilbert’s Tenth Problem Computational Problem: Given a Diophantine equation, does it have a solution over the integers? • is Turing ‐ recognizable • is not decidable (1949 ‐ 70) 3/3/2020 CS332 ‐ Theory of Computation 11

  12. TM Variants 3/3/2020 CS332 ‐ Theory of Computation 12

  13. How Robust is the TM Model? Does changing the model result in different languages being recognizable / decidable? So far we’ve seen… ‐ We can require that FAs/PDAs have a single accept state ‐ (CFGs can always be put in Chomsky Normal Form) ‐ Adding nondeterminism does not change the languages recognized by finite automata Turing machines have an astonishing level of robustness 3/3/2020 CS332 ‐ Theory of Computation 13

  14. Extensions that do not increase the power of the TM model • TMs that are allowed to “stay put” instead of moving left or right Proof that TMs with “stay put” are no more powerful: Simulation: Convert any TM with “stay put” into an equivalent TM without Replace every “stay put” instruction in with a move right instruction, followed by a move left instruction in ’ 3/3/2020 CS332 ‐ Theory of Computation 14

  15. Extensions that do not increase the power of the TM model • TMs with a 2 ‐ way infinite tape, unbounded left to right Input 𝑏 𝑐 𝑏 Tape … … Proof that TMs with 2 ‐ way infinite tapes are no more powerful: Simulation: Convert any TM with 2 ‐ way infinite tape into a 1 ‐ way infinite TM with a “two ‐ track tape” 3/3/2020 CS332 ‐ Theory of Computation 15

  16. Formalizing the Simulation � � � � � � � � ������ ������ New tape alphabet: � � New state set: means “ , working on upper track” means “ , working on lower track” New transitions: If 𝜀 𝑞 , 𝑏 � � �𝑟 , 𝑐 , 𝑀� , let 𝜀′ 𝑞 , � , 𝑏 � , 𝑏 � � � 𝑟 , � , 𝑐 , 𝑏 � , 𝑆� Also need new transitions for moving right, lower track, hitting $ , initializing input into 2 ‐ track format 3/3/2020 CS332 ‐ Theory of Computation 16

  17. TMs are equivalent to… • TMs with “stay put” • TMs with 2 ‐ way infinite tapes • Multi ‐ tape TMs • Nondeterministic TMs • Random access TMs • Enumerators • Finite automata with access to an unbounded queue = 2 ‐ stack PDAs • Primitive recursive functions • Cellular automata … 3/3/2020 CS332 ‐ Theory of Computation 17

  18. Church ‐ Turing Thesis The equivalence of these models is a mathematical theorem Church ‐ Turing Thesis : Each of these models captures our intuitive notion of algorithms The Church ‐ Turing Thesis is not a mathematical statement! 3/3/2020 CS332 ‐ Theory of Computation 18

  19. Multi ‐ Tape TMs 𝑐 𝑐 𝑏 𝑏 𝑏 Finite 𝑏 𝑐 ⊔ 𝑏 𝑏 control ⊔ 𝑐 𝑏 𝑏 𝑑 Fixed number of tapes (can’t change during computation) � � � Transition function 3/3/2020 CS332 ‐ Theory of Computation 19

  20. Multi ‐ Tape TMs are Equivalent to Single ‐ Tape TMs Theorem: Every ‐ tape TM with can be simulated by an equivalent single ‐ tape TM 𝑐 𝑐 𝑏 𝑏 Finite 𝑏 𝑐 ⊔ 𝑏 control ⊔ 𝑐 𝑏 𝑏 Finite 𝑐 𝑐 𝑏 𝑏 𝑏 𝑐 ⊔ 𝑏 ⊔ 𝑐 𝑏 𝑏 𝑑 # # # control 3/3/2020 CS332 ‐ Theory of Computation 20

Recommend


More recommend