# Describe a turing machine that accepts Language L = {www| w is {a,b}*}

I know that for the language ww, the TM can zig zag across the tape and match symbols to see if the strings are equivalent by first finding the midpoint of the string. However I am lost on how the TM can find out where in www the repeated strings start and stop. I can find midpoint but how do I get one third or two thirds of the string. Any tips to get me started?

Let $$\ell$$ be the length of the input. You can assume w.l.o.g. that $$\ell=3k$$ for some integer $$k$$. If this is not the case (which can be easily checked by your TM), then the answer is trivial.
The problem boils down to finding $$k$$. In order to do so you can use the following strategy:
3. If the cell immediately to the right of the current head position is marked, then you are done since the head must be in position $$k$$. Otherwise, repeat from step 1.