SlideShare a Scribd company logo
1 of 109
Source of Slides: Introduction to Automata Theory, Languages, and Computation
By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
Dept. of Computer Science & IT, FUUAST
Theory of Computation
2
Turing MachineTuring Machine
Church-Turing’s ThesisChurch-Turing’s Thesis
Any mathematical problem
solving that can be described
by an algorithm can be modeled
by a Turing Machine.
Dept. of Computer Science & IT, FUUAST
Theory of Computation
3
Turing MachineTuring Machine
1)1) Multiple trackMultiple track
2) Shift over Turing Machine2) Shift over Turing Machine
3) Nondeterministic3) Nondeterministic
4) Two way Turing Machine4) Two way Turing Machine
5) Multitape Turing Machine5) Multitape Turing Machine
6) Multidimensional Turing Machine6) Multidimensional Turing Machine
7) Composite Turing Machine7) Composite Turing Machine
8) Universal Turing Machine8) Universal Turing Machine
Types of Turing Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
4
Turing MachineTuring Machine
Formal Definition
Dept. of Computer Science & IT, FUUAST
Theory of Computation
5
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
6
Turing MachineTuring Machine
1. Start in state q0
2. Read symbol under head
3. Write new symbol
4. Shift left/right
5. Enter new state qj
Steps
Dept. of Computer Science & IT, FUUAST
Theory of Computation
7
Turing MachineTuring Machine
Notational Conventions For Turing Machines
Dept. of Computer Science & IT, FUUAST
Theory of Computation
8
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
9
Turing MachineTuring Machine
Moves for input 0011:
Moves for input 0010:
Dept. of Computer Science & IT, FUUAST
Theory of Computation
10
Turing MachineTuring Machine
Transition Diagram for 0011 input
Dept. of Computer Science & IT, FUUAST
Theory of Computation
11
Pushdown AutomataPushdown Automata
A Turing Machine M computes a function ( proper subtraction) for
0m
10n
on the tape.
means if m ≥ n then m - n else if m < n then 0
Dept. of Computer Science & IT, FUUAST
Theory of Computation
12
Turing MachineTuring Machine
Evaluating function
Dept. of Computer Science & IT, FUUAST
Theory of Computation
13
Turing MachineTuring Machine
Evaluating function
Dept. of Computer Science & IT, FUUAST
Theory of Computation
14
Turing MachineTuring Machine
Transition Table for the function
Dept. of Computer Science & IT, FUUAST
Theory of Computation
15
Turing MachineTuring Machine
Transition Diagram for
Dept. of Computer Science & IT, FUUAST
Theory of Computation
16
Turing MachineTuring Machine
Transition Table for the function
Transition Diagram for
Dept. of Computer Science & IT, FUUAST
Theory of Computation
17
0 0 1 1 B B
q0
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
18
X 0 1 1 B B
q1
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
19
X 0 1 1 B B
q1
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
20
X 0 Y 1 B B
q2
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
21
X 0 Y 1 B B
q2
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
22
X 0 Y 1 B B
q0
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
23
X 0 Y 1 B B
q0
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
24
X X Y 1 B B
q1
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
25
X X Y 1 B B
q1
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
26
X X Y Y B B
q2
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
27
X X Y Y B B
q2
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
28
X X Y Y B B
q0
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
29
X X Y Y B B
q0
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
30
X X Y Y B B
q3
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
31
X X Y Y B B
q3
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
Dept. of Computer Science & IT, FUUAST
Theory of Computation
32
X X Y Y B B
q4
Turing MachineTuring Machine
A Turing Machine M that accepts the language { 0n
1n
| n ≥0 }
End of Simulation
Dept. of Computer Science & IT, FUUAST
Theory of Computation
33
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
34
Evaluating function
0 0 0 0 0 1 0 0 0 B B
q0
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
35
Evaluating function
B 0 0 0 0 1 0 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
36
Evaluating function
B 0 0 0 0 1 0 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
37
Evaluating function
B 0 0 0 0 1 0 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
38
Evaluating function
B 0 0 0 0 1 0 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
39
Evaluating function
B 0 0 0 0 1 0 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
40
Evaluating function
B 0 0 0 0 1 0 0 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
41
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
42
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
43
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
44
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
45
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
46
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
47
Evaluating function
B 0 0 0 0 1 1 0 0 B B
q0
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
48
Evaluating function
B B 0 0 0 1 1 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
49
Evaluating function
B B 0 0 0 1 1 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
50
Evaluating function
B B 0 0 0 1 1 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
51
Evaluating function
B B 0 0 0 1 1 0 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
52
Evaluating function
B B 0 0 0 1 1 0 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
53
Evaluating function
B B 0 0 0 1 1 0 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
54
Evaluating function
B B 0 0 0 1 1 0 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
55
Evaluating function
B B 0 0 0 1 1 1 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
56
Evaluating function
B B 0 0 0 1 1 1 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
57
Evaluating function
B B 0 0 0 1 1 1 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
58
Evaluating function
B B 0 0 0 1 1 1 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
59
Evaluating function
B B 0 0 0 1 1 1 0 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
60
Evaluating function
B B 0 0 0 1 1 1 0 B B
q0
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
61
Evaluating function
B B B 0 0 1 1 1 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
62
Evaluating function
B B B 0 0 1 1 1 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
63
Evaluating function
B B B 0 0 1 1 1 0 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
64
Evaluating function
B B B 0 0 1 1 1 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
65
Evaluating function
B B B 0 0 1 1 1 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
66
Evaluating function
B B B 0 0 1 1 1 0 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
67
Evaluating function
B B B 0 0 1 1 1 1 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
68
Evaluating function
B B B 0 0 1 1 1 1 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
69
Evaluating function
B B B 0 0 1 1 1 1 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
70
Evaluating function
B B B 0 0 1 1 1 1 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
71
Evaluating function
B B B 0 0 1 1 1 1 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
72
Evaluating function
B B B 0 0 1 1 1 1 B B
q3
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
73
Evaluating function
B B B 0 0 1 1 1 1 B B
q0
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
74
Evaluating function
B B B B 0 1 1 1 1 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
75
Evaluating function
B B B B 0 1 1 1 1 B B
q1
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
76
Evaluating function
B B B B 0 1 1 1 1 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
77
Evaluating function
B B B B 0 1 1 1 1 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
78
Evaluating function
B B B B 0 1 1 1 1 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
79
Evaluating function
B B B B 0 1 1 1 1 B B
q2
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
80
Evaluating function
B B B B 0 1 1 1 1 B B
q4
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
81
Evaluating function
B B B B 0 1 1 1 B B B
q4
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
82
Evaluating function
B B B B 0 1 1 B B B B
q4
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
83
Evaluating function
B B B B 0 1 B B B B B
q4
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
84
Evaluating function
B B B B 0 B B B B B B
q4
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
85
Evaluating function
B B B B 0 B B B B B B
q4
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
86
Evaluating function
B B B 0 0 B B B B B B
q6
Turing MachineTuring Machine
Final State
Dept. of Computer Science & IT, FUUAST
Theory of Computation
87
End of Simulation
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
88
Turing MachineTuring Machine
0m
10n
1
Multiplication
Dept. of Computer Science & IT, FUUAST
Theory of Computation
89
Turing MachineTuring Machine
0m
10n
1
Multiplication
Dept. of Computer Science & IT, FUUAST
Theory of Computation
90
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
91
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
92
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
93
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
94
Turing MachineTuring Machine
Variants of Turing Machine
A normal TM is a 7-tuple
(Q, Σ, Γ, δ, q0, qaccept, qreject) where:
everything is the same as a TM except the
transition function:
δ: Q x Γk
→ Q x Γk
x {L, R}k
δ(qi, a1,a2,…,ak) = (qj, b1,b2,…,bk, L, R,…, L) =
“in state qi, reading a1,a2,…,ak on k tapes, move to
state qj, write b1,b2,…,bk on k tapes, move L, R on
k tapes as specified.”
o Multitape Turing Machine:
Dept. of Computer Science & IT, FUUAST
Theory of Computation
95
Turing MachineTuring Machine
k-tape TM
0 1 1 0 0 1 1 1 0 1 0 0
q0
input tape
finite control
…
k read/write
heads
0 1 1 0 0 1
“work tapes”
…
0 1 1 0 0 1 1 1 0 1 0 0 …
0 …
…
Dept. of Computer Science & IT, FUUAST
Theory of Computation
96
Turing MachineTuring Machine
Informal description of k-tape TM:
 Input written on left-most squares of tape #1
 Rest of squares are blank on all tapes
 At each point, take a step determined by
• current k symbols being read on k tapes
• current state of finite control
 A step consists of
• writing k new symbols on k tapes
• moving each of k read/write heads left or right
• changing state
Dept. of Computer Science & IT, FUUAST
Theory of Computation
97
Turing MachineTuring Machine
Theorem: Every k-tape TM has an equivalent single-tape TM.
Proof: Simulate k-tape TM on a 1-tape TM.
. . .a b a b
a a
b b c d
. . .
. . .
(input tape)
# a b a b # a a # b b c d # . . .
• add new symbol x for
each old x
•marks location of “virtual
heads”
Dept. of Computer Science & IT, FUUAST
Theory of Computation
98
Turing MachineTuring Machine
Theorem:
The time taken by the one-tape TM to
simulate n moves of the k-tape TM is
O(n2
).
Dept. of Computer Science & IT, FUUAST
Theory of Computation
99
Turing MachineTuring Machine
o Nondeterministic Turing Machine (NTM):
A nondeterministic Turing Machine (NTM) differs from the
deterministic variety by having a transition function δ such that
for each state q and tape symbol X, δ(q, X) is a set of triples
{(q1,Y1,D1), (q2,Y2,D2), ……….. (qk,Yk,Dk)}
Where k is any finite integer. The NTM can choose, at each step,
any of the triples to be the next move. It cannot, however, pick a
state from one, a tape symbol from another, a the direction from
yet another.
Dept. of Computer Science & IT, FUUAST
Theory of Computation
100
Turing MachineTuring Machine
Theorem: Every NTM has an equivalent (deterministic) TM.
Proof: Simulate NTM with a deterministic TM
Cstart
• computations of M are a tree
• nodes are configurations
• fanout is b = maximum number of
choices in transition function
• leaves are accept/reject
configurations.
accrej
Dept. of Computer Science & IT, FUUAST
Theory of Computation
101
Turing MachineTuring Machine
Simulating NTM M with a deterministic TM:
Breadth-first search of tree
• if M accepts: we will encounter accepting leaf and
accept
• if M rejects: we will encounter all rejecting leaves,
finish traversal of tree, and reject
• if M does not halt on some branch: we will not halt
as that branch is infinite…
Dept. of Computer Science & IT, FUUAST
Theory of Computation
102
Turing MachineTuring Machine
Simulating NTM M with a deterministic TM:
o use a 3 tape TM:
• tape 1: input tape (read-only)
• tape 2: simulation tape (copy of M’s tape at point
corresponding to some node in the tree)
• tape 3: which node of the tree we are exploring (string
in {1,2,…b}*)
o Initially, tape 1 has input, others blank
Dept. of Computer Science & IT, FUUAST
Theory of Computation
103
Turing MachineTuring Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
104
Turing MachineTuring Machine
Turing Machine and Computer
o A computer can simulate Turing Machine.
o A Turing Machine can simulate a computer.
Dept. of Computer Science & IT, FUUAST
Theory of Computation
105
Turing MachineTuring Machine
Simulating a Turing Machine by Computer
Dept. of Computer Science & IT, FUUAST
Theory of Computation
106
Turing MachineTuring Machine
Simulating a Computer by Turing Machine
Both addresses and
contents are written in
binary. The marker
symbol * and # are
used to find the ends
of addresses and
contents. Another
marker,$, indicates
the beginning of the
sequence of
addresses and
contents
Both addresses and
contents are written in
binary. The marker
symbol * and # are
used to find the ends
of addresses and
contents. Another
marker,$, indicates
the beginning of the
sequence of
addresses and
contents
Dept. of Computer Science & IT, FUUAST
Theory of Computation
107
Turing MachineTuring Machine
A universal Turing machine is a Turing machine Tu that
works as follows. It is assumed to receive an input string
of the form e(T )e(z), where T is an arbitrary TM, z is a
string over the input alphabet of T , and e is an encoding
function whose values are strings in {0, 1} . The∗
computation performed by Tu on this input string satisfies
these two properties:
1. Tu accepts the string e(T )e(z) if and only if T accepts z.
2. If T accepts z and produces output y, then Tu produces
output e(y).
Universal Turing Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
108
Turing MachineTuring Machine
Universal Turing Machine
Dept. of Computer Science & IT, FUUAST
Theory of Computation
109
Turing MachineTuring Machine
END

More Related Content

What's hot

What's hot (20)

Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Working principle of Turing machine
Working principle of Turing machineWorking principle of Turing machine
Working principle of Turing machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
TOC 5 | Regular Expressions
TOC 5 | Regular ExpressionsTOC 5 | Regular Expressions
TOC 5 | Regular Expressions
 
asymptotic notation
asymptotic notationasymptotic notation
asymptotic notation
 
NP completeness
NP completenessNP completeness
NP completeness
 
Hamiltonian path
Hamiltonian pathHamiltonian path
Hamiltonian path
 
Turing machine - theory of computation
Turing machine - theory of computationTuring machine - theory of computation
Turing machine - theory of computation
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
 
Chomsky classification of Language
Chomsky classification of LanguageChomsky classification of Language
Chomsky classification of Language
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
 

Viewers also liked

Turing machine Introduction
Turing machine IntroductionTuring machine Introduction
Turing machine IntroductionAram Rafeq
 
Turing Machine
Turing MachineTuring Machine
Turing MachineAyAn KhAn
 
Turing Machine
Turing MachineTuring Machine
Turing Machineazmizryk
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computationprasadmvreddy
 
Quantum Computer on a Turing Machine
Quantum Computer on a Turing MachineQuantum Computer on a Turing Machine
Quantum Computer on a Turing MachineVasil Penchev
 
Turing Church Online Workshop 2
Turing Church Online Workshop 2Turing Church Online Workshop 2
Turing Church Online Workshop 2Giulio Prisco
 
The Cosmic Visions of the Turing Church
The Cosmic Visions of the Turing ChurchThe Cosmic Visions of the Turing Church
The Cosmic Visions of the Turing ChurchGiulio Prisco
 
Computer Science Fundamentals - Turing Machines
Computer Science Fundamentals - Turing MachinesComputer Science Fundamentals - Turing Machines
Computer Science Fundamentals - Turing Machinesjasondew
 
Church Turing Thesis
Church Turing ThesisChurch Turing Thesis
Church Turing ThesisHemant Sharma
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing MachineRajendran
 
Push down automata
Push down automataPush down automata
Push down automataSomya Bagai
 

Viewers also liked (20)

Turing machine Introduction
Turing machine IntroductionTuring machine Introduction
Turing machine Introduction
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing machine
Turing machineTuring machine
Turing machine
 
Introduction to Turing Machine
Introduction to Turing MachineIntroduction to Turing Machine
Introduction to Turing Machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
 
Introduction to the theory of computation
Introduction to the theory of computationIntroduction to the theory of computation
Introduction to the theory of computation
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 
Quantum Computer on a Turing Machine
Quantum Computer on a Turing MachineQuantum Computer on a Turing Machine
Quantum Computer on a Turing Machine
 
Turing Church Online Workshop 2
Turing Church Online Workshop 2Turing Church Online Workshop 2
Turing Church Online Workshop 2
 
The Cosmic Visions of the Turing Church
The Cosmic Visions of the Turing ChurchThe Cosmic Visions of the Turing Church
The Cosmic Visions of the Turing Church
 
Computer Science Fundamentals - Turing Machines
Computer Science Fundamentals - Turing MachinesComputer Science Fundamentals - Turing Machines
Computer Science Fundamentals - Turing Machines
 
Church Turing Thesis
Church Turing ThesisChurch Turing Thesis
Church Turing Thesis
 
Variants of Turing Machine
Variants of Turing MachineVariants of Turing Machine
Variants of Turing Machine
 
touch screen technology presentation
touch screen technology presentationtouch screen technology presentation
touch screen technology presentation
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Push down automata
Push down automataPush down automata
Push down automata
 

Similar to Turing Machine

mealy moore machine conversion
mealy moore machine conversion mealy moore machine conversion
mealy moore machine conversion Chandnigupta80
 
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHMCOMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHMcsitconf
 
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHMCOMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHMcscpconf
 
A machine consciousness approach to urban traffic signal control
A machine consciousness approach to urban traffic signal controlA machine consciousness approach to urban traffic signal control
A machine consciousness approach to urban traffic signal controlAndré Paraense
 
Computability, turing machines and lambda calculus
Computability, turing machines and lambda calculusComputability, turing machines and lambda calculus
Computability, turing machines and lambda calculusEdward Blurock
 
Tech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflowTech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflowRamdhan Rizki
 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfTulasiramKandula1
 

Similar to Turing Machine (8)

mealy moore machine conversion
mealy moore machine conversion mealy moore machine conversion
mealy moore machine conversion
 
PyData Paris 2015 - Track 2.2 Camilla Montonen
PyData Paris 2015 - Track 2.2 Camilla MontonenPyData Paris 2015 - Track 2.2 Camilla Montonen
PyData Paris 2015 - Track 2.2 Camilla Montonen
 
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHMCOMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
 
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHMCOMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
COMPUTATIONAL PERFORMANCE OF QUANTUM PHASE ESTIMATION ALGORITHM
 
A machine consciousness approach to urban traffic signal control
A machine consciousness approach to urban traffic signal controlA machine consciousness approach to urban traffic signal control
A machine consciousness approach to urban traffic signal control
 
Computability, turing machines and lambda calculus
Computability, turing machines and lambda calculusComputability, turing machines and lambda calculus
Computability, turing machines and lambda calculus
 
Tech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflowTech day ngobrol santai tensorflow
Tech day ngobrol santai tensorflow
 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdf
 

More from Rajendran

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower boundsRajendran
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsRajendran
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower boundsRajendran
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statisticsRajendran
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theoremRajendran
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree methodRajendran
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theoremRajendran
 
Master method
Master method Master method
Master method Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithmsRajendran
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisRajendran
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisRajendran
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of QuicksortRajendran
 
Np completeness
Np completenessNp completeness
Np completenessRajendran
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 

More from Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master method
Master method Master method
Master method
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
Np completeness
Np completenessNp completeness
Np completeness
 
computer languages
computer languagescomputer languages
computer languages
 

Recently uploaded

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 

Recently uploaded (20)

How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 

Turing Machine

  • 1. Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman
  • 2. Dept. of Computer Science & IT, FUUAST Theory of Computation 2 Turing MachineTuring Machine Church-Turing’s ThesisChurch-Turing’s Thesis Any mathematical problem solving that can be described by an algorithm can be modeled by a Turing Machine.
  • 3. Dept. of Computer Science & IT, FUUAST Theory of Computation 3 Turing MachineTuring Machine 1)1) Multiple trackMultiple track 2) Shift over Turing Machine2) Shift over Turing Machine 3) Nondeterministic3) Nondeterministic 4) Two way Turing Machine4) Two way Turing Machine 5) Multitape Turing Machine5) Multitape Turing Machine 6) Multidimensional Turing Machine6) Multidimensional Turing Machine 7) Composite Turing Machine7) Composite Turing Machine 8) Universal Turing Machine8) Universal Turing Machine Types of Turing Machine
  • 4. Dept. of Computer Science & IT, FUUAST Theory of Computation 4 Turing MachineTuring Machine Formal Definition
  • 5. Dept. of Computer Science & IT, FUUAST Theory of Computation 5 Turing MachineTuring Machine
  • 6. Dept. of Computer Science & IT, FUUAST Theory of Computation 6 Turing MachineTuring Machine 1. Start in state q0 2. Read symbol under head 3. Write new symbol 4. Shift left/right 5. Enter new state qj Steps
  • 7. Dept. of Computer Science & IT, FUUAST Theory of Computation 7 Turing MachineTuring Machine Notational Conventions For Turing Machines
  • 8. Dept. of Computer Science & IT, FUUAST Theory of Computation 8 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 9. Dept. of Computer Science & IT, FUUAST Theory of Computation 9 Turing MachineTuring Machine Moves for input 0011: Moves for input 0010:
  • 10. Dept. of Computer Science & IT, FUUAST Theory of Computation 10 Turing MachineTuring Machine Transition Diagram for 0011 input
  • 11. Dept. of Computer Science & IT, FUUAST Theory of Computation 11 Pushdown AutomataPushdown Automata A Turing Machine M computes a function ( proper subtraction) for 0m 10n on the tape. means if m ≥ n then m - n else if m < n then 0
  • 12. Dept. of Computer Science & IT, FUUAST Theory of Computation 12 Turing MachineTuring Machine Evaluating function
  • 13. Dept. of Computer Science & IT, FUUAST Theory of Computation 13 Turing MachineTuring Machine Evaluating function
  • 14. Dept. of Computer Science & IT, FUUAST Theory of Computation 14 Turing MachineTuring Machine Transition Table for the function
  • 15. Dept. of Computer Science & IT, FUUAST Theory of Computation 15 Turing MachineTuring Machine Transition Diagram for
  • 16. Dept. of Computer Science & IT, FUUAST Theory of Computation 16 Turing MachineTuring Machine Transition Table for the function Transition Diagram for
  • 17. Dept. of Computer Science & IT, FUUAST Theory of Computation 17 0 0 1 1 B B q0 A Turing Machine M that accepts the language { 0n 1n | n ≥0 } Turing MachineTuring Machine
  • 18. Dept. of Computer Science & IT, FUUAST Theory of Computation 18 X 0 1 1 B B q1 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 19. Dept. of Computer Science & IT, FUUAST Theory of Computation 19 X 0 1 1 B B q1 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 20. Dept. of Computer Science & IT, FUUAST Theory of Computation 20 X 0 Y 1 B B q2 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 21. Dept. of Computer Science & IT, FUUAST Theory of Computation 21 X 0 Y 1 B B q2 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 22. Dept. of Computer Science & IT, FUUAST Theory of Computation 22 X 0 Y 1 B B q0 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 23. Dept. of Computer Science & IT, FUUAST Theory of Computation 23 X 0 Y 1 B B q0 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 24. Dept. of Computer Science & IT, FUUAST Theory of Computation 24 X X Y 1 B B q1 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 25. Dept. of Computer Science & IT, FUUAST Theory of Computation 25 X X Y 1 B B q1 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 26. Dept. of Computer Science & IT, FUUAST Theory of Computation 26 X X Y Y B B q2 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 27. Dept. of Computer Science & IT, FUUAST Theory of Computation 27 X X Y Y B B q2 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 28. Dept. of Computer Science & IT, FUUAST Theory of Computation 28 X X Y Y B B q0 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 29. Dept. of Computer Science & IT, FUUAST Theory of Computation 29 X X Y Y B B q0 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 30. Dept. of Computer Science & IT, FUUAST Theory of Computation 30 X X Y Y B B q3 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 31. Dept. of Computer Science & IT, FUUAST Theory of Computation 31 X X Y Y B B q3 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 32. Dept. of Computer Science & IT, FUUAST Theory of Computation 32 X X Y Y B B q4 Turing MachineTuring Machine A Turing Machine M that accepts the language { 0n 1n | n ≥0 }
  • 33. End of Simulation Dept. of Computer Science & IT, FUUAST Theory of Computation 33 Turing MachineTuring Machine
  • 34. Dept. of Computer Science & IT, FUUAST Theory of Computation 34 Evaluating function 0 0 0 0 0 1 0 0 0 B B q0 Turing MachineTuring Machine
  • 35. Dept. of Computer Science & IT, FUUAST Theory of Computation 35 Evaluating function B 0 0 0 0 1 0 0 0 B B q1 Turing MachineTuring Machine
  • 36. Dept. of Computer Science & IT, FUUAST Theory of Computation 36 Evaluating function B 0 0 0 0 1 0 0 0 B B q1 Turing MachineTuring Machine
  • 37. Dept. of Computer Science & IT, FUUAST Theory of Computation 37 Evaluating function B 0 0 0 0 1 0 0 0 B B q1 Turing MachineTuring Machine
  • 38. Dept. of Computer Science & IT, FUUAST Theory of Computation 38 Evaluating function B 0 0 0 0 1 0 0 0 B B q1 Turing MachineTuring Machine
  • 39. Dept. of Computer Science & IT, FUUAST Theory of Computation 39 Evaluating function B 0 0 0 0 1 0 0 0 B B q1 Turing MachineTuring Machine
  • 40. Dept. of Computer Science & IT, FUUAST Theory of Computation 40 Evaluating function B 0 0 0 0 1 0 0 0 B B q2 Turing MachineTuring Machine
  • 41. Dept. of Computer Science & IT, FUUAST Theory of Computation 41 Evaluating function B 0 0 0 0 1 1 0 0 B B q3 Turing MachineTuring Machine
  • 42. Dept. of Computer Science & IT, FUUAST Theory of Computation 42 Evaluating function B 0 0 0 0 1 1 0 0 B B q3 Turing MachineTuring Machine
  • 43. Dept. of Computer Science & IT, FUUAST Theory of Computation 43 Evaluating function B 0 0 0 0 1 1 0 0 B B q3 Turing MachineTuring Machine
  • 44. Dept. of Computer Science & IT, FUUAST Theory of Computation 44 Evaluating function B 0 0 0 0 1 1 0 0 B B q3 Turing MachineTuring Machine
  • 45. Dept. of Computer Science & IT, FUUAST Theory of Computation 45 Evaluating function B 0 0 0 0 1 1 0 0 B B q3 Turing MachineTuring Machine
  • 46. Dept. of Computer Science & IT, FUUAST Theory of Computation 46 Evaluating function B 0 0 0 0 1 1 0 0 B B q3 Turing MachineTuring Machine
  • 47. Dept. of Computer Science & IT, FUUAST Theory of Computation 47 Evaluating function B 0 0 0 0 1 1 0 0 B B q0 Turing MachineTuring Machine
  • 48. Dept. of Computer Science & IT, FUUAST Theory of Computation 48 Evaluating function B B 0 0 0 1 1 0 0 B B q1 Turing MachineTuring Machine
  • 49. Dept. of Computer Science & IT, FUUAST Theory of Computation 49 Evaluating function B B 0 0 0 1 1 0 0 B B q1 Turing MachineTuring Machine
  • 50. Dept. of Computer Science & IT, FUUAST Theory of Computation 50 Evaluating function B B 0 0 0 1 1 0 0 B B q1 Turing MachineTuring Machine
  • 51. Dept. of Computer Science & IT, FUUAST Theory of Computation 51 Evaluating function B B 0 0 0 1 1 0 0 B B q1 Turing MachineTuring Machine
  • 52. Dept. of Computer Science & IT, FUUAST Theory of Computation 52 Evaluating function B B 0 0 0 1 1 0 0 B B q2 Turing MachineTuring Machine
  • 53. Dept. of Computer Science & IT, FUUAST Theory of Computation 53 Evaluating function B B 0 0 0 1 1 0 0 B B q2 Turing MachineTuring Machine
  • 54. Dept. of Computer Science & IT, FUUAST Theory of Computation 54 Evaluating function B B 0 0 0 1 1 0 0 B B q2 Turing MachineTuring Machine
  • 55. Dept. of Computer Science & IT, FUUAST Theory of Computation 55 Evaluating function B B 0 0 0 1 1 1 0 B B q3 Turing MachineTuring Machine
  • 56. Dept. of Computer Science & IT, FUUAST Theory of Computation 56 Evaluating function B B 0 0 0 1 1 1 0 B B q3 Turing MachineTuring Machine
  • 57. Dept. of Computer Science & IT, FUUAST Theory of Computation 57 Evaluating function B B 0 0 0 1 1 1 0 B B q3 Turing MachineTuring Machine
  • 58. Dept. of Computer Science & IT, FUUAST Theory of Computation 58 Evaluating function B B 0 0 0 1 1 1 0 B B q3 Turing MachineTuring Machine
  • 59. Dept. of Computer Science & IT, FUUAST Theory of Computation 59 Evaluating function B B 0 0 0 1 1 1 0 B B q3 Turing MachineTuring Machine
  • 60. Dept. of Computer Science & IT, FUUAST Theory of Computation 60 Evaluating function B B 0 0 0 1 1 1 0 B B q0 Turing MachineTuring Machine
  • 61. Dept. of Computer Science & IT, FUUAST Theory of Computation 61 Evaluating function B B B 0 0 1 1 1 0 B B q1 Turing MachineTuring Machine
  • 62. Dept. of Computer Science & IT, FUUAST Theory of Computation 62 Evaluating function B B B 0 0 1 1 1 0 B B q1 Turing MachineTuring Machine
  • 63. Dept. of Computer Science & IT, FUUAST Theory of Computation 63 Evaluating function B B B 0 0 1 1 1 0 B B q1 Turing MachineTuring Machine
  • 64. Dept. of Computer Science & IT, FUUAST Theory of Computation 64 Evaluating function B B B 0 0 1 1 1 0 B B q2 Turing MachineTuring Machine
  • 65. Dept. of Computer Science & IT, FUUAST Theory of Computation 65 Evaluating function B B B 0 0 1 1 1 0 B B q2 Turing MachineTuring Machine
  • 66. Dept. of Computer Science & IT, FUUAST Theory of Computation 66 Evaluating function B B B 0 0 1 1 1 0 B B q2 Turing MachineTuring Machine
  • 67. Dept. of Computer Science & IT, FUUAST Theory of Computation 67 Evaluating function B B B 0 0 1 1 1 1 B B q3 Turing MachineTuring Machine
  • 68. Dept. of Computer Science & IT, FUUAST Theory of Computation 68 Evaluating function B B B 0 0 1 1 1 1 B B q3 Turing MachineTuring Machine
  • 69. Dept. of Computer Science & IT, FUUAST Theory of Computation 69 Evaluating function B B B 0 0 1 1 1 1 B B q3 Turing MachineTuring Machine
  • 70. Dept. of Computer Science & IT, FUUAST Theory of Computation 70 Evaluating function B B B 0 0 1 1 1 1 B B q3 Turing MachineTuring Machine
  • 71. Dept. of Computer Science & IT, FUUAST Theory of Computation 71 Evaluating function B B B 0 0 1 1 1 1 B B q3 Turing MachineTuring Machine
  • 72. Dept. of Computer Science & IT, FUUAST Theory of Computation 72 Evaluating function B B B 0 0 1 1 1 1 B B q3 Turing MachineTuring Machine
  • 73. Dept. of Computer Science & IT, FUUAST Theory of Computation 73 Evaluating function B B B 0 0 1 1 1 1 B B q0 Turing MachineTuring Machine
  • 74. Dept. of Computer Science & IT, FUUAST Theory of Computation 74 Evaluating function B B B B 0 1 1 1 1 B B q1 Turing MachineTuring Machine
  • 75. Dept. of Computer Science & IT, FUUAST Theory of Computation 75 Evaluating function B B B B 0 1 1 1 1 B B q1 Turing MachineTuring Machine
  • 76. Dept. of Computer Science & IT, FUUAST Theory of Computation 76 Evaluating function B B B B 0 1 1 1 1 B B q2 Turing MachineTuring Machine
  • 77. Dept. of Computer Science & IT, FUUAST Theory of Computation 77 Evaluating function B B B B 0 1 1 1 1 B B q2 Turing MachineTuring Machine
  • 78. Dept. of Computer Science & IT, FUUAST Theory of Computation 78 Evaluating function B B B B 0 1 1 1 1 B B q2 Turing MachineTuring Machine
  • 79. Dept. of Computer Science & IT, FUUAST Theory of Computation 79 Evaluating function B B B B 0 1 1 1 1 B B q2 Turing MachineTuring Machine
  • 80. Dept. of Computer Science & IT, FUUAST Theory of Computation 80 Evaluating function B B B B 0 1 1 1 1 B B q4 Turing MachineTuring Machine
  • 81. Dept. of Computer Science & IT, FUUAST Theory of Computation 81 Evaluating function B B B B 0 1 1 1 B B B q4 Turing MachineTuring Machine
  • 82. Dept. of Computer Science & IT, FUUAST Theory of Computation 82 Evaluating function B B B B 0 1 1 B B B B q4 Turing MachineTuring Machine
  • 83. Dept. of Computer Science & IT, FUUAST Theory of Computation 83 Evaluating function B B B B 0 1 B B B B B q4 Turing MachineTuring Machine
  • 84. Dept. of Computer Science & IT, FUUAST Theory of Computation 84 Evaluating function B B B B 0 B B B B B B q4 Turing MachineTuring Machine
  • 85. Dept. of Computer Science & IT, FUUAST Theory of Computation 85 Evaluating function B B B B 0 B B B B B B q4 Turing MachineTuring Machine
  • 86. Dept. of Computer Science & IT, FUUAST Theory of Computation 86 Evaluating function B B B 0 0 B B B B B B q6 Turing MachineTuring Machine Final State
  • 87. Dept. of Computer Science & IT, FUUAST Theory of Computation 87 End of Simulation Turing MachineTuring Machine
  • 88. Dept. of Computer Science & IT, FUUAST Theory of Computation 88 Turing MachineTuring Machine 0m 10n 1 Multiplication
  • 89. Dept. of Computer Science & IT, FUUAST Theory of Computation 89 Turing MachineTuring Machine 0m 10n 1 Multiplication
  • 90. Dept. of Computer Science & IT, FUUAST Theory of Computation 90 Turing MachineTuring Machine
  • 91. Dept. of Computer Science & IT, FUUAST Theory of Computation 91 Turing MachineTuring Machine
  • 92. Dept. of Computer Science & IT, FUUAST Theory of Computation 92 Turing MachineTuring Machine
  • 93. Dept. of Computer Science & IT, FUUAST Theory of Computation 93 Turing MachineTuring Machine
  • 94. Dept. of Computer Science & IT, FUUAST Theory of Computation 94 Turing MachineTuring Machine Variants of Turing Machine A normal TM is a 7-tuple (Q, Σ, Γ, δ, q0, qaccept, qreject) where: everything is the same as a TM except the transition function: δ: Q x Γk → Q x Γk x {L, R}k δ(qi, a1,a2,…,ak) = (qj, b1,b2,…,bk, L, R,…, L) = “in state qi, reading a1,a2,…,ak on k tapes, move to state qj, write b1,b2,…,bk on k tapes, move L, R on k tapes as specified.” o Multitape Turing Machine:
  • 95. Dept. of Computer Science & IT, FUUAST Theory of Computation 95 Turing MachineTuring Machine k-tape TM 0 1 1 0 0 1 1 1 0 1 0 0 q0 input tape finite control … k read/write heads 0 1 1 0 0 1 “work tapes” … 0 1 1 0 0 1 1 1 0 1 0 0 … 0 … …
  • 96. Dept. of Computer Science & IT, FUUAST Theory of Computation 96 Turing MachineTuring Machine Informal description of k-tape TM:  Input written on left-most squares of tape #1  Rest of squares are blank on all tapes  At each point, take a step determined by • current k symbols being read on k tapes • current state of finite control  A step consists of • writing k new symbols on k tapes • moving each of k read/write heads left or right • changing state
  • 97. Dept. of Computer Science & IT, FUUAST Theory of Computation 97 Turing MachineTuring Machine Theorem: Every k-tape TM has an equivalent single-tape TM. Proof: Simulate k-tape TM on a 1-tape TM. . . .a b a b a a b b c d . . . . . . (input tape) # a b a b # a a # b b c d # . . . • add new symbol x for each old x •marks location of “virtual heads”
  • 98. Dept. of Computer Science & IT, FUUAST Theory of Computation 98 Turing MachineTuring Machine Theorem: The time taken by the one-tape TM to simulate n moves of the k-tape TM is O(n2 ).
  • 99. Dept. of Computer Science & IT, FUUAST Theory of Computation 99 Turing MachineTuring Machine o Nondeterministic Turing Machine (NTM): A nondeterministic Turing Machine (NTM) differs from the deterministic variety by having a transition function δ such that for each state q and tape symbol X, δ(q, X) is a set of triples {(q1,Y1,D1), (q2,Y2,D2), ……….. (qk,Yk,Dk)} Where k is any finite integer. The NTM can choose, at each step, any of the triples to be the next move. It cannot, however, pick a state from one, a tape symbol from another, a the direction from yet another.
  • 100. Dept. of Computer Science & IT, FUUAST Theory of Computation 100 Turing MachineTuring Machine Theorem: Every NTM has an equivalent (deterministic) TM. Proof: Simulate NTM with a deterministic TM Cstart • computations of M are a tree • nodes are configurations • fanout is b = maximum number of choices in transition function • leaves are accept/reject configurations. accrej
  • 101. Dept. of Computer Science & IT, FUUAST Theory of Computation 101 Turing MachineTuring Machine Simulating NTM M with a deterministic TM: Breadth-first search of tree • if M accepts: we will encounter accepting leaf and accept • if M rejects: we will encounter all rejecting leaves, finish traversal of tree, and reject • if M does not halt on some branch: we will not halt as that branch is infinite…
  • 102. Dept. of Computer Science & IT, FUUAST Theory of Computation 102 Turing MachineTuring Machine Simulating NTM M with a deterministic TM: o use a 3 tape TM: • tape 1: input tape (read-only) • tape 2: simulation tape (copy of M’s tape at point corresponding to some node in the tree) • tape 3: which node of the tree we are exploring (string in {1,2,…b}*) o Initially, tape 1 has input, others blank
  • 103. Dept. of Computer Science & IT, FUUAST Theory of Computation 103 Turing MachineTuring Machine
  • 104. Dept. of Computer Science & IT, FUUAST Theory of Computation 104 Turing MachineTuring Machine Turing Machine and Computer o A computer can simulate Turing Machine. o A Turing Machine can simulate a computer.
  • 105. Dept. of Computer Science & IT, FUUAST Theory of Computation 105 Turing MachineTuring Machine Simulating a Turing Machine by Computer
  • 106. Dept. of Computer Science & IT, FUUAST Theory of Computation 106 Turing MachineTuring Machine Simulating a Computer by Turing Machine Both addresses and contents are written in binary. The marker symbol * and # are used to find the ends of addresses and contents. Another marker,$, indicates the beginning of the sequence of addresses and contents Both addresses and contents are written in binary. The marker symbol * and # are used to find the ends of addresses and contents. Another marker,$, indicates the beginning of the sequence of addresses and contents
  • 107. Dept. of Computer Science & IT, FUUAST Theory of Computation 107 Turing MachineTuring Machine A universal Turing machine is a Turing machine Tu that works as follows. It is assumed to receive an input string of the form e(T )e(z), where T is an arbitrary TM, z is a string over the input alphabet of T , and e is an encoding function whose values are strings in {0, 1} . The∗ computation performed by Tu on this input string satisfies these two properties: 1. Tu accepts the string e(T )e(z) if and only if T accepts z. 2. If T accepts z and produces output y, then Tu produces output e(y). Universal Turing Machine
  • 108. Dept. of Computer Science & IT, FUUAST Theory of Computation 108 Turing MachineTuring Machine Universal Turing Machine
  • 109. Dept. of Computer Science & IT, FUUAST Theory of Computation 109 Turing MachineTuring Machine END