Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans.

Similar presentations


Presentation on theme: "Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans."— Presentation transcript:

1 cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans

2 The Story So Far s All Languages Regular Languages a a Finite Languages Context-Free Languages w anan anbncnanbncn ww anbnanbn ww R Add a stack: Described by CFG or NPDA Described by RG, DFA, NFA, RE These sets are inclusive: All regular languages are context-free All finite languages are regular and context-free

3 s a a This Week: Computability Languages that can be recognized by any mechanical computing machine All Languages

4 Next Week: Decidability Undecidable Problems Decidable Languages Recognizable Languages

5 Decidability  Complexity (April) Decidable Problems Problems that can be solved by some mechanical computer (eventually). Problems that can be solved by some mechanical computer in a reasonable time. NP P Note: not known if P  NP or P = NP

6 Recognizable Languages s All Languages Regular Languages a a Finite Languages Context-Free Languages w anan anbncnanbncn ww anbnanbn ww R Add a stack: Is a n b n c n recognizable by some computing machine?

7 2-Stack DPDA Recognizing {a n b n c n } Start Count a s ,  /  $/$ a,  /  +/+ Count b s b, +/   /  Count c s c,  /+   /  Accept , $/$   / 

8 Recognizing w#w w  {0, 1}*

9 Recognizing ww w  {0, 1}*

10 Can it be done with a 2-Stack DPDA?

11 Simulating 3-DPDA with 2-DPDA # # A B ,  /  /a   /  /b

12 Simulating 3-DPDA with 2-DPDA 3-DPDA # # push B ($) push B (pop A ())... push B (pop A (#)) push B (pop A ())... push B (pop A (#)) pop A (a) pop B (b) push A (pop B (#)) push A (pop B ())... pop B ($) [need to flip each returning stack ] A B $ + ,  /  /a   /  /b

13 L (2-DPDA) = L (3-DPDA) A B Need to do lots of stack manipulation to simulate 3-DPDA on one transition, but possible to simulate every 3- DPDA with a 2-DPDA! # # $

14 Is there any computing machine we can’t simulate with a 2-DPDA?

15 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.

16 Turing Machine? A B Tape Head

17 Turing Machine... Infinite tape: Γ* Tape head: like DFA, except: input is symbol read from tape transition outputs: state + symbol to write on tape direction (left/right) to move final accepting and rejecting states FSM Next class: we’ll talk about Alan Turing and why he invented this model

18 Turing Machine Formal Description... FSM

19 Turing Machine Configuration... ____ blanks x0x0 x1x1 x2x2 x3x3...x n-2 x n-1 x  FSM

20 Turing Machine Configuration... ____ blanks x0x0 x1x1 x2x2 x3x3...x n-2 x n-1 x  FSM TM Configuration: tape contents left of head tape contents head and right current FSM state

21 Turing Machine Configuration... q0q0 input ____ blanks Initial configuration: x0x0 x1x1 x2x2 x3x3...x n-2 x n-1 x  Initial Configuration: FSM TM Configuration:

22 TM Computing Model... FSM

23 TM Computing Model... FSM

24 Defining  *... FSM TM stops when it enters one of these states!

25 Defining  *... FSM

26 Defining  *... FSM

27 Defining  *... a u b v FSM

28 Defining  *... a u b v FSM Have we covered everything?

29 ... b v FSM Defining

30 ... b v FSM

31 Defining a u b FSM This is no right edge! Can always add blanks.

32 Defining a u b FSM This is no right edge! Can always add blanks.

33 TM Computing Model... FSM Initial Configuration:

34 Thursday’s Class Alan Turing and why he invented the TM model Alan Turing and why he invented the TM model Robustness of TM model Robustness of TM model Church-Turing Thesis Church-Turing Thesis Before Thursday: Read Chapter 3 It contains the most bogus sentence in the whole book. Post your guesses and explanations on course site. First to correctly identify most bogus sentence gets +25 bonus points (only 1 guess allowed!)


Download ppt "Cs3102: Theory of Computation Class 14: Turing Machines Spring 2010 University of Virginia David Evans."

Similar presentations


Ads by Google