Multitape Turing Machines CSC 540 Christopher Siu 1 / 8 Multitape - - PowerPoint PPT Presentation

multitape turing machines
SMART_READER_LITE
LIVE PREVIEW

Multitape Turing Machines CSC 540 Christopher Siu 1 / 8 Multitape - - PowerPoint PPT Presentation

Multitape Turing Machines CSC 540 Christopher Siu 1 / 8 Multitape Turing Machines Defjnition A k -tape machine has k tapes and k independent tape heads. The machine reads the tapes simultaneously, but has only one state. Tape 3 Tape 2 Tape


slide-1
SLIDE 1

Multitape Turing Machines

CSC 540 Christopher Siu

1 / 8

slide-2
SLIDE 2

Multitape Turing Machines

Defjnition

A k-tape machine has k tapes and k independent tape heads. The machine reads the tapes simultaneously, but has only one state. Tape 3 Tape 2 Tape 1 qi

2 / 8

slide-3
SLIDE 3

Multitape Turing Machines

A multitape machine begins with the input in the standard position on Tape 1. Tape 3 Tape 2 a a b a Tape 1 q0

3 / 8

slide-4
SLIDE 4

Multitape Turing Machines

During each transition, a multitape machine may:

1 Change the state. 2 Write (potentially difgerent) symbols to each tape. 3 Independently reposition each tape head.

Defjnition

The transition function of a two-tape machine is of the form: δ(qi, x1, x2) = (qj, y1, d1, y2, d2) qi, qj ∈ Q are the starting and ending states. x1, x2 ∈ Γ are scanned from Tape 1 and Tape 2. y1, y2 ∈ Γ are written to Tape 1 and Tape 2. d1, d2 ∈ {L, R, S} are the directions for Head 1 and Head 2.

4 / 8

slide-5
SLIDE 5

Multitape Turing Machines

Example

Consider the following two-tape machine to accept

  • aibai | i ≥ 0
  • :

q0 > q1 q2 q3 (B/B R, B/B R ) (a/a R, B/a R ) (b/b R, B/B L ) (a/a R, a/a L ) (B/B R, B/B R )

Example

Construct a multitape machine that, given an input BwB (on Tape 1), where w ∈ {a, b}∗, produces the output BwwB (on Tape 1).

5 / 8

slide-6
SLIDE 6

Converting Multitape to Multitrack Machines

Theorem

A language L is accepted by a multitape Turing machine if and only if it is accepted by a standard Turing machine Note that a k tapes can be simulated by (2k + 1) tracks.

Example

b a Tape 2 a b a Tape 1 qi

# Track 5 X Track 4 b a Track 3 X Track 2 a b a Track 1

6 / 8

slide-7
SLIDE 7

Converting Multitape to Multitrack Machines

To simulate a transition of a 2-tape M, a 5-track M ′ must:

1 Find the ‘X’ on track 2; transition based on track 1. 2 Find the ‘X’ on track 4; transition based on track 3.

Note that we now know the symbols scanned from the “tapes”, so we know — at machine-design-time — the desired output of δ.

3 Write to tracks 1 and 3; move the ‘X’s on tracks 2 and 4.

Example

Consider simulating δ(qi, a, b) = (qj, b, L, aR): qi qj (a/b L, b/a R )

7 / 8

slide-8
SLIDE 8

Converting Multitape to Multitrack Machines

Example (cont.)

(where ∗ indicates “any symbol”, and {c}, “any symbol other than c ”) (∗, {X}, ∗, ∗, ∗)/ (∗, {X}, ∗, ∗, ∗)R (a, X, ∗, ∗, ∗)/ (a, X, ∗, ∗, ∗)L (b, X, ∗, ∗, ∗)/ (b, X, ∗, ∗, ∗)L (∗, ∗, ∗, ∗, {#})/ (∗, ∗, ∗, ∗, {#})R (∗, ∗, ∗, ∗, #)/ (∗, ∗, ∗, ∗, #)R (∗, ∗, ∗, {X}, ∗)/ (∗, ∗, ∗, {X}, ∗)R (∗, ∗, b, X, ∗)/ (∗, ∗, b, X, ∗)L (∗, ∗, ∗, ∗, {#})/ (∗, ∗, ∗, ∗, {#})R (∗, ∗, a, X, ∗)/ (∗, ∗, a, X, ∗)L

8 / 8