Turing Machines – Examples Lecture 24 Section 3.1 Wed, Oct 17, 2007
Turing Machine as Language Processor Design a Turing machine that will shift the input string one space to the right, leaving a blank in the leftmost cell.
Strategy Strategy: Read the first symbol and write a blank. Move right. Read the second symbol and write the first symbol. Move right. Read the third symbol and write the second symbol.
Strategy Move right. Continue in this way until a blank is read. Write the last symbol.
The Turing Machine q0q0 acc 0 _, R 1 _, R 0 0, R 1 1, R 1 0, R 0 1, R _ 0, R _ 1, L _ L _ R
Another Language Processor Design a Turing Machine that will duplicate the input string. Replace w with w#w.
Turing Machine as Calculator Design a Turing Machine that will add 1 to the input. For example, if the input is , the output will be Design a Turing Machine that will subtract 1 from the input.
Turing Machine as an Enumerator Design a Turing Machine that will print on its tape all binary strings. Design a Turing Machine that will print all binary strings that contain an even number of 0s and an odd number of 1s.
Turing Machine as an Enumerator Design a Turing Machine that will print all binary strings all of whose prefixes contain at least as many 0s as 1s (balanced parentheses).