Name: SOLUTIONS
Problem 1:
Prove or disprove:
the following language is decidable:
L
=
{h
M, n
i
:
M
is a Turing machine with
n
states, and there exists a string
w
in Σ
*
of length
at most
n
2
such that
M
accepts
w
in at most
n
3
transitions
}
The language is decidable. The following Turing machine decides it:
M
L
=
“On input
< M, n >
1. Check if
M
has
n
states. If not, reject.
2. For each string
w
∈
Σ
*
of length at most
n
2
do:
3.
Simulate
M
on
w
for
n
3
steps.
4.
If
M
accepts
w
within
n
3
steps, accept.
5. Reject.
Problem 2:
Prove or disprove:
the following language is decidable:
L
=
{h
M, p, q
i
: TM
M
, on input ’1’, visits state
p
(at some point) and (at a later point) state
q
}
.
The language
L
is not decidable. To prove it, we show that
A
TM
reduces to
L
. The Turing
machine that computes the reduction is the following:
M
R
=
“On input
< M, w >
:
1. Construct Turing machine
M
0
:
M
0
=
“On input
x
:
1. Simulate
M
on
w
. If
M
accepts, accept.”
2. Let
p
and
q
be, respectively, the start and accept states of
M
0
.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 Ib
 N ELBA

Click to edit the document details