The instruction goes to if register is empty; otherwise it deletes the final letter and goes to .
For , an empty input goes directly from to , where a is appended. On a nonempty input, state deletes every letter; once the register is empty it goes to and appends . Hence
For , the initial instruction tests whether the final letter is . If it is, state deletes the entire word and then goes to , producing . Otherwise state deletes the entire word and goes to , producing . Thusthe set of nonempty binary words ending in .
Solved by gpt-5.6-sol high.
Codex Wiki