<<

CSE 460 Universal Turing and the Simulated Turing machine

You can think of a Turing Machine as a with CPU and memory. The CPU executes a set of instructions, and similarly TM executes a set of moves. Computer has a read/write memory, and similarly a TM has the read/write tape. Once you have defined a computer, you have fixed the instruction set and the set of input symbols. For example, 0’s and 1’s are the input symbols of a computer. Similarly, Once you have defined a TM, you have fixed the set of moves (transitions) and its input alphabet, Σ. For example, the is a Turing machine that can be defined by a fixed set of moves, and an alphabet, say, {0, 1}. If we think of CPU as a program, and its data is stored in main memory then we can run only one program (which is the CPU) against a different set of data in memory at different times. This is a severe limitation because the computer can run only one fixed program which is the CPU. Instead, the general computer model is to have the CPU simulate different programs in memory. Here, the program is stored as data to the CPU. Thus, the CPU can be thought of as a powerful program which simulates its data in memory as another program and this program’s data. This is achieved by using the input data of the CPU in main memory to encode a program and this program’s input data. However, this encoding has to be done with the allowed input symbols of the CPU, which are 0’s and 1’s if it is assumed that Σ = {0, 1}. Similarly, the universal TM can simulate other Turing using its own data as a TM and its input. This is just like the CPU simulating a program by using its own data. The simulated Turing machines are encoded by using the input symbols of the UTM, just like the programs are encoded by the input symbols of CPU. Note that the Universal Turing Machine is the only REAL Turing machine and its input is only a simulated TM. All the parameters of the simulated Turing machine have to be defined in terms of 0’s and 1’s. Now what is happening to the symbol ∆ representing the blank. Note the

1 symbol ∆ is not in Σ. This concept of space has to be there in any Turing machine because it is a part of the definition of the Turing Machine. Note that the concept of space has a special significance in TM because without it a TM may not be able to write to the right of the input on the tape. The interesting thing is that the Turing machine model is the same for the UTM and the Turing Machines that are simulated by the UTM. By model we mean that a TM has a set of moves, a fixed alphabet, a special symbol ∆, etc. Different Turing Machines correspond to different values for these parameters, such as, a different set of moves, a different alphabet set, etc. Coming back to the symbol ∆, the space has to be defined for every Turing machine. Since everything in the simulated Turing machine is encoded by 0’s and 1’s, space for the simulated Turing machine has to be encoded by 0’s and 1’s only. UTM stores it’s space by the symbol ∆ using only one square. The delta of the simulated Turing machine is encoded by a 0 which also takes one square of the input tape of the UTM. It also needs a 1 as delimeter for separation between this 0 and the next field. So it may actually take two squares. Thus we have two types of encoding for space, one for the UTM using the symbol ∆ and the other for the simulated TM requiring using the symbol 0 which is understood as space by the Universal Turing Machine. One model for placing the input on the tape of a TM is to start from square 1. Square 0 contains ∆. There are other models where input can start with square 0. Text book is using the first model, i.e. input starts from square 1. To be consistent with the text book, we will use the same convention as that of the text book. This means all Turing machines, UTM or simulated TM initially contains a space at square 0 of their input tape. However, we have to be a bit careful here. Where is simulated Turing machines input tape? This certainly depends on how the UTM is simulating the tape of the simulated TM. One model is shown in the text where it uses a second tape. UTM (assuming a 3-tape Turing machine) copies the encoded input from its input tape (first tape) onto a second tape (scratch pad of the 3-tape TM) starting with square 3. UTM places a 0 in square 1 and a 1 in square 2. The square 0 of tape 2 contains a space, ∆, of the UTM which by convention was there when the UTM started. All the rest of the squares (squares that are not taken up by the input) are filled with ∆’s of the UTM. Note that the space to the right of the input for the simulated TM is simulated by the UTM. e(T)e(w) is stored on the input tape(tape 1) of the UTM following square

2 0 which contains the symbol ∆. e(T) is the encoding of the simulated TM and e(w) is the encoding of the input of the simulated TM. Squares following e(T)e(w) on tape 1 are all ∆’s. The UTM before starting to simulate the moves of the simulated TM, copies the input e(w) into the second tape. Thus the second tape is actually being used to simulate the input tape of the simulated TM. blank in square 0 of the simulated Turing machine is stored in square 1 of tape 2.

3