Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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 the input string There is a special accept state There is a special reject state The machine may process forever The machine does not have to read the entire input string What can a Turing Machine do? More than a PDA As much as any other computational device? Not everything.

2 Formal definition of a TM A Turing Machine is a 7-tuple, (Q,,,, q0, qaccept, qreject), where Q,, are all finite and 1. Q is the set of states 2. is input alphabet – does not include blank symbol 3. is the tape alphabet – include blank symbol 4. : Q Q {L,R} is the transition function 5. q0 Q is the start state 6. qaccept Q is the accept state 7. qreject Q is the reject state

3 Touring machine that recognizes strings with substring 1011 in them. Touring machine which recognizes strings of the form ww, w = {a,b}* Calculate x*y

4 Describing TMs Formal description: Gives the Turing machines states, transition functions, etc. Implementation description: Uses English to describe how the Turing machine stores and interprets data on its tape, moves its head, etc. High-level description: Uses English to describe an algorithm. It ignores implementation details – it does not describe how the machine manages the tape or stores data on the tape, etc. Encoding an object: The notation for encoding an object O into a string is. The encoding of several objects 0 1, 0 2,…, 0 n is denoted. When taking such input, the first step of the Turing machine is to test the encoding to make sure it correctly codes an object, and reject it if it doesnt.

5

6 A configuration of a Turing machine is a triplet: The current state the machine is in The current tape head position The current contents of the tape An accepting configuration is when the state of a configuration is q accept. A rejecting configuration is when the state of the configuration is q reject. Accepting and rejecting configurations are also Halting configurations. A Turing Machine accepts a string if the Turing Machine enters an accepting configuration at some point during its computation on the given string. A Turing Machine rejects a string if the Turing Machine enters a rejecting configuration at some point during its computation on the given string.

7 The collection of strings that a Turing Machine M accepts is called the language of M. A language is called Turing-recognizable (or just recognizable) if some Turing Machine accepts all of the strings in the language. Another term for Turing- recognizable is recursively enumerable. A language is called Turing-decidable (or just decidable) if some Turing Machine accepts all of the strings in the language and rejects (or enters a rejecting configuration) on all strings not in the language. This means that the Turing Machine must halt on all input strings. Another term for Turing decidable is enumerable. There IS a difference between decidable and recognizable.

8 When do we consider two machines (computational devices) to have the same power (equivalent)? Does speed matter? Our definition: Two machines are equivalent if they can recognize the same set of languages. Simulate machine A on machine B, and machine B on machine A. How do we prove equivalence? Note that making the simulation fast/small is not a priority.

9 Extending the power of Turing Machines – too bad, so sad N-tape Turing Machine = single tape Turing Machine – P137 Let k be the number of tapes Starts with input on 1st tape and all other tapes blank Transition function = : Q k Q k {L,R} k Store each machines tape contents separated by a # sign Keep track of each machines head position with a special dot on tape Heres how the machine works: 1. Scan tape contents beginning from leftmost # to determine each tapes contents underneath the tape heads (dot symbol) 2. Make a second pass to update tape contents according to the original machines transition function for the current state. 3. If a virtual head ever moves to the right onto a #, move everything over one space and put a blank symbol (with a dot) there.

10 Non-deterministic Turing Machine = Turing Machine – P138- Transition function = : Q P(Q {L,R}) For each state there is at most |Q {L,R}| possible paths ( a finite number) For each state on a given symbol there is at most |Q {L,R}| possible paths Well create a distinct tape symbol for each possible path We use a 3 tape Turing Machine Tape 1 = copy of input string Tape 2 = simulation tape – where we run the NDTM on one possible path Tape 3 = A finite length string of our possible path symbols 1. Initially, tape 1 contains the input string and the other two tapes are blank 2. Copy tape 1 to tape 2 3. Use tape 2 to simulate the NDTM on one possible branch of its computation. The ith step of the NDTM is determined from the ith symbol on tape 3. If the ith symbol on tape 3 is either invalid or blank, or if a rejecting configuration occurs, goto step 4. If an accepting configuration occurs then accept the input. 4. Replace string on tape 3 with the lexicographically next string. Goto step 2.

11 Church-Turing Thesis Proved the equivalence of the -calculus and Turing Machines. Showed that intuitive notion of algorithms = Turing machine algorithms. Provides the formal definition of algorithm that is needed to prove that certain algorithms DO NOT exist.


Download ppt "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."

Similar presentations


Ads by Google