CS 3240: Languages and Computation - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

CS 3240: Languages and Computation

Description:

... A Turing machine is7-tuple (Q, ... Equivalence of machines ... Start at leftmost slot. Scan right to (k 1)st # to find symbol at each virtual tape head ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 12
Provided by: ble87
Category:

less

Transcript and Presenter's Notes

Title: CS 3240: Languages and Computation


1
CS 3240 Languages and Computation
  • Multitape Turing Machines

2
Review Formal definition of TM
  • Definition A Turing machine is7-tuple
    (Q,?,?,?,q0,qaccept,qreject), where Q, ?, and ?
    are finite sets and
  • Q is the set of states,
  • ? is input alphabet where blank symbol ??
  • ? is tape alphabet, where ????,
  • ? Q???Q???L,R is transition function,
  • q0?Q is start state,
  • qaccept?Q is accept state, and
  • qreject?Q is reject state, where qreject?qaccept

3
Example
  • Write a TM that accepts all strings of the form
    101001000100001
  • Start with a 1
  • End with a 1
  • Progressively more 0s between consecutive 1s
  • Possible Solution
  • Check first symbol is a 1
  • If not, then reject
  • Move right and check if second symbol is a 0
  • If not, then reject
  • If so, replace with X and begin recursion

4
Recursion (high level)
  • Go back and forth on either side of each 1
  • Replace 0s on right side of 1 with an X
  • Replace Xs on left side of 1 with a Y
  • After all Xs on left side of 1 are replaced with
    Ys, there should be exactly one on the right
    side that has not been Xed
  • If not, then reject
  • If so, repeat process (recursion step)
  • If you begin to look for the next group of 0s
    and reach a then accept

5
Example
  • Ex1x2x3xn xi? 0,1 and xi?xj for i ?
    j
  • Basic idea Compare each pair of (xi , xj) by
    zig-zagging. Use special marks to replace to
    indicate which pair of (xi , xj) is being
    compared
  • Must take care special cases such as n0, n1,
    missing , etc.

6
Question
  • How to detect whether we have reached left-most
    cell?
  • Alternative 1 If leftmost cell marked by special
    symbol, then easy
  • Alternative 2 Use special property that TM
    stays put at left-most cell by replacing cell
    with special symbol and then recover

7
Variants of Turing machines
  • Robustness of model
  • Varying the model does not change the power
  • Simple variant of TM model
  • Add stay put direction
  • Other variants
  • More tapes
  • Nondeterministic

8
Multitape Turing machines
  • Same as standard Turing machine, but have several
    tapes
  • Initially, input is on tape 1
  • TM definition changes only in definition of d
  • d Q ?k ? Q ?k L,Rk

9
Equivalence of machines
  • Theorem Every multitape Turing machine has an
    equivalent single tape Turing machine
  • Proof method By construction.

10
Simulating k-tape behavior
  • Single tape start string is
  • w...
  • Each move proceeds as follows
  • Start at leftmost slot
  • Scan right to (k1)st to find symbol at each
    virtual tape head
  • Make second pass making updates indicated by
    k-tape transition function
  • When a virtual head moves onto a , shift string
    to right

11
Corollary
  • Corollary A language is Turing-recognizable if
    and only if some multitape Turing machine
    recognizes it.
Write a Comment
User Comments (0)
About PowerShow.com