Using a Turing machine. If the input tape of the machine consisted of a string of 0’s and 1’s, how would you approach the problem given that the output of the machine should be 1 or 0 respectively depending if it’s a palindrome or not.
I’m really struggling to get my head round the idea.
Any guidance is much appreciated.
I tried working out the idea in my head and on paper for example:
1, 0, 1, 0, 1
I would start at 1 in state “start” and then check the symbol. In this example, the symbol is 1, so I would set the symbol to a new “marked” symbol and move to the right in a new state called “compare_right_1”, in this state the machine would reach the end and read a blank symbol and hence reach the end of the tape, so move left and check the symbol for a 1, if the symbol is a 1 then move to the next space on the left, if not then quit as its not a palindrome.
I’m not sure if this is the right approach.
Meatabix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.