Question: Please Complete This In Java Please attach a txt file which implements a Turing Machine that computes f(x) = x 2 for all x 1.

Please Complete This In Java

Please attach a txt file which implements a Turing Machine that computes f(x) = x2 for all x 1. Examples of input/output for this machine: a) if input is B 1 1 B then output should be B 1 1 1 1 B b) if input is B 1 1 1 B then output should be B 1 1 1 1 1 1 1 1 1 B c) if input is B 1 B then output should be B 1 B

In each case, the machine should halt with the tape head reading the B immediately to the left of the output.

Hints:

1) You should use the following two files: duplicate x.txt <---this file begins with BxB and ends with BxBxB where x is any string of 1's, and x 1; x1 TIMES x2.txt <---this file begins with Bx1Bx2B and ends with ByB where y = x1*x2, and both x1 and x2 are x 1.

2) You have to "splice together" the above two files;

3) In order to splice these together, you have to re-number the quadruples in the second machine above in such a way that where 'duplicate x' ends, 'x1 TIMES x2' begins.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!