FAFL-Final-Lecture 33.1 TM INTRODUCTION
FAFL-Final-Lecture 33.1 TM INTRODUCTION
Lecture 33.1
Turing Machine(TM)
S c h o o l o f C o m p u t i n g a n d I n f o r m a t i o n Te c h n o l o g y
D r. P a r t h a s a r a t h y G
P a r t h a s a r a t h y. g @ re v a . e d u . i n
AY:2020-2021
OUTLINE
Recap of Previous Lecture
Lecture Discussion
•TM Introduction
• Understanding Tape storage
• Simple Examples
Deterministic Push Down Automata
Recap of Previous Lecture
RECAP OF PREVIOUS LECTURE
Course Description
• Push Down Automata to identify the language L={ WCW r |
W={a,b}*} that it accept or reject.
• Applications
• Summary
Turing Machine
To p i c o f t h e L e c t u r e
TOPIC OF THE LECTURE
• Introduction
Turing
Machine • Understanding TM
• Abstract Machine
Turing Machine
Objective and Outcome of Lecture
OBJECTIVE AND OUTCOME OF LECTURE
Read-Write head
Control Unit
THE TAPE
...... ......
Read-Write head
Read-Write head
1. Reads a symbol
2. Writes a symbol
3. Moves Left or Right
Example:
Time 0
...... ......
a b a c
Time 1
...... ......
a b k c
1. Reads a
2. Writes k
3. Moves Left
Time 1
...... ......
a b k c
Time 2
...... ......
a f k c
1. Reads b
2. Writes f
3. Moves Right
THE INPUT STRING
...... ......
a b a c
head
Read Write
Move Left
q1 a b, L q2
Move Right
q1 a b, R q2
Example:
Time 1
...... ......
a b a c
q1
current state
q1 a b, R q2
Example:
Time 1
...... ......
a b a c
q1
Time 2
...... ......
a b b c
q2
q1 a b, L q2
HALTING
...... ......
a b a c
q1
q1 No transition from q1
HALT!!!
TURING MACHINE EXAMPLE
Input alphabet {a , b }
, L
q0 q1
Time 0 a a a
q0
a a, R
, L
q0 q1
Time 1 a a a
q0
a a, R
, L
q0 q1
Time 2 a a a
q0
a a, R
, L
q0 q1
Time 3 a a a
q0
a a, R
, L
q0 q1
Time 4 a a a
q1
, L
q0 q1
Rejection Example
Time 0 a b a
q0
a a, R
, L
q0 q1
Time 1 a b a
q0
No possible Transition
Halt & Reject
a a, R
, L
q0 q1
A function may have many parameters:
f ( x, y ) x y
Integer Domain
Decimal: 5
Binary: 101
Unary: 11111
A function f is computable if
M
there is a Turing Machine such that:
q0 qf
initial state accept state
x, y are integers
Turing Machine:
Start B 1 1 1 0 1 1 B
q0
initial state
Start B 1 1 1 0 1 1 B
q0 initial state
x y
Finish B 1 1 1 1 0 B
qf final state
Turing machine for function f ( x, y ) x y
1 1, R 1 1, R 1 1, L
B B, L
q0 0 1, R q1 q2 1 0, L q3
B→B,R
q4
35
Execution Example: Time 0
x y
x 11 (=2)
B 1 1 0 1 1 B
y 11 (=2) q0
Final Result
x y
B 1 1 1 1 0 B
q4
Block Diagram
Turing
input output
Machine
DISCUSSION
5 MINUTES
TM is Decidable?