SlideShare a Scribd company logo
Turing Machines
Invented by Alan Turing in 1936.
A simple mathematical model of a general
purpose computer.
It is capable of performing any calculation
which can be performed by any computing
machine.
The Language Hierarchy
*a
Regular Languages
Context-Free Languages
nn
ba R
ww
nnn
cba ww?
**ba
?
*a
Regular Languages
Context-Free Languages
nn
ba R
ww
nnn
cba ww
**ba
Languages accepted by
Turing Machines
Finite
Automata
NDPA
A Turing Machine
............
Tape
Read-Write head
Control Unit
The Tape
............
Read-Write head
No boundaries -- infinite length
The head moves Left or Right
............
Read-Write head
The head at each time step:
1. Reads a symbol
2. Writes a symbol
3. Moves Left or Right
............
Example:
Time 0
............
Time 1
1. Reads
2. Writes
a a cb
a b k c
a
k
3. Moves Left
............
Time 1
a b k c
............
Time 2
a k cf
1. Reads
2. Writes
b
f
3. Moves Right
The Input String
............
Blank symbol
head
a b ca
Head starts at the leftmost position
of the input string
Input string
Are treated as left and right brackets for the
input written on the tape.
States & Transitions
1q 2qLba ,
Read Write
Move Left
1q 2qRba ,
Move Right
Example:
1q 2qRba ,
............ a b ca
Time 1
1q
current state
............ a b ca
Time 1
1q 2qRba ,
............ a b cb
Time 2
1q
2q
............ a b ca
Time 1
1q 2qLba ,
............ a b cb
Time 2
1q
2q
Example:
............ a b ca
Time 1
1q 2qRg,
............ ga b cb
Time 2
1q
2q
Example:
Determinism
1q
2qRba ,
Allowed Not Allowed
3qLdb ,
1q
2qRba ,
3qLda ,
No lambda transitions allowed
Turing Machines are deterministic
Partial Transition Function
1q
2qRba ,
3qLdb ,
............ a b ca
1q
Example:
No transition
for input symbol c
Allowed:
Halting
The machine halts if there are
no possible transitions to follow
Example:
............ a b ca
1q
1q
2qRba ,
3qLdb ,
No possible transition
HALT!!!
Final States
1q 2q Allowed
1q 2q Not Allowed
• Final states have no outgoing transitions
• In a final state the machine halts
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
Turing Machine Example
A Turing machine that accepts the language:
*aa
0q
Raa ,
L,
1q
aaTime 0
0q
a
0q
Raa ,
L,
1q
aaTime 1
0q
a
0q
Raa ,
L,
1q
aaTime 2
0q
a
0q
Raa ,
L,
1q
aaTime 3
0q
a
0q
Raa ,
L,
1q
aaTime 4
1q
a
0q
Raa ,
L,
1q
Halt & Accept
Rejection Example
0q
Raa ,
L,
1q
baTime 0
0q
a
0q
Raa ,
L,
1q
baTime 1
0q
a
No possible Transition
Halt & Reject
Infinite Loop Example
0q
Raa ,
L,
1q
Lbb ,
baTime 0
0q
a
0q
Raa ,
L,
1q
Lbb ,
baTime 1
0q
a
0q
Raa ,
L,
1q
Lbb ,
baTime 2
0q
a
0q
Raa ,
L,
1q
Lbb ,
baTime 2
0q
a
baTime 3
0q
a
baTime 4
0q
a
baTime 5
0q
a
... Infinite Loop
Because of the infinite loop:
•The final state cannot be reached
•The machine never halts
•The input is not accepted
Another Turing Machine
Example
Turing machine for the language }{ nn
ba
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
ba
0q
a bTime 0
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
bx
1q
a bTime 1
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
bx
1q
a bTime 2
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
2q
a bTime 3
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
2q
a bTime 4
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
0q
a bTime 5
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
1q
x bTime 6
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
1q
x bTime 7
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx x y
2q
Time 8
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx x y
2q
Time 9
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
0q
x yTime 10
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
3q
x yTime 11
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
3q
x yTime 12
0q 1q 2q3q
Rxa ,
Raa ,
Ryy ,
Lyb ,
Laa ,
Lyy ,
Rxx ,
Ryy ,
Ryy ,
4q
L,
yx
4q
x y
Halt & Accept
Time 13
If we modify the
machine for the language }{ nn
ba
we can easily construct
a machine for the language }{ nnn
cba
Observation:
Formal Definitions
for
Turing Machines
1q 2qLdc ,
),,(),( 21 Ldqcq
Transition Function
Turing Machine:
),,,,,,( 0 FqQM
States
Input
alphabet
Tape
alphabet
A partial
Transition
function Initial
state
Blank : a special symbol
Of
Final
states
Configuration
ba
1q
a
Instantaneous description:
c
baqca 1
yx
2q
a b
Time 4
yx
0q
a b
Time 5
A Move: aybqxxaybq 02 
yx
2q
a b
Time 4
yx
0q
a b
Time 5
bqxxyybqxxaybqxxaybq 1102 
yx
1q
x b
Time 6
yx
1q
x b
Time 7
bqxxyybqxxaybqxxaybq 1102 
bqxxyxaybq 12 Equivalent notation:
Initial configuration: wq0
ba
0q
a b
w
Input string
The Accepted Language
For any Turing Machine M
}:{)( 210 xqxwqwML f
Initial state Final state
Standard Turing Machine
• Deterministic
• Infinite tape in both directions
•Tape is the input/output file
The machine we described is the standard:
Design a Turing machine to recognize all
strings in which 010 is present as a
substring.
q0 q1 q2 H
0,0,R 1,1,R 0,0,R
0,0,R
1,1, R
1,1,R
DFA for the previous language
q0 q1 q2
0 1 0
0
1
1
0 , 1
Turing machine for odd no of 1’s
1, 1 , R
1, b , R
1, b , R
Recursively Enumerable
and
Recursive
Languages
Definition:
A language is recursively enumerable
if some Turing machine accepts it
For string :
Let be a recursively enumerable languageL
and the Turing Machine that accepts itM
Lw
w
if then halts in a final stateM
Lwif then halts in a non-final stateM
or loops forever
Definition:
A language is recursive
if some Turing machine accepts it
and halts on any input string
In other words:
A language is recursive if there is
a membership algorithm for it
For string :
Let be a recursive languageL
and the Turing Machine that accepts itM
Lw
w
if then halts in a final stateM
Lwif then halts in a non-final stateM
We will prove:
1. There is a specific language
which is not recursively enumerable
(not accepted by any Turing Machine)
2. There is a specific language
which is recursively enumerable
but not recursive
Recursive
Recursively Enumerable
Non Recursively Enumerable
We will first prove:
• If a language is recursive then
there is an enumeration procedure for it
• A language is recursively enumerable
if and only if
there is an enumeration procedure for it
The Chomsky Hierarchy
Unrestricted Grammars:
Productions
vu
String of variables
and terminals
String of variables
and terminals
Example unrestricted grammar:
dAc
cAaB
aBcS
A language is recursively enumerable
if and only if is generated by an
unrestricted grammar
L
L
Theorem:
Context-Sensitive Grammars:
and: |||| vu
Productions
vu
String of variables
and terminals
String of variables
and terminals
The language }{ nnn
cba
is context-sensitive:
aaAaaaB
BbbB
BbccAc
bAAb
aAbcabcS
|
|
The language }{ nnn
cba
is context-sensitive:
aaAaaaB
BbbB
BbccAc
bAAb
aAbcabcS
|
|
A language is context sensistive
if and only if
is accepted by a Linear-Bounded automatonL
L
Theorem:
There is a language which is context-sensitive
but not recursive
Observation:
Non-recursively enumerable
Recursively-enumerable
Recursive
Context-sensitive
Context-free
Regular
The Chomsky Hierarchy

More Related Content

PPTX
RFID tag anti collision protocols
PPTX
Pda numerical 2
PPT
Lecture23
PDF
Lecture set 4
PPTX
What is turing machine full described PPT for all learners
PPTX
Theory of Automata and formal languages Unit 5
PPTX
souraj Toc.pptx
PPTX
Presentation.TOA.pptxjiihugydrawagkjiggkfgtsed
RFID tag anti collision protocols
Pda numerical 2
Lecture23
Lecture set 4
What is turing machine full described PPT for all learners
Theory of Automata and formal languages Unit 5
souraj Toc.pptx
Presentation.TOA.pptxjiihugydrawagkjiggkfgtsed

Similar to Turingmachines (20)

DOCX
TOA.docx
DOCX
TOA.docx
PDF
Turing Machine
PPT
Turing Machine
PPT
TuringMachines and its introduction for computer science studetns
PPT
Turing Machine
PPT
TuringMachineS FOUNDATION OF DATA SCIENCE
PPT
THEORY OF COMPUTATION PROCESS AND MECHANISUMS
PPT
TuringMachineS FOUNDATION OF DATA SCIENCE
PPT
THEORY OF COMPUTATION PROCESS AND MECHANISUMS
PPTX
Automata Theory - Turing machine
PDF
Some New Exercises on Computability Theory Associated with Turing Machine
PDF
Some New Exercises on Computability Theory Associated with Turing Machine
PPTX
TURING MACHINE.pptxTURING MACHINE.pptxTURING MACHINE.pptx
PDF
Volume 2-issue-6-2205-2207
PDF
Volume 2-issue-6-2205-2207
PPT
Unit-3_TOC theory of computation subj.ppt
PPT
Lecture7x.ppt
PPT
Turing machine power point presentations
TOA.docx
TOA.docx
Turing Machine
Turing Machine
TuringMachines and its introduction for computer science studetns
Turing Machine
TuringMachineS FOUNDATION OF DATA SCIENCE
THEORY OF COMPUTATION PROCESS AND MECHANISUMS
TuringMachineS FOUNDATION OF DATA SCIENCE
THEORY OF COMPUTATION PROCESS AND MECHANISUMS
Automata Theory - Turing machine
Some New Exercises on Computability Theory Associated with Turing Machine
Some New Exercises on Computability Theory Associated with Turing Machine
TURING MACHINE.pptxTURING MACHINE.pptxTURING MACHINE.pptx
Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207
Unit-3_TOC theory of computation subj.ppt
Lecture7x.ppt
Turing machine power point presentations
Ad

More from Melaku Bayih Demessie (10)

PPTX
Chapter 4 computer network and the internet2
PDF
Introduction to Cloud computing
PPTX
Selected topics in Computer Science
PPTX
Greencomputing
PPTX
Reed solomon code
PPT
C2.0 propositional logic
PPTX
Chapter 5 of 1
PPTX
Dynamic programming
PPT
minimum spanning tree
PPTX
Divide and Conquer
Chapter 4 computer network and the internet2
Introduction to Cloud computing
Selected topics in Computer Science
Greencomputing
Reed solomon code
C2.0 propositional logic
Chapter 5 of 1
Dynamic programming
minimum spanning tree
Divide and Conquer
Ad

Recently uploaded (20)

PDF
Empowerment Technology for Senior High School Guide
PPTX
History, Philosophy and sociology of education (1).pptx
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
Lesson notes of climatology university.
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Classroom Observation Tools for Teachers
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Weekly quiz Compilation Jan -July 25.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Digestion and Absorption of Carbohydrates, Proteina and Fats
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Indian roads congress 037 - 2012 Flexible pavement
PPTX
Unit 4 Skeletal System.ppt.pptxopresentatiom
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Empowerment Technology for Senior High School Guide
History, Philosophy and sociology of education (1).pptx
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
What if we spent less time fighting change, and more time building what’s rig...
Lesson notes of climatology university.
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Classroom Observation Tools for Teachers
Paper A Mock Exam 9_ Attempt review.pdf.
Final Presentation General Medicine 03-08-2024.pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Weekly quiz Compilation Jan -July 25.pdf
RMMM.pdf make it easy to upload and study
Digestion and Absorption of Carbohydrates, Proteina and Fats
Final Presentation General Medicine 03-08-2024.pptx
Indian roads congress 037 - 2012 Flexible pavement
Unit 4 Skeletal System.ppt.pptxopresentatiom
Supply Chain Operations Speaking Notes -ICLT Program
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE

Turingmachines