David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 13: Turing Machines.

Slides:



Advertisements
Similar presentations
Variations of the Turing Machine
Advertisements

ALAK ROY. Assistant Professor Dept. of CSE NIT Agartala
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Formal Models of Computation Part III Computability & Complexity
Lecture 10: Context-Free Languages Contextually David Evans
CSCI 3130: Formal Languages and Automata Theory Tutorial 5
Chapter 11: Models of Computation
Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Turing Machines.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 17: ProvingUndecidability.
1 CS 3261 Computability Course Summary Zeph Grunschlag.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 11: Parsimonious Parsing.
Squares and Square Root WALK. Solve each problem REVIEW:
Chapter 5 Test Review Sections 5-1 through 5-4.
25 seconds left…...
Introduction to Computability Theory
Week 1.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Introduction to Computability Theory
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
The Pumping Lemma for CFL’s
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture14: Recap Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Turing machines Sipser 2.3 and 3.1 (pages )
Turing machines Sipser 2.3 and 3.1 (pages )
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Class 19: Undecidability in Theory and Practice David Evans cs302: Theory of Computation University of Virginia Computer.
Final Exam Review Cummulative Chapters 0, 1, 2, 3, 4, 5 and 7.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Lecture 14: Church-Turing Thesis Alonzo Church ( ) Alan Turing ( )
Theory of Computation CS3102 – Spring 2014 A tale of computers, math, problem solving, life, love and tragic death Nathan Brunelle Department of Computer.
CS490 Presentation: Automata & Language Theory Thong Lam Ran Shi.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Cs3102: Theory of Computation Class 6: Pushdown Automata Spring 2010 University of Virginia David Evans TexPoint fonts used in EMF. Read the TexPoint manual.
Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans.
Class 21: Introducing Complexity David Evans cs302: Theory of Computation University of Virginia Computer Science.
David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 16: Universality and Undecidability.
Pushdown Automata Chapters Generators vs. Recognizers For Regular Languages: –regular expressions are generators –FAs are recognizers For Context-free.
Cs3102: Theory of Computation Class 8: Non-Context-Free Languages Spring 2010 University of Virginia David Evans.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
CSCI 2670 Introduction to Theory of Computing October 13, 2005.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Busch Complexity Lectures: Turing Machines
CS21 Decidability and Tractability
Pumping Lemma Revisited
CSE 105 theory of computation
CSE 105 theory of computation
Summary.
Chapter 3: The CHURCH-Turing thesis
CSE 105 theory of computation
Context-Free Languages
CS21 Decidability and Tractability
Pushdown automata a_introduction.htm.
CS21 Decidability and Tractability
Decidability and Tractability
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

David Evans cs302: Theory of Computation University of Virginia Computer Science Lecture 13: Turing Machines

2 The Story So Far Regular Languages Context-Free Languages Violates Pumping Lemma For RLs Violates Pumping Lemma For CFLs Described by DFA, NFA, RegExp, RegGram Described by CFG, NDPDA 0n1n0n1n 0n1n2n0n1n2n 0n0n w Deterministic CFLs LL(k) Languages Described by LL(k) Grammar Indexed Grammars

3 Lecture 13: Turing Machines The Story So Far (Simplified) Regular Languages Context-Free Languages Violates Pumping Lemma For RLs Violates Pumping Lemma For CFLs Described by DFA, NFA, RegExp, RegGram Described by CFG, NDPDA 0n1n0n1n 0n0n w

4 Lecture 13: Turing Machines Computability Story: This Week Languages recognizable by any mechanical computing machine

5 Lecture 13: Turing Machines Computability Story: Next Week Undecidable Problems Decidable Problems Recognizable Languages

6 Lecture 13: Turing Machines Computability  Complexity (April) Decidable Problems Problems that can be solved by a computer (eventually). Problems that can be solved by a computer in a reasonable time. NP P Note: not known if P  NP or P = NP

7 Lecture 13: Turing Machines Exam 1

8 Lecture 13: Turing Machines Exam 1 Problem 4c: Prove that the language {0 n 1 n 2 } is not context-free. Lengths of strings in L : n = = 0 n = = 2 n = = 6 n = = n = kk + k 2 Pumping lemma for CFLs says there must be some way of picking s = uvxyz such that m = |v| + |y| > 0 and uv i xy i z in L for all i. So, increasing i by 1 adds m symbols to the string, which must produce a string of a length that is not the length of a string in L.

9 Lecture 13: Turing Machines Recognizing {0 n 1 n 2 } DPDA with two stacks? DPDA with three stacks?... ?

10 Lecture 13: Turing Machines 3-Stack DPDA Recognizing {0 n 1 n 2 } 0, ε/ε/ε $/$/$ 0, ε/ε/ε +/ ε /+ 1, $/$/$  ε/ε/ε 1, +/ε/ε  ε/+/ε 1, $/+/+  $/ε/ε 1, ε/+/ε  +/ε/ε Start Done Count 0s 1s b->r 1s r->b 1, ε/$/$  ε/ε/ε 1, + /$/+ ε /+/ε 1, $/ ε /$  ε/ε/ε

11 Lecture 13: Turing Machines Can it be done with 2 Stacks?

12 Lecture 13: Turing Machines Simulating 3-DPDA with 2-DPDA # # A B

13 Lecture 13: Turing Machines Simulating 3-DPDA with 2-DPDA 3-DPDA # # pop green push B ($) push B (pop A ())... push B (pop A (#)) push B (pop A ())... push B (pop A (#)) res = pop A () push A (pop B (#)) push A (pop B ())... pop B ($) A B $ +

14 Lecture 13: Turing Machines 2-DPDA + Forced ε -Transitions A B Need to do lots of stack manipulation to simulate 3-DPDA on one transition: need transitions with no input symbol (but not nondeterminism!) # # $

15 Lecture 13: Turing Machines Impact of Forced ε -Transitions A B # # $ What is the impact of adding non-input consuming transitions? DPDA in length n input: runs for  n steps DPDA+ ε in length n input: can run forever!

16 Lecture 13: Turing Machines Is there any computing machine we can’t simulate with a 2-DPDA+?

17 Lecture 13: Turing Machines What about an NDPDA? A B Use one stack to simulate the NDPDA’s stack. Use the other stack to keep track of nondeterminism points: copy of stack and decisions left to make.

18 Lecture 13: Turing Machines Turing Machine? A B Tape Head

19 Lecture 13: Turing Machines Turing Machine... Infinite tape: Γ* Tape head: read current square on tape, write into current square, move one square left or right FSM:like PDA, except: transitions also include direction (left/right) final accepting and rejecting states FSM

20 Lecture 13: Turing Machines Turing Machine Formal Description... FSM 7-tuple: (Q, , Γ, δ, q 0, q accept, q reject ) Q : finite set of states  : input alphabet (cannot include blank symbol, _) Γ : tape alphabet, includes  and _ δ : transition function: Q  Γ  Q  Γ  {L, R} q 0 : start state, q 0  Q q accept : accepting state, q accept  Q q reject : rejecting state, q reject  Q (Sipser’s notation)

21 Lecture 13: Turing Machines Turing Machine Computing Model... FSM q0q0 input ____ blanks Initial configuration: xxxxxxx x  TM Configuration: Γ*  Q  Γ * tape contents left of head tape contents head and right current FSM state

22 Lecture 13: Turing Machines TM Computing Model δ *: Γ*  Q  Γ *  Γ*  Q  Γ * δ*(L, q accept, R)  (L, q accept, R) δ*(L, q reject, R)  (L, q reject, R) The q accept and q reject states are final:

23 Lecture 13: Turing Machines TM Computing Model δ *: Γ*  Q  Γ *  Γ*  Q  Γ *... FSM q a u, v  Γ*, a, b  Γ u b v δ*(ua, q, bv) = (uac, q r, v) if δ(q, b) = (q r, c, R) δ*(ua, q, bv) = (u, q r, acv) if δ(q, b) = (q r, c, L) Also: need a rule to cover what happens at left edge of tape

24 Lecture 13: Turing Machines Thursday’s Class Robustness of TM model Church- Turing Thesis Read Chapter 3: It contains the most bogus sentence in the whole book. Identify it for +25 bonus points (only 1 guess allowed!)