I'm studying for a test on Turing machines, and I'm stuck with a problem in which I have to create a Turing Machine that serves as a function calculator for:
f(x,y) = x ^ y
I understand my tape input would come separated like this:
1's of base 0 1's of exponent
With my tape output being like
1's of base 0 1's of exponent 0 1's of the computed result
How would I go about placing X's and Y's on the tape(s)? (It can be a multi-tape machine) What would the state diagram look like?
Note: I'm using unary with 1 used to represent 0 and 0 used not as value but as a delimiter.
So:
0 = delimiter
1 = 0
11 = 1
111 = 2
1111= 3
11111= 4
etc.
I'm guessing a bit here, it's been a little while since I played with Turing machine simulators. First of all, I would want to divide the task up into several conceptual steps:
To perform a task repeatedly N times, put N onto the tape, perform the task once, then subtract 1 from the end of the number N. Repeat until the number N is gone from the tape.
Hopefully this is sufficient to get you started anyway. The state machine can be constructed more or less mechanically in this fashion.