It took me the whole month to solve this problem, as I got it from the book one of exercise, and I'd love to know how to write this in a turing machine; I would really love to learn this. Please could anyone offer a help?
Consider the last two letters of your login (if both letters are the same, please pick the next letter in the Latin alphabet as your second symbol). Write a Turing Machine that will recognise the language Stretch(x+1). This is the language of all strings that contain a continuous string of occurrences of the two letters, followed by ‘*’, followed by another string of letters with x+1 occurrences of the each letter where there was a single occurrence in the first string of letters. Here, x = 1. Input to the machine is non-null strings of a, b, *. As an example, where the letters are ‘a’ and ‘b’ (and x=1) aba*aabbaa, bb*bbbb and baab*bbaaaabb are in the language, but abb*abbb is not. You may assume that you have subroutines for writing 0 in the first cell and deleting the rest of the tape and for writing 1 in the first cell and deleting the rest of the tape.
I would totally appreciate it if you could help me.