Turing machine for copying data

Prerequisite – Turing Machine 
Problem – Draw a Turing machine which copy data. 

Example – 

 

Steps: 
 



  • Step-1. First convert all 0’s, 1’s into 0’s, 1’s and go right then B into C and go left 
     
  • Step-2. Then convert all 0’s, 1’s into 0’s, 1’s and go left then 
     
  • Step-3. If 1 convert it into X and go right convert all 0’s, 1’s into 0’s, 1’s and go right then convert C into C and go right then convert all 0’s, 1’s into 0’s, 1’s and go right then convert B into 1 and go left then convert all 0’s, 1’s into 0’s, 1’s and go left then convert C into C and go left then convert all 0’s, 1’s into 0’s, 1’s and go left then convert all X into X and go right and then repeat all the process from step-2 till end 
     
  • Step-4. If 0 then convert it into Y and go right then convert all 0’s, 1’s into 0’s, 1’s and go right then convert C into C and go right then convert all 0’s, 1’s into 0’s, 1’s and go right then convert B into 0 and go left then convert all 0’s, 1’s into 0’s, 1’s and go left then convert C into C and go left then convert all 0’s, 1’s into 0’s, 1’s and go left then convert all Y into Y and go right and then repeat all the process from step-2 till end 
     
  • Step-5. Otherwise if C found convert it into C and go left then convert all X into 1 and Y into 0 and go left then convert B into B and go right and stop the machine. 
     

 

Turing machine for copying data

Here, q0 shows the initial state and q1, q2, ….., q9, q11are the transition states and q12shows the final state. 
And 0, 1 is the data inside a machine and X, Y, C are the variables used for copy data and R, L shows right and left.
 

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



Improved By : NityamAgarwal