# Turing Machine construction of M=wwRw form

Construct a Turing machine for M = {wvw| v, w ∈ {a, b}*, reversal(v) = w}.

I tried to imagine that I will have to divide the string into 3 equal parts and check if the first and last part are identical, and that first two parts form a palindrome. But not sure how to proceed with this to construct the turing machine.

So, I can grant that your idea is right. Divide the string into 3 equal parts; for example, if you have aabbaaaab, divide the strings like this: aab baa aab. In case it isn't possible, directly reject it. Otherwise for the next step, check if the concatenation of the first two substrings forms a palindrome; if it doesn't, stop and reject, but if so, then proceed further. In the last step, just check if the first and last substrings match, if so, accept, else reject. With all these in mind, the following should work: