You are on page 1of 12

Turing Machines

K Vipin
19/04/2016
Alan Turing

• Father of computer science


• PhD at the age of 26
(Systems of Logic Based on Ordinals) 
• Famous for breaking enigma
code
• Persecuted and suicided in 1954
• Turing Award  “Nobel Prize of Computing”

2
Turning Machines

• Mathematical model of a computer


• Infinite memory (in the form of a tape)
• (i) move the tape left one square, (ii) move the
tape right one square, (iii) read a symbol, (iv) write
a symbol, (v) change state, (vi) halt. 
Binary Counter

State Symbol Read Write Move Next State


State 0 Blank Blank Tape right State 1
0 0 Tape left State 0
1 1 Tape left State 0
State 1 Blank 1 Tape left State 2
0 1 Tape right State 2
1 0 Tape right State 1
State 2 Blank Blank Tape right Stop
0 0 Tape left State 2
1 1 Tape left State 2
Formal definition
• Σ  input alphabets (finite)
• Γ  tape alphabets Σ ⊂ Γ (b ∈ Γ special blank
symbol)
• Q  states. q0  initial state
• δ  Transition function
• δ : Q x Γ  Q x Γ x {L,R}
Turing complete
• A computer's instruction set or a programming
language is said to be Turing complete if it can be
used to simulate any single-taped Turing machine.
• Nearly every existing computer language is Turing-
complete
• This is why same programme you can write in
multiple languages
• But doesn’t every language is efficient in doing
everything
Decision Problem

Does there exist an algorithm for deciding whether


or not a specific mathematical assertion does or
does not have a proof ?
Halting Problem

• A problem is a yes/no question that we ask of a


particular input
• An algorithm is a solution to a problem
• guaranteed to always run in a finite amount of
time.
• A problem is decidable if it has a solution
• If there is no algorithm that solves the problem
in a finite amount of time, the problem
is undecidable.
Halting Problem

Programme

• Given a programme and an input will it ever


stop (halt).
Halting Problem

def would_it_stop(program,input):
if something_terribly_clever :
return True
else:
return False
Halting Problem

if would_it_stop(program,input):
while True:
pass
else:
return
Non-deterministic Turing machine
• In a deterministic Turing machine, the set of rules
prescribes at most one action to be performed for any
given situation
• a non-deterministic Turing machine (NTM) may have a
set of rules that prescribes more than one action for a
given situation

• δ : Q x Γ ⊂ Q x Γ x {L,R} No more a function but a


relation

You might also like