Assignment 7

Nils Anders Danielsson

  1. (5p) Define a (deterministic) Turing machine over the alphabet {0, 1, 2} that always halts and accepts the language {0n1n2n | n ∈ } (which is not context-free).

    You are not obligated to provide a proof that the Turing machine is correct. However, note that (for a typical model of computation) there is no algorithm for checking whether an arbitrary Turing machine halts, or whether it accepts a specific recursively enumerable language. You should give enough explanation so that the person correcting your submission can easily see that your answer is correct.

    Make sure that the Turing machine handles all kinds of strings over {0, 1, 2}, not just those matching the regular expression 0*1*2*.

    If you want to test your Turing machine, then you can for instance use Anthony Morphett’s Turing machine simulator. If you use this simulator, please consider submitting the source code that you use so that the person grading your submission can also make use of it.