Assignment 4. Turing Machines


Due Thursday, November 4, 2021, midnight

Problem 1 - Calculating Remainders

Write the program for a Turing machine M%3 that computes the remainder of its input when divided by 3. Given, for example, an input tape containing the number 8:

executing M%3 should leave the number 2 on the tape, because 2 is the remainder of 8 when divided by 3.

Problem 2 - Duplicating a number

Implement a Turing machine Mcopy that copies an input value on the tape, leaving two identical values on the output separated by a single 0. Thus, if the input tape is:

the final configuration should be