Lecture 2 - Turing Machines
Still in preparation. Please check the references at the end of the document.
Turing Machines
A Turing machine is a mathematical model of computation that is used to model a general-purpose computer.
The Turing machine model uses an infinite tape as its memory. This tape is divided into cells, each of which can contain a symbol from a finite set of symbols called the tape alphabet. The tape is infinite in both directions, but only finitely many cells contain non-blank symbols.
The machine has a tape head, which is always positioned over one of the cells, and the machine can read and write symbols on the cell where the head is, and can move the head left or right of its current position along the tape.
We are now ready to define a Turing machine more formally.
Definition 1: A deterministic, one-tape Turing machine is described by a
-
is a finite set of internal states, where is the start state, is the accept state, and is the reject state. -
is a finite set of tape symbols, also known as the tape alphabet, where is the blank symbol. -
is the transition function.
Note that in the above definition the states
Also note that in the above definition, the machine is deterministic, meaning that for each internal state and tape symbol, there is exactly one transition that the machine can make.
Definition 2: the configuration of a Turing machine
is the content of the tape. is the current internal state of the machine.- The tape head is positioned on the leftmost symbol of
.
The start configuration of
A configuration
Now that we have defined configurations, we can talk about how a Turing maching will change from one configuration to another.
Definition 3: For any strings
We say that a Turing machine
is the start configuration of on input . is a halting configuration with .- For each
, is obtained from by applying the transition function .
Similarly, we say that
The collection of strings that
Definition 4: A language
Now, it is possible that a Turing machine does not halt on some inputs. This behaviour is denoted by looping. A machine may not halt (i.e. may loop) because of simple or complex behavior, which never reaches a halting state. (For example, a machine which enters an “infinite loop,” in the sense that you are used to.)
Acknowledgements & References
This lecture was based on these resources:
- Lecture notes by Prof. Eric Blais.
- [S13, Chapter 3]