Consider function $q$: For any even integer $x\ge0$ (including $0$): $q(x) = 4x$
I want to design a machine (on paper of course) to compute q under the Tally system. Another restriction is that when the input is odd number, the machine should not halt.
I decided to put this into programming (C++) then conclude the logic there, but the machine can not have any while loops, however; the machine can go to left right and write 0 or 1 on the paper. The paper is basically an infinite tape with boxes, each box is counted as one place that can hold one value $(x, 0, 1)$.
Any one knows how to solve this problem or possibly give me a suggestion to put me on right track?
First, you must choose a method of read input.
For example: in low level Turing Machine(DTM), you can choose unary method of read input, for example if 11111 is written on tape of DTM it means number 5 and 11 for 2.
Second, you must choose a method of write output.
For example: In end of your program, every thing written in your tape of DTM(in unary method) it means your output(in unary method).
Now, write this program: