3.1 Turing Machines What's a Turing Machine? state machine that can read and write on a tape How is a Turing Machine similar to other machines? states, start state transitions from state to state How is a Turing Machine different from other machines? transitions read and write tape symbols input string given on tape accept and reject states halt the machine What operations is a Turing Machine allowed to do on its tape? read and write at the current position of the tape head Is a Turing Machine able to access symbols in the middle of the tape? yes, it can move the tape head left or right How much space does a Turing Machine have available on its tape? the tape has infinite length What are the initial contents of the Turing Machine's tape? tape initially contains the input string followed by blanks Give an informal description of a TM that accepts the language. { a^n b^n | n >= 0 } Show the execution of the machine on input aabb. Classwork (You may work with a partner.) Give an informal description of a TM that accepts the language. { a^n b^n c^n | n >= 0 } How are the transitions in a TM state diagram different from the transitions in other state diagrams? transitions are labelled with three symbols (read -> write, move) Draw a state diagram for a TM that recognizes the language. { a^n b^n | n >= 0 } Since the input string is given on the tape, a Turing Machine doesn't consume the input string (like an NFA or PDA). How then does a Turing Machine know when to stop execution? What's a Turing Machine Configuration? state, tape content, head position How do you write a Turing Machine Configuration? write tape content to left of head write current state write tape content under and to right of head What does the configuration represent? Which symbol will the machine read next? abaa 4 bb Give the sequence of configurations for the a^n b^n machine on input aabb. Classwork (You may work with a partner.) Draw a state diagram for a TM that accepts the language. { a^n b^n c^n | n >= 0 } What happens if a TM is at the left end of the tape and it tries to move left? it stays at the left end of the tape What happens if a TM is at the right end of the tape and it tries to move right? there is no right end of the tape the tape is filled with blanks the TM can write over the blanks How do Turing Machines compare to DFAs and NFAs? TMs are more powerful than DFAs and NFAs How do Turing Machines compare to PDAs? TMs are more powerful than PDAs So are Turing Machines capable of recognizing any language? no, there are some problems TMs cannot solve Recognizers and Deciders Do Turing Machines always halt? no, they can loop forever What's a Decider? a TM that halts on any input halts and accepts strings in the language halts and rejects other strings What's a Recognizer? a TM that halts on inputs in it's language halts and accepts strings in the language either halts and rejects or loops for other strings What's a Turing Decidable (recursive) language? a language is Turing-decidable if some Turing Machine decides it (machine always halts) What's a Turing Recognizable (recursively enumerable) language? a language is Turing-recognizable if some Turing Machine recognizes it (machine may not halt) Is every Turing-Decidable language also Turing Recognizable? Is every Turing-Recognizable language also Turing Decidable? What's a Formal Definition of a Turing Machine? 7-tuple (Q, S, G, d, q0, qa, qr) 1. Q is a finite set (states) 2. S is a finite set (input alphabet)(never contains blank) 3. G is a finite set (tape alphabet)(always contains blank) S is a subset of G 4. d: Q x G -> Q x G x {L,R} is the transition function 5. q0 is a member of Q (start state) 6. qa is a member of Q (accept state) 7. qr is a member of Q (reject state)