Turing Machine

Turing Machine Java Applet

Turing Machine Java Applet

@


What's Turing Machine?

Turing Machine is a first concept of a computer that was invented by Alan Turing in 1936.


How to Use This Applet?

In the beginning, You can give preloaded or your original program by choosing it in Choice Box. Or push Edit button to open an Edit window, then you may type in program in the text box. To start running the Turing Machine , push Run button and let Turing Machine begin processing your program. The Turihng Machine paints blue or white on the tape as a result.


Meaning of a Command

A command made up from 5 steps of actin.

State of the Turing Machine

The Turing Machine has a state which is represented by a number. The initial state is 1. The state can change through processing command which is specified to do so.

Step 1 : Read the Tepe Color

One command consists of 5 words. First word refer to state of the Turing Mahcine. The Turing Machine searches a command which has a number same as the current machine's state.

Step 2 : Consult Command

Second word is B or X. B means blank. X means colored. The Turing Machine chooses appropriate command by looking at first and second words. It compares the color of tape and color in the commands to pick out candidates, this is not necessarily to be one.

Let's look at this program.

AddOne :
{
<1XX1R>,
<1BX2R>

}

This Program is a default program which is initially loaded. Push run button, then, the Turing Machine reads the tape color and recognises it's white.

Then it seeks a command start from 1 which is same as current machine's state. Note that the initial state of Turing Machine is 1.

Now candidates are <1XX1R> and <1BX2R>.

Next, it chooses a command which has second word as same color as tape color white , and is at same position of the machine.

The machine will choose <1BX2R> from the two of candidates.

Step 3 : 3rd word is B or X. X means paint the tape (to blue). B is word to erase the color ( paint to white). In this example, the third word is X meaning that it paints tape blue.

Update State

Step 4 is a number next state to be. The Turing Machine updates it's state to this number.

Move

Step 5 : is direction to move right or left. When the Turing Machine reads R, it moves to right. Otherwise, it reads L, it moves to left.

The Turing Machinees repeats these steps untill it can't find appropriate command or can't move.


Note

When you type a command in Edit Window. You can write comments after double slash "//" as comment line just like C++. Format of the command must follow like this

// This is comment

Name : { <1stWord, 2ndWord, 3rdWord, 4thWord, 5thWord>, <...>, ...}

"Name" is a name of the program. It can be any word.

':' between "Name" and '{' is necessary.

"{ ~}" program should be written between this grouping.

"<~>" each command should be located within these bracket.

"," each command should be devided by a comma.


return to the top