In: Computer Science
Assume set of input alphabets = {a, b} If last digit = 0, 1, 2 OR 3 Solve the following Design and Turing Machine that Accepts only odd length palindromes and rejects all the remaining strings If last digit = 4, 5 OR 6 Solve the following Design and Turing Machine that Accepts only even length palindromes and rejects all the remaining strings If last digit = 7, 8 OR 9 Solve the following Design and Turing Machine that Accepts palindromes (both even and odd length) and rejects all the remaining strings
Construct a TM machinefor checking thepalindrome of the string ofodd length. Solution: Firstly we read the first symbol from left and then we compare it with the first symbol from right to check whether it is the same. Again we compare the second symbol from left withthe second symbol from right.
Firstly we read the first symbol from left and then we compare it with the first symbol from right to check whether it is the same.
Again we compare the second symbol from left with the second symbol from right. We repeat this process for all the symbols. If we found any symbol not matching, we lead the machine to HALT state.
Suppose the string is 00100Δ. The simulation for 00100Δ can be shown as follows:
Now, we will see how this Turing machine will work for 00100Δ. Initially, state is q0 and head points to 0 as: