Turing Machines
- Backgroud of the turing machine
- In the early twentieth century, mathematicians were trying to find a universal machine a mathematical model that consisted of a small number of basic operations and a machine that could perform all these operations.
- The machine would then be able to run any algorithm.
- This model would be a precise definition of the term algorithm.
- The hope was to find algorithms that would be able to solve all mathematical problems.
- Solvable and unsolvable problems
- In 1930, Kurt Gödel showed that there are mathematical statements that it will never be possible to either prove, or disprove.
- Alan Turing then showed that it would not be possible to write an algorithm which could determine if a given mathematical problem (or computer program) was solvable, or unsolvable
- Alan Turing was a British Mathematician who, in 1936, wrote a paper called ‘On Computable Numbers’.
- This paper introduced the concept of the Turing machine – a universal machine capable of solving any problem that can be represented algorithmically.
- He used his machine to show that it is not possible to determine if any given problem has a solution, or not. This has serious implications in computing. It means that it may not always be possible to determine if a particular problem is unsolvable, or if it has just not been solved yet.
- How this relates to Computers
- The work done by Turing on mathematical models was the basis from which the first computers were developed.
- It can be shown that anything a modern computer can do can be represented using a Turing machine.
- Turing machine
- A Turing machine consists of
- An input alphabet.
- A tape that is infinitely long.
- An output alphabet that can be printed on the tape.
- A tape head that is used to read/write to the cells.
- A finite set of states, including a start state.
- A program (set of instructions).
- Another way of looking at this is that a Turing machine consists of a deterministic finite state machine together with an infinitely long tape.
- How this relates to Computers
- A Turing machine describes an algorithm.
- A computer uses a computer program that is basically an algorithm.
- Turing machines therefore can be used to run and look at algorithms independent of the architecture of a particular machine.
- An algorithm running on a particular machine will have had to make decisions about how to store values (e.g. the precision of how to store a real number).
- This does not happen on a Turing machine, meaning a Turing machine is a more general representation of the algorithm.
- Universal Turing Machine
- Turing also realised that a Turing machine itself could be encoded and given as an input to another Turing machine.
- This Universal Turing Machine was capable of solving any problem that can be represented as an algorithm.
- Transition Rules
- Transition Rules in a Turing Machine can be represented like this :
- δ(1,1)=(2,1,→)
- Transition Function(Current State, Input Symbol) = (Next State, Output Symbol, Movement)