Presentation is loading. Please wait.

Presentation is loading. Please wait.

Turing Machines – Examples Lecture 24 Section 3.1 Wed, Oct 17, 2007.

Similar presentations


Presentation on theme: "Turing Machines – Examples Lecture 24 Section 3.1 Wed, Oct 17, 2007."— Presentation transcript:

1 Turing Machines – Examples Lecture 24 Section 3.1 Wed, Oct 17, 2007

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

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

4 Strategy Move right. Continue in this way until a blank is read. Write the last symbol.

5 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

6 Another Language Processor Design a Turing Machine that will duplicate the input string. Replace w with w#w.

7 Turing Machine as Calculator Design a Turing Machine that will add 1 to the input. For example, if the input is 100111, the output will be 101000. Design a Turing Machine that will subtract 1 from the input.

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

9 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).


Download ppt "Turing Machines – Examples Lecture 24 Section 3.1 Wed, Oct 17, 2007."

Similar presentations


Ads by Google