CS 381 HW 9
Fall 2006
Solution to Problem 1
1. We construct a turing machine that lists all possible strings in the alphabet in order
and simulates the turing machine M on each of the possible strings; the machine lists
each string accepted by M. Since M may not halt on some strings it does not accept, we
have to interleave the simulations. If w
0
,w
1
,w
2
… are the strings in the alphabet, in round
k we simulate each string w
i
i <= k for (k – i) steps; once a string is accepted, we of
course
remove that string from the list of strings to be simulated. For example, in round
1 we run M on w1 for just 1 step; then in the next round we run M on w1 for 2 steps and
on w2 for 1 step and so on.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
CS 381 Homework #9 Solutions
2.
Show that {a
n
b
n
c
n
d
n
e
n
f
n
g
n
h
n
 n
≥
1} can be written as the intersection of two context
free languages.
{ a
i
b
i
c
j
d
j
e
k
f
k
g
l
h
l
 i,j,k,l
≥
1}
I
{ a*b
m
c
m
d
o
e
o
f
p
g
p
h*  m,o,p
≥
1}
Both languages are contextfree, because only two numbers are being compared at a time
in each language.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '06
 HOPCROFT
 Halting problem, blank tape

Click to edit the document details