# Turing machine to output enumeration of a language

I am trying to write a Turing machine enumerator that enumerates the language where $$w = 0^n1^n$$ and $$n ≥ 0$$.

So for example it should output the following to the first tape: e,#,0,1,#,0,0,1,1,#,0,0,0,1,1,1 etc.

Here e means empty, i.e., to leave that index blank.

I can't figure out how to display this as a Turing machine with states and transitions.

• Have your searched "online Turing machine simulator"? Select one that suits you and try it. – John L. Nov 12 '18 at 19:09

• Initialize the tape with $$\#01$$ (or $$\epsilon\#01$$).
• At each step, write $$\#$$, then go back to the previous $$\#$$ and copy the string written there, say $$0^n1^n$$.
• Change the first $$1$$ to a $$0$$, add two $$1$$s at the end, and go to the next step.