Session 1: The Turing Machine Model, Language accepted by Turing machine�Session 2: Design of TM
By
Dr. Ashok Kumar
Amity School of Engineering & Technology
�The Turing Machine Model, Language accepted by Turing machine�
Amity School of Engineering & Technology
Introduction
Amity School of Engineering & Technology
The Language Hierarchy
Regular Languages
Context-Free Languages
?
?
Amity School of Engineering & Technology
Regular Languages
Context-Free Languages
Languages accepted by
Turing Machines
Amity School of Engineering & Technology
Formal Definition
Turing Machine:
States
Input
alphabet
Tape
alphabet
Transition
function
Initial
state
blank
Final
states
Amity School of Engineering & Technology
Transition Function
Amity School of Engineering & Technology
Transition Function
Amity School of Engineering & Technology
A Turing Machine
......
......
Tape
Read-Write head
Control Unit
Amity School of Engineering & Technology
The Tape
......
......
Read-Write head
No boundaries -- infinite length
The head moves Left or Right
Amity School of Engineering & Technology
......
......
Read-Write head
The head at each time step:
1. Reads a symbol
2. Writes a symbol
3. Moves Left or Right
Amity School of Engineering & Technology
......
......
Example:
Time 0
......
......
Time 1
1. Reads
2. Writes
3. Moves Left
Amity School of Engineering & Technology
......
......
Time 1
......
......
Time 2
1. Reads
2. Writes
3. Moves Right
Amity School of Engineering & Technology
The Input String
......
......
Blank symbol
head
Head starts at the leftmost position
of the input string
Input string
Amity School of Engineering & Technology
States & Transitions
Read
Write
Move Left
Move Right
Amity School of Engineering & Technology
Example:
......
......
Time 1
current state
Amity School of Engineering & Technology
......
......
Time 1
......
......
Time 2
Amity School of Engineering & Technology
......
......
Time 1
......
......
Time 2
Example:
Amity School of Engineering & Technology
Determinism
Allowed
Not Allowed
No lambda transitions allowed
Turing Machines are deterministic
Amity School of Engineering & Technology
Halting
The machine halts if there are
no possible transitions to follow
Amity School of Engineering & Technology
Example:
......
......
No possible transition
HALT!!!
Amity School of Engineering & Technology
Final States
Allowed
Not Allowed
Amity School of Engineering & Technology
Acceptance
Accept Input
If machine halts
in a final state
Reject Input
If machine halts
in a non-final state
or
If machine enters
an infinite loop
Amity School of Engineering & Technology
Turing Machine Example
A Turing machine that accepts the language:
Amity School of Engineering & Technology
Another Turing Machine Example
Turing machine for the language
Amity School of Engineering & Technology
Another Turing Machine Example
Turing machine for the language
q0
q1
q2
q3
a🡪x, R
a🡪a, R
b🡪y, R
b🡪b, R
c🡪z, L
z🡪z, L
b🡪b, L
y🡪y, L
a🡪a, L
q4
q5
y🡪y,R
y🡪y,R
z🡪z,R
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology
Amity School of Engineering & Technology