I'm trying to compute a language defined as { ww | w ∈ {0,1}* } in JFlap using a Multitape Turing Machine. It seems a hard problem because there is no delimiter to know when the word w
is ended.
I already checked this and this question, but this didn't helped me at all. The answers from "Construct Turing Machine which accepts the language $ww$" talks about deterministic machines and one answer just cite non-deterministic, but dont give details on how this design can be achieved for the given problem.
I've found this algorithm, but this seems very confusing for me (I don't understand the first stage (for example), so I can't reproduce this answer at JFlap).
// Stage 1: Check length is even, change as / bs to As / Bs
while a or b {
change a to A or b to B & move R
while a or b move R
move L
change a to A or b to B & move L
while a or b move L
if A or B move R
}
// Stage 2: Change As and Bs in first half to as and bs
if Blank halt
if A or B move L
while A or B change to a or b & move L
if Blank move R
// Stage 3: Compare first and second halves
while true {
if a {
change a to A & move R
while a or b or Blank move R
change A to Blank & move L // fail if B
while a or b or Blank move L
if A or B move R
} else if b {
... similarly ...
}
}
if Blank halt
Can someone clarify this question to me? How can I achieve the first stage in a multitape Turing machine? How can I proceed to solve the problem?
P.S: It must be a multitape Turing machine.