3/14/2006
CSE 2001, Winter 2006
1
CSE 2001:
Introduction to Theory of Computation
Winter 2006
Suprakash Datta
datta@cs.yorku.ca
Office: CSEB 3043
Phone: 416-736-2100 ext 77875
Course page: http://www.cs.yorku.ca/course/2001
Some of these slides are adapted from Wim van Dam’s slides
(
www.cs.berkeley.edu/~vandam/CS172/
)
3/14/2006
CSE 2001, Winter 2006
2
Outline
Last class:
•
Introduction to Turing machines
•
TM-computable/recognizable languages
Today:
•
Recall the definition of TMs
•
Variants of TMs
•
Church-Turing thesis
•
Decidability
3/14/2006
CSE 2001, Winter 2006
3
Turing Machine (Def. 3.3)
A Turing machine M is defined by a 7-tuple
(Q,
Σ
,
Γ
,
δ
,q
0
,q
accept
,q
reject
), with
• Q finite set of states
•
Σ
finite input alphabet (without “_”)
•
Γ
finite tape alphabet with { _ }
∪Σ⊆Γ
•q
0
start state
∈
Q
•q
accept
accept state
∈
Q
•q
reject
reject state
∈
Q
•
δ
the transition function
δ
: Q
×Γ→
Q
× Γ ×
{L,R}
3/14/2006
CSE 2001, Winter 2006
4
Configuration of a TM
The configuration of a Turing machine consists of
• the current state q
∈
Q
• the current tape contents
∈Γ
*
• the current head location
∈
{0,1,2,…}
This can be expressed as an element of
Γ
*
×
Q
×Γ
*:
L
_
_
1
#
0
_
1
1
0
1
q
9
becomes “101 q
9
1_0#1”
3/14/2006
CSE 2001, Winter 2006
5
Turing recognizable vs decidable
A language L is
Turing-recognizable
if and only
if there is a TM M such that L=L(M).
Also called: a recursively enumerable
language.
A language L=L(M) is decided
by the TM M if on
every w, the TM finishes in a halting configuration.
(That is: q
accept
for w
∈
L and q
reject
for all w
∉
L.)
A language L is
Turing-decidable
if and only if
there is a TM M that decides L.
Also called: a recursive
language.
3/14/2006
CSE 2001, Winter 2006
6
Describing TM Programs
Three Levels of Describing algorithms:
• formal (state diagrams, CFGs, et cetera)
• implementation (pseudo-Pascal)
• high-level (coherent and clear English)
Describing input/output format:
TMs allow only strings
∈Σ
* as input/output.
If our X and Y are of another form (graph, Turing
machine, polynomial), then we use
<
X,Y
>
to
denote ‘some kind of encoding
∈Σ
*’.