0
$\begingroup$

I am currently making a 2 tape turing machine for a language that has a binary palindrome (ex: L = {x is over {0,1} | x is a palindrome }. I can assume that the tape is only infinite in one way (the right side). and when using 2 tapes, the first one contains the input, the other is empty, and both heads start at the beginning of the tape.

So, my process has been:

  1. transfer all of the letters from tape1 to tape2 (ex: 0,0,R | U,0,R would keep the symbol 0 on tape1 and move it to the right while changing the empty symbol on tape2 to 0 and moving it right as well).
  2. Reverse tape1's head to the start again. However, I'm not sure how to do this if the tape is not infinite on both sides. I've been stumped on this part for a while and am unsure of how to continue.
$\endgroup$
1
  • 2
    $\begingroup$ One-way tape(s) Turing Machine are often modeled assuming that there is a special unwritable symbol at the beginning of the tape ('#') and the head is initially placed at its right. In the transition table you can specify the behavior when the heads are on the '#' (a move to the left of '#' will leave the head where it is). This is in my opinion the best way to interpret it (but all models are clearly equivalent). $\endgroup$
    – Vor
    Commented Apr 19, 2023 at 10:12

1 Answer 1

0
$\begingroup$

You can actually simply assume that the Turing Machine will not move passed the leftmost symbol on the tape if the tape is infinite only on the right. So, you can just say that it will move its head to the left until you reach leftmost cell of the tape. See for example, Sipser's description in Introduction to the Theory of Computation:

If $M$ ever tries to move its head to the left off the left-hand end of the tape, the head stays in the same place for that move, even though the transition function indicates L.

Here $M$ is the Turing Machine and L indicates moving the head to the left.

In case you don't want this you can begin by shifting the contents of the tape one position to the right and put some kind of delimiter as the leftmost symbol. You can use a blank if in case you do not want to increase the number of tape symbols.

$\endgroup$
4
  • $\begingroup$ "it will move its head to the left until you reach leftmost cell of the tape": this is not specific enough. What will it do on a move left operation in that case? Will it be a no-op? In any case, it seems much more practical to assume a special symbol to mark the start of the tape. $\endgroup$ Commented Apr 19, 2023 at 11:23
  • 1
    $\begingroup$ @reinierpost, this is similar to how a reference like Sipser's book described such Turing Machine. To quote the book "If M ever tries to move its head to the left off the left-hand end of the tape, the head stays in the same place for that move, even though the transition function indicates L." (where M is the Turing Machine and L indicated moving its head to the left. $\endgroup$
    – Russel
    Commented Apr 19, 2023 at 12:58
  • $\begingroup$ another possibility is if you can increase the number of symbols but don't want to shift the contents, you can also add symbols for 0-at-left-end, 1-at-left-end, etc and the first step can overwrite the the first symbol with the -at-left-end version $\endgroup$ Commented Apr 19, 2023 at 15:00
  • $\begingroup$ This does in no way help to locate the beginning of the tape. If you keep moving left, you just start seeing the same symbol again and again, but you can't distinguish whether it's due to the head hitting the leftmost cell, or whether there are genuinely so many repetitions of the same symbol. You have to determine the beginning of the tape in some other way (e.g., marking it with a special symbol before starting the copying to the second tape). $\endgroup$ Commented May 14 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.