2022-04-23 13:26:53 +01:00
|
|
|
---
|
|
|
|
tags:
|
2022-09-06 15:44:40 +01:00
|
|
|
- theory-of-computation
|
2024-09-13 19:00:03 +01:00
|
|
|
- Turing
|
2022-04-23 13:26:53 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
## What is a Turing Machine?
|
|
|
|
|
2024-09-13 19:00:03 +01:00
|
|
|
Turing Machine is a machine that contains mutable state, executes sequences of
|
|
|
|
simple instructions that read and write that state, and can pick different
|
|
|
|
execution paths depending on the state (via conditional branch instructions.)
|
2022-04-23 13:26:53 +01:00
|
|
|
|
2024-09-13 19:00:03 +01:00
|
|
|
This is a general expression, it is typically expanded as follows.
|
|
|
|
|
|
|
|
The machine consists of an infinitely long tape, that has been divided up into
|
|
|
|
cells. Each cell can contain either a 1, a 0 or an empty space. Above one cell
|
|
|
|
of the tape is a head, which can either move left or right, and can read the
|
|
|
|
symbols written in the cells. The head is also capable of erasing symbols and
|
|
|
|
writing new symbols into the cells.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
The direction that the head moves, which values it erases, and which values it
|
|
|
|
writes in, are dependent on a set of instructions provided to the machine.
|
2022-04-23 13:26:53 +01:00
|
|
|
|
2024-02-02 15:58:13 +00:00
|
|
|
Different sets of instructions can be divided into **states.** States are like
|
|
|
|
sub-routines and can themselves feature as part of instructions.
|
2022-04-23 13:26:53 +01:00
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
### State 2
|
|
|
|
|
2022-09-06 15:44:40 +01:00
|
|
|
- If 0 then erase
|
|
|
|
- Write 1 then move right
|
|
|
|
- Go to state 5
|
2022-04-23 13:26:53 +01:00
|
|
|
|
|
|
|
### State 5
|
|
|
|
|
2022-09-06 15:44:40 +01:00
|
|
|
- If 1, then erase
|
|
|
|
- Write 0 then move left
|
|
|
|
- Go to state _n_
|
2022-04-23 13:26:53 +01:00
|
|
|
|
2024-02-02 15:58:13 +00:00
|
|
|
Alan Turing proved that **any problem that is computable** can be computed by a
|
|
|
|
Turing Machine using this simple system.
|