variants of turing machines

23
Variants of Turing Machines Lecture 26 Section 3.2 Mon, Oct 22, 2007

Upload: hanna-wolf

Post on 03-Jan-2016

77 views

Category:

Documents


2 download

DESCRIPTION

Variants of Turing Machines. Lecture 26 Section 3.2 Mon, Oct 22, 2007. Increasing the Power of a Turing Machine. It is hard to believe that something as simple as a Turing machine could be powerful enough for complicated problems. Increasing the Power of a Turing Machine. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Variants of Turing Machines

Variants of Turing Machines

Lecture 26Section 3.2

Mon, Oct 22, 2007

Page 2: Variants of Turing Machines

Increasing the Power of a Turing Machine

• It is hard to believe that something as simple as a Turing machine could be powerful enough for complicated problems.

Page 3: Variants of Turing Machines

Increasing the Power of a Turing Machine

• We can imagine a number of improvements.• Multiple tapes• Two-way infinite tape• Two-dimensional tape• Addressable memory• Nondeterminism• etc.

Page 4: Variants of Turing Machines

Multiple Tapes

• Would a Turing machine with k tapes, k > 1, be more powerful than a standard Turing machine?

• Each tape could be processed independently of the others.

Page 5: Variants of Turing Machines

Multiple Tapes

• In other words, each transition would read each tape, write to each tape, and move left or right independently on each tape.

Page 6: Variants of Turing Machines

Multiple Tapes

• Theorem: Any language that is accepted by a multitape Turing machine is also accepted by a standard Turing machine.

Page 7: Variants of Turing Machines

Multiple Tapes

• Sketch of the proof:• On a single tape, we could write the

contents of all k tapes.

• If tape i contains xi1xi2xi3…, for each i, then write

#x11x21…xk1#x12x22…xk2#...

on the single tape.

Page 8: Variants of Turing Machines

Multiple Tapes

• To show the current location on each tape, put a special mark on one of that tapes symbols:

#x11x21…xk1#x12x22…xk2#...

• Now the Turing machine scans the tape, locating the current symbol on each “tape.”

Page 9: Variants of Turing Machines

Multiple Tapes

• It then makes the appropriate transition.• Write a symbol over each of the current

symbols.• Move the location of the current symbol

one space left or right for each “tape.”

• Of course, the devil is in the details.

Page 10: Variants of Turing Machines

Two-way Infinite Tape

• We can use a two-tape machine to simiulate the two-way infinite tape.• The right half of the two-way tape is

stored on tape 1.• The left half is stored on tape 2.• Transitions are modified to handle the

transition from tape 1 to tape 2.

Page 11: Variants of Turing Machines

Two-way Infinite Tape

• Theorem: Any language accepted by a two-way infinite tape is also accepted by a standard Turing machine.

Page 12: Variants of Turing Machines

Other Variants

• Metatheorem: Any language accepted by a Turing machine with any variant that anyone has ever thought of is also accepted by a standard Turing machine.

Page 13: Variants of Turing Machines

Nondeterminism

• A nondeterministic Turing machine is defined like a standard Turing machine except for the transition function.

: Q (Q {L, R})where Q = Q – {qacc, qrej}.

Page 14: Variants of Turing Machines

Nondeterminism

• That is, (q, a) may result in any of a number of actions.

• If any sequence of transitions leads to the accept state, then the input is accepted.

• If all sequences of transitions lead to the reject state or to looping, then the input is not accepted.

Page 15: Variants of Turing Machines

Nondeterminism

• Theorem: Any language accepted by a nondeterministic Turing machine is also accepted by a standard Turing machine.

Page 16: Variants of Turing Machines

Nondeterminism

• Proof:• We may use a three-tape machine to

simulate a nondeterministic Turing machine.• Tape 1 preserves a copy of the original

input.• Tape 2 contains a “working” copy of the

input.• Tape 3 keeps track of the current state in

the nondeterministic machine.

Page 17: Variants of Turing Machines

Nondeterminism

• Start with the input w on Tape 1 and with Tapes 2 and 3 empty.

• Copy w from Tape 1 to Tape 2.• For Tape 3, imagine the transitions

starting from the start state as forming a tree.

• Each state has child states.

Page 18: Variants of Turing Machines

Nondeterminism

• Let b be the largest number of children of any node.

• Number the children of each state using the numbers 1, 2, …, b (as many as needed).

Page 19: Variants of Turing Machines

Nondeterminism

• Now each finite string of numbers from {1, 2, …, b} represents a particular path through the nondeterministic Turing machine, or else represents no path at all.

• Beginning by writing the empty string on Tape 3, representing no moves at all.

Page 20: Variants of Turing Machines

Nondeterminism

• If that leads to acceptance, then quit.• If not, then replace with its

lexicographical successor.• For that string, follow the sequence of

transitions that it describes.

Page 21: Variants of Turing Machines

Nondeterminism

• If that sequence leads to acceptance, then quit and accept.

• If not, then continue in the same manner.

Page 22: Variants of Turing Machines

Nondeterminism

• If w is accepted by the nondeterministic Turing machine, then some sequence of transitions leads to the accept state.

• Eventually that sequence will be written on Tape 3 and tried.

Page 23: Variants of Turing Machines

Nondeterminism

• On the other hand, if no sequence of transitions leads to the accept state, then the deterministic Turing machine will loop.