The Turing Machine Presentation TOA
The Turing Machine Presentation TOA
TURING
MACHINE
Sameer Ahmad
The big question behind Turing
Machine
Is there any step-by-step way to determine if a logical statement is
true or false??
Tape
_ 0 1 0 0 0 1 0 _ _
Head
State Diagram
Machine as Tuples
q_r q_a
Let’s solve a problem
0/0,L 0/1,L
1/1,L
_ 0 1 0 0 0 1 0 _ _ q0 q1
1/0,
L
_/_,N
_/_,N
Current State: q1
q_r q_a
Let’s solve a problem
0/0,L 0/1,L
1/1,L
_ 0 1 0 0 1 1 0 _ _ q0 q1
1/0,
L
_/_,N
_/_,N
Current State: q1
q_r q_a
Let’s solve a problem
0/0,L 0/1,L
1/1,L
_ 0 1 0 1 1 1 0 _ _ q0 q1
1/0,
L
_/_,N
_/_,N
Current State: q1
q_r q_a
0/0,L 0/1,L
q_a
Current State: q1
Let’s solve a problem
0/0,L 0/1,L
1/1,L
_ 0 0 1 1 1 1 0 _ _ q0 q1
1/0,
L
_/_,N
_/_,N
Current State: q1
q_r q_a
Let’s solve a problem
0/0,L 0/1,L
1/1,L
_ 1 0 1 1 1 1 0 _ _ q0 q1
1/0,
L
_/_,N
_/_,N
Current State: q1
q_r q_a
0/0,L 0/1,L
q_a
Current State: q_accept (HALT)
0/0,L
State Diagram as Table
0/1,L
1/1,L
q0 q1
1/0,L
_/_,N
_/_,N
q_r q_a
q0 q0 0 L q1 1 L q_r _ N
q1 q0 1 L q1 0 L q_a _ N
State Diagram as Input
State Input:0 Input:1 Input:_
Next Write Move Next Write Move Next Write Move
State State State
q0 q0 0 L q1 1 L q_r _ N
q1 q0 1 L q1 0 L q_a _ N
0 0 0 0 L, 0 1 1 1 L, 0 _ R _ N, 1 0 1 1 L, 1 1 1 0 L
The Halting Problem
A Universal Turing Machine can take the machine states and its tape contents as its
input.
Suppose, we build a machine, that takes any machine M and its tape x as input.
Then, tells in finite time, if the machine will halt or not.
Machine
M
Tape x
New Machine
Now, we make a machine D that uses the Halt Checker machine. If it
Machine
Yes / No
M
Halts
Halt Checker No
Operation
Tape x Yes
Loops
Foreve
Machine D r
Machine as Input
What if the Machine D itself is given as input to Machine D, and the Machine D as its tape content.
Machine
Yes / No
D
Halts
Halt Checker No
Machine Operation
D Yes
Loops
Foreve
Machine D r
Contradiction
Such as machine is never possible. So, we can never tell in finite time for all machines, if they will halt
or loop forever.