A Turing machine takes a tape with some alphabet that the computer can read (to keep it simple, let’s just say the alphabet is 0 and 1). The computer reads the first number on the tape. The computer has already been told that if the first number is a 1, it’ll change it to a 0 and move on to the next number. The computer has also been told though that if the number is a 0, to just leave it alone and move on to the next number. Then it gets to the next number and in this position, the computer is told to turn it into a 1 if it’s 0 and leave it alone if its already 1. Then it goes on to the next position and so on and so on. Basically, it’s encoded with 3 bits of information for each position it’s looking at: consider what tape says, change it, move forwards or backwards on the tape. That is all a Turing machine is, but you can describe any modern day computer through a Turing machine (it’d just be a *very* complicated Turing machine).
[Here is an example of a Turing machine that can add in binary](https://i.imgur.com/ml3bVRZ.jpg) (note that this uses a 6 letter alphabet, 0, 1, A, B, X, and Y, to keep it simpler). The starting tape would look like B[first number in binary]A[second number in binary]B (e.g. B1010A110B). You start at Q0 in the top left and just follow the arrows to the next state based on what letter was changed. Once you get to Q67, you’re done. In the bottom-left, you’ll see what it looks like for the example tape B1010A110B to go through the whole machine.
Latest Answers