enhanced turing machines - hampden-sydney...

Post on 10-Jul-2020

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Enhanced Turing MachinesLecture 28

Sections 10.1 - 10.2

Robb T. Koether

Hampden-Sydney College

Wed, Nov 2, 2016

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 1 / 21

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 2 / 21

Outline

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 3 / 21

Increasing the Power of a Turing Machine

It is hard to believe that something as simple as a Turing machinecould be powerful enough to solve complicated problems.We can imagine a number of improvements.

A Stay optionMultiple tapesOne-way infinite tapeTwo-dimensional tape (n-dimensional tape)Addressable memoryNondeterminismetc.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 4 / 21

Outline

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 5 / 21

A Stay Option

Rather more left or right on every transition, we could allow theTuring machine to stay at its current tape position.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 6 / 21

A Stay Option

TheoremAny Turing machine with a Stay option is equivalent to some standardTuring machine.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 7 / 21

Outline

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 8 / 21

One-way Infinite Tape

Would a Turing machine with a one-way infinite tape be morepowerful than a standard Turing machine?

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 9 / 21

One-way Infinite Tape

TheoremAny Turing machine with a one-way infinite tape is equivalent to astandard Turing machine.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 10 / 21

One-way Infinite Tape

We can use a one-tape machine to simulate the two-way infinitetape.Establish a tape position that marks the left “edge” of the one-waytape.Symbols that would be to the right of that mark will occupy the oddpositions.Symbols that would be to the left of that mark will occupy the evenpositions.Modity the transitions accordingly.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 11 / 21

Outline

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 12 / 21

Multiple Tapes

Would a Turing machine with k tapes, k > 1, be more powerfulthan a standard Turing machine?Each tape could be processed independently of the others.In other words, each transition would read each tape, write toeach tape, and move left or right independently on each tape.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 13 / 21

Multiple Tapes

TheoremAny language that is accepted by a multitape Turing machine is alsoaccepted by a standard Turing machine.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 14 / 21

Multiple Tapes

Proof (sketch):Let the tape contents be:

Tape 1: x11x12x13 . . . x1n1

Tape 2: x21x22x23 . . . x2n2...

...Tape k : xk1xk2xk3 . . . xknk

Then we would write on a single tape

#x11x12 . . . x1n1#x21x22 . . . x2n2# . . .#xk1xk2 . . . xknk#.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 15 / 21

Multiple Tapes

Proof (sketch):To show the current location on each tape, put a special markon one of that tape’s symbols:

#x11x12 . . . x1n1#x21x22 . . . x2n2# . . .#xk1xk2 . . . xknk#

Begin with#x11x12 . . . x1n1# t# . . .# t#

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 16 / 21

Multiple Tapes

Proof (sketch):The Turing machine scans the tape, locating the current symbolon each “tape.”It then makes the appropriate transition.

Write a symbol in each of the current positions.Move the location of the current symbol one space left or right foreach tape.

Of course, the devil is in the details.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 17 / 21

Outline

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 18 / 21

Binary Addition

Example (Binary Addition)Binary addition is much simpler if we have a three-tape machine.Write x on tape 1 and write y on tape 2.Write the sum on tape 3.For simplicity, assume fixed-length integers.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 19 / 21

Outline

1 Variants of Turing MachinesA Stay OptionOne-Way Infinite TapeMultiple TapesExamples

2 Assignment

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 20 / 21

Assignment

HomeworkUse JFLAP to do the following:

Design a 3-tape machine that will do subtraction of fixed-lengthintegers. Allow the results to “wrap around.” That is, if y > x , thenthe result of x − y will be 2n + (x − y).Design a 3-tape machine that will accept the language

{anbncn | n ≥ 0}.

Robb T. Koether (Hampden-Sydney College) Enhanced Turing Machines Wed, Nov 2, 2016 21 / 21

top related