1 Turing machines Chapter 4, Smith and Kimber. A Turing machine is an abstraction of a human “computer”. Consists of - control, in the form of states -

Slides:



Advertisements
Similar presentations
Turing Machines Part 1:. 2 Church-Turing Thesis Part 1 An effective procedure is defined as: a procedure which can be broken down into simple.
Advertisements

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.
Variants of Turing machines
CS 461 – Oct. 21 Begin chapter 3 We need a better (more encompassing) model of computation. Ex. { 1 n 2 n 3 n } couldn’t be accepted by PDA. –How could.
Turing Machines (At last!). Designing Universal Computational Devices Was Not The Only Contribution from Alan Turing… Enter the year 1940: The world is.
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 ? ?
Fall 2004COMP 3351 Turing Machines. Fall 2004COMP 3352 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Chapter 9 Turing Machine (TMs).
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
AUTOMATA THEORY VIII.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
Turing Machines – Decidability Lecture 25 Section 3.1 Fri, Oct 19, 2007.
1 Turing Machines There are languages that are not context-free. What can we say about the most powerful automata and the limits of computation?. Alan.
1 The Halting Problem and Decidability How powerful is a TM? Any program in a high level language can be simulated by a TM. Any algorithmic procedure carried.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
Turing Machines Chapter 17. Languages and Machines SD D Context-Free Languages Regular Languages reg exps FSMs cfgs PDAs unrestricted grammars Turing.
Turing Machines. Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves.
Turing Machines and the Halting Problem This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
TM Design Macro Language D and SD MA/CSSE 474 Theory of Computation.
Theory of computing, part 4. 1Introduction 2Theoretical background Biochemistry/molecular biology 3Theoretical background computer science 4History of.
CSCI 2670 Introduction to Theory of Computing October 7, 2004.
Turing Machines Lecture 26 Naveen Z Quazilbash. Overview Introduction Turing Machine Notation Turing Machine Formal Notation Transition Function Instantaneous.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 IDT Open Seminar ALAN TURING AND HIS LEGACY 100 Years Turing celebration Gordana Dodig Crnkovic, Computer Science and Network Department Mälardalen University.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
THE CONVENTIONS 2 simple rules: Rule # 1: Rule # 2: RR “move to the right until you find  “ Note: first check. Then move (think of a “while”) “Never.
December 3, 2009Theory of Computation Lecture 21: Turing Machines III 1 Simulation of T in L Now the MIDDLE section of Q can be generated by replacing.
1 Introduction to Turing Machines
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 12 Mälardalen University 2007.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Summary of Previous Class There are languages that are not decidable –(we have not proved this yet) Why not extend Turing machines just as we did with.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
CS 154 Formal Languages and Computability April 12 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 3240 – Chapter 9.  Turing Machines  From Alan Turing, 1936  Turns out to be the LAST machine  The only machine you'll ever need  The Church-Turing.
Chapter 9 Turing Machines What would happen if we change the stack in Pushdown Automata into some other storage device? Truing Machines, which maintains.
Turing Machines. The next level of Machine… PDAs improved on FSAs by adding memory. We make the memory more flexible to do more complicated tasks.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CSCI 2670 Introduction to Theory of Computing September 29, 2005.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Universal Turing Machine
CS 154 Formal Languages and Computability April 7 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
TM Macro Language MA/CSSE 474 Theory of Computation.
CSE202: Introduction to Formal Languages and Automata Theory
Busch Complexity Lectures: Turing Machines
Turing Machines Chapter 17.
(Universal Turing Machine)
Computing with Turing Machines
Turing Machines 2nd 2017 Lecture 9.
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Formal Definition Definition. A Turing machine is a 5-tuple (S, , , s, H), where: S is a set of states  is an alphabet It must contain  and . It cannot.
Turing Machines Chapter 17.
Decidable Languages A language L is decidable if there is a Turing machine ML such that given any word w  0*, then: Input of ML: a  b  … w Output of.
MA/CSSE 474 Theory of Computation
MA/CSSE 474 Theory of Computation
Formal Definitions for Turing Machines
Presentation transcript:

1 Turing machines Chapter 4, Smith and Kimber. A Turing machine is an abstraction of a human “computer”. Consists of - control, in the form of states - a tape, which is infinite - a tape head, which can be moved left and right - output, which is written to the tape - a tape head A TM is just a souped up FSM!

2 Turing machine Finite set of States Q with initial state Finite Input/out alphabet  with  special symbols < (left marker), _ (blank) Accepting, or halting states H Transition relation ((Q-H) x  ) -> (Q x (  U  \  ) A transition describes the “rules” of the TM. transition ((s,a),(q,b)) in state s, read symbol a from tape, then move to state q and replace a with b states read a write b (at same tape position) transition ((s,a),(q,->)) in state s, read symbol a from tape, then move the head right one position transition ((s,a),(q,<-)) in state s, read symbol a from tape, then move the head left one position > < a b a a - - head tape control

3 Turing machine Finite set of States Q with initial state Finite Input/out alphabet  with special symbols < (left marker), _ (blank) Accepting, or halting states H Transition relation  :: ((Q-H) x  ) -> (Q x  U  ) Conditions on the transition relation:  is total for all non halting states and symbols but for all a, for all halting states h,  (h,a) is not defined. Note 1: From the type of , we can see that no new left marker is ever produced. Note 2: Some definitions of Turing machines allow  to be partial, in which case a TM may halt and fail. > < a b a a - - head tape control

4 Example 1 Turing machine What does this machine do? S= {s,q,h}, H={h}, initial s ((s,_) (h,_ )) s: see _, halt ((s,a),(q,_)) s: see a, erase and move to state q ((q,_),(s,->)) q: see a _, move tape right and move to state s ((s, )) s: see lh, move right ((q, )) q: see lh, move right ((q,a),(h,a)) q: see a, halt It just erases the input string! Work through an example, e.g. input <aaa_ _

5 Example 2 Turing machine What does this machine do? S= {s0,s1,s2,s3,s4, h}, H={h}, initial s0,  ={a,b} ((s0, )) ((s1,a) (s2,a )) ((s1,b),(s2,b)) ((s2,a) (s3,-> )) ((s2,b),(s3,->)) ((s3,a) (s4,_ )) ((s3,b),(s4,_)) ((s3,_),(h,<-)) ((s4,_) (s3,-> ) Graphical representation: (_,->) (a,a) (a,->) (a,_) (b,b) (b,->) (b,_) It computes the head of a list! Note: you could remove state s1 – or keep it and add ((s1,_),(h,<-))

6 Example 3 Turing machine Design a machine to make a copy of the input, with a blank between the original input and the copy. E.g. if the input is w, then the output (i.e. the contents of the tape) is w_w. < a b c - to < a b c - a b c - Design: Loop until blank 1.Memorise character 2.Erase character 3.Go right to first blank, right again, while not blank, go right 4.Write character 5.Go left to blank, replace blank by character, go right Go back to < > (1,_) (1,->)(_,1)(_,->) (_,<-) (1,<-) (1,->) (1,<-) (_,1) (1,->) ( ) (Assume alphabet {1})

7 Encodings and language recognition How does a TM recognise a language? By halting with a tape which contains only a 0 (False) or a 1 (True). (Characteristic function) Strings can be unary or binary (or any) encodings of Nat. E.g. if  ={1} then the string 11 represents 2, if  ={0,1} then the string 11 represents 3. For example, if we take the TM from example 3, and modify it to remove the blank between the two strings, Then when the input is in unary, this TM computes the function (*2). We now formalise this. Nb. example 3 was something we couldn’t do with PDAs!

8 Some definitions Defn A TM configuration consists of the current state the symbol currently at the head position on the tape the string on the tape to the left of the head the string on the tape to the right of the head (to rightmost nonblank) If the state is a halting state, we say that the configuration is halting. Convenient notation is (q,uav) string to left current symbol string to right Defn C1 |- C2configuration C1=(q,uav) yields C2=(p,u’bv’) iff u=u’, v=v’,  (q,a) = (x,b) or v=bv’, ua=u’, d(q,a) = (x,->) etc. C0 |-* Cniff C0 |- C1…|- Cn A computation of length n.

9 Some definitions Defn If a TM M starting with initial configuration (s,<w) and head at first character of w halts in final configuration (h,<u), i.e. (s,<w) |-* (h,u), then we say that M(w)=u and call M(w) the output of M, on input w. Defn A TM M computes the function f:  *->  * if for every w  Dom(f), M halts with M(w) =f(w) and for every w  Dom(f), M does not halt. Defn A function f with Dom(f) C  * is called Partial Turing Computable iff there exists a TM that computes it. Defn A Partial Turing Computable function f is called Turing Computable iff Dom(f) =  *. Defn A language is called Turing computable, or decidable if its characteristic function is Turing computable. Defn A language is semidecidable if its characteristic function is only partial Turing computable.

10 Turing Computability What is the significance of these definitions? Essentially Partial computable => the machine may not halt, it may loop (procedure) Computable => the machine always halts (algorithm) Note: TMs can compute functions of multiple arguments by separating all the inputs by blanks. e.g. if w 1 …w n encodes input x1 to xn, then the input tape is w 1 _ w 2 _ …_ w n So TMs can compute functions from Nat x Nat x.. Nat -> Nat. How powerful are TMs? Or put another way, Question: the £20M one are all functions Turing computable????