1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Have your searched "online Turing machine simulator"? Select one that suits you and try it. $\endgroup$ – Apass.Jack Nov 12 '18 at 19:09
1
$\begingroup$

Here is one way to approach this problem. Program a machine that acts as follows:

  • 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.
$\endgroup$
0
$\begingroup$

Honestly, this is going to be painful. The Turing machine probably has an uncomfortably large number of states.

The best way to proceed would be to write out an algorithm in pseudocode. Then iteratively rewrite it so that the steps of the pseudocode look more and more like steps of a Turing machine. Then implement it formally as a Turing machine.

Actually, I tell a lie. The best way to proceed would be to not produce this Turing machine at all. If it's an exercise that you have been set, it's a terrible exercise because it's impossible to do without making mistakes and impossible to mark. If it's an exercise that you've decided to do yourself, I suggest doing something else, because this one won't teach you much at all. Maybe design a Turing machine for the decision version of this problem.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.