2

I am supposed to draw an enumerator for the language 0^k1^k (k>=0). I am not sure how that is different from building a Turing machine state diagram for this language: the way I understand it is that I need to build an enumerator that recognizes the aforementioned language given all strings above {0,1} by simulating the Turing machine that recognizes this language on string i for i steps, which I couldn't think how to do using a state diagram, but my teacher has pointed out that this is how we prove the equivalence between an enumerator and a Turing machine, so I thought that what we have to do is use the transition function defined for enumerators which makes the diagram look similar to the Turing machine that recognizes 0^k1^k, only instead of moving to qaccept we move to qprint for inputs in the language, and then for inputs that must be rejected we print epsilon? But how do we go about producing an infinite number of strings above the alphabet {0,1}? At the initial state the work tape and the print tape are empty. Can someone clarify these points for me? Maybe I misunderstand.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
Noona
  • 643
  • 1
  • 14
  • 30

3 Answers3

4

I think I finally have the enumerator notion clear, an enumerator is not supposed to read an input, it creates words in the language for which it is built: here's the algorithm:

  1. print epsilon on the output tape
  2. write 01 on the work tape
  3. go back to the front of the tape and copy its contents to the output tape
  4. go back to the leftmost 0, replace it with 1, go to the rightmost 1 and add two 1's at the end.
  5. go back to stage 3

alt text

Noona
  • 643
  • 1
  • 14
  • 30
1

i thought of another slightly different algorithm that produces a smaller number of states, and uses only {0,blank} on its work tape: alt text

Noona
  • 643
  • 1
  • 14
  • 30
0

i think you might have an error there. in stage 4, you wrote "go back to the leftmost 0, replace it with 1, go to the rightmost 1 and add two 1's at the end" i think it should be: "go back to the leftmost 1, replace it with 0, go to the rightmost 1 and add two 1's at the end"

barak
  • 25
  • 2