Accepts strings of the form xww^ry, where |x| >= |y|. The input alphabet is {a,b}. Method: Find the middle of the string, then move right looking for pairs of the form aa or bb (!). We find the middle of the string by alternately marking a's and b's on the left and on the right until the two sequence of markings meet in the middle -------------------------------------------------- (0ax1r state 0: left side of the a,b string is marked (0by1r state 1: move to right end of the a,b string (1aa1r (1bb1r (1 2l state 2: found the right end of the a,b string, (1xx2l mark of the rightmost a or b. (1yy2l (2ax3l state 3: move to left end of the a,b string. (2by3l (3aa3l (3bb3l (3xx0r found the left end of the a,b string. Go back to state 0 (3yy0r (0xx4r no more a's or b's left to mark. (0yy4r (2xx4r (2yy4r State 4: The a,b string is completely marked. We are at the middle of the string. Now go right looking for aa or bb pair, namely, an xx or yy pair... (4xx5r state 4: read a first symbol (5xx9r state 5: read a consecutive x. done. (4yy6r (6yy9r state 6: read a consecutive y. done. (5yy4r not a consecutive pair. Try for the next pair (6xx4r (4 8r state 8: there are no consecutive pairs. (8cc8r -- non final state. This is never executed.