You are on page 1of 22

Turing Machines

Turing Machine

A Turing machine is a device that manipulates symbols on a strip of tape according to a table of rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any computer algorithm, and is particularly useful in explaining the functions of a CPU inside a computer. The "Turing" machine was described by Alan Turing [in 1936] who called it an "a(utomatic)-machine". The Turing machine is not intended as a practical computing technology, but rather as a hypothetical device representing a computing machine. Turing machines help computer scientists understand the limits of mechanical computation.

Turing machine

A Turing machine is the simplest form of a computer. This was the first computer invented (on paper only).

Principles of a Turing machine

A Turing machine consists of: A tape which is divided into cells, one next to the other. Each cell contains a symbol from some finite alphabet. The alphabet contains a special blank symbol (here written as 'B') and one or more other symbols. The Turing machine is always supplied with as much tape as it needs for its computation. Cells that have not been written to before are assumed to be filled with the blank symbol. In some models the tape has a left end marked with a special symbol; the tape extends or is indefinitely extensible to the right.

A head that can read and write symbols on the tape and move the tape left and right one (and only one) cell at a time. In some models the head moves and the tape is stationary.

A finite table (occasionally called an action table or transition function) of instructions (usually quintuples [5-tuples] : qiajqi1aj1dk, but sometimes 4-tuples) that, given the state(qi) the machine is currently in and the symbol(aj) it is reading on the tape (symbol currently under the head) tells the machine to do the following in sequence (for the 5-tuple models): Either erase or write a symbol (instead of aj, write aj1), and then Move the head (which is described by dk and can have values: 'L' for one step left or 'R' for one step right or 'N' for staying in the same place), and then Assume the same or a new state as prescribed (go to state qi1).

Function Of Turing Machine

1.

2.

3. 4.

A Turing machine can both write on the tape and read from it. The read-write head can move both to the left and to the right. The tape is infinite. The special states for rejecting and accepting take immediate effect.

A Thinking Machine e.g Successor Program

Sample Rules:

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!

Lets see how they are carried out on a piece of paper that contains the reverse binary representation of 47:
6

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 0 1

A Thinking Machine EG Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 0 1

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 0 1

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 0 1

10

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 0 1

11

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 1 1

12

A Thinking Machine e.g Successor Program

So the successors output on 111101 was 000011 which is the reverse binary representation of 48. Similarly, the successor of 127 should be 128:

13

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 1 1 1

14

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 1 1 1

15

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 1 1 1

16

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
1 1 1 1

17

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 1 1 1

18

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 0 1 1

19

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 0 0 1

20

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 0 0 0

21

A Thinking Machine e.g Successor Program

If read 1, write 0, go right, repeat. If read 0, write 1, HALT! If read , write 1, HALT!
0 0 0 0 1

22

You might also like