Asked By : user678392
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/14619
Answered By : Luke Mathieson
- We need a symbol that will denote the start and end of the simulated tapes
- For each symbol in $Gamma$ we also need a version that indicates that the simulated tape head is at that character on the simulated tape.
So for the single-tape machine, our new tape alphabet is $Gamma’ ={0,1,sqcup,underline{0},underline{1},underline{sqcup},#}$. The initial state of the tape is: $$ #underset{wedge}{underline{1}}0101#underline{sqcup}#underline{sqcup}#sqcupsqcupsqcupldots $$ Note the difference between the head of the machine (the $wedge$) and the simulated heads of the 3 simulated tapes (the underlined characters). Of course the tape extends infinitely to the right as usual. I have also cheated mildly by moving the tape head to the first character on the first string; strictly it should start out on the leftmost cell, but this is a trivial technicality. So we have three marked out sections (between the $#$ marks), which will correspond to the 3 tapes of the original machine. Now let’s make up an action for the machine. Let’s say that the original machine reads from the first tape, if it sees a $1$, it writes a $1$ on the second tape, if it sees a $0$ it writes a $1$ on the third tape. At each read or write, the head moves to the right. So after the first “step” (perhaps requiring several states and transitions in the actual machine), the tapes should have a $1$ on the second tape, and the first and second heads will have moved right one step: $$ begin{array}{lc} text{Tape 1:} & 1underset{wedge}{0}101sqcupsqcupsqcupldots text{Tape 2:} & 1underset{wedge}{sqcup}sqcupsqcupsqcupsqcupldots text{Tape 3:} & underset{wedge}{sqcup}sqcupsqcupsqcupsqcupsqcupldots end{array} $$ On the second go around, the first tape reads a $0$, so we write to the third tape instead: $$ begin{array}{lc} text{Tape 1:} & 10underset{wedge}{1}01sqcupsqcupsqcupldots text{Tape 2:} & 1underset{wedge}{sqcup}sqcupsqcupsqcupsqcupldots text{Tape 3:} & 1underset{wedge}{sqcup}sqcupsqcupsqcupsqcupldots end{array} $$ The single-tape machine simulates this by moving the underline (by using the alternate version of the characters in $Gamma’$, and writing to the appropriate simulated tape. So after the first step, the combined tape looks like: $$ #1underset{wedge}{underline{0}}101#1underline{sqcup}#underline{sqcup}#sqcupsqcupsqcupldots $$ After the second step: $$ #10underset{wedge}{underline{1}}01#1underline{sqcup}#1underline{sqcup}#sqcupsqcupsqcupldots $$ Of course this is a high level view of the process – I haven’t attempted to explain how to construct the states, or how each simulated tape gets longer (for this, you need a little routine that checks if you’ve run into the end of the simulated tape, then moves everything to the right one step along and squeezes in a new blank – i.e. it only adds simulated tape cells when they’re needed).