This preview shows pages 1–2. Sign up to view the full content.
CS 360: Introduction to the Theory of Computing
John Watrous, University of Waterloo
Solutions to Quiz 3
Question 1.
DeFne a language
A
⊆ {
0
,
1
,
#
}
*
as follows:
A
=
b
x
#
yx
R
:
x,y
∈ {
0
,
1
}
*
B
.
Give the state transition diagram of a PDA that recognizes
A
.
Solution.
Here is one suitable PDA:
q
0
q
1
q
2
q
f
0
,Z
0
/
0
Z
0
1
,Z
0
/
1
Z
0
0
,
0
/
00
1
,
0
/
10
0
,
1
/
01
1
,
1
/
11
#
,Z
0
/Z
0
#
,
0
/
0
#
,
1
/
1
0
,
0
/ε
1
,
1
/ε
0
,Z
0
/Z
0
1
,Z
0
/Z
0
0
,
0
/
0
1
,
0
/
0
0
,
1
/
1
1
,
1
/
1
ε,Z
0
/Z
0
ε,
0
/
0
ε,
1
/
1
ε,Z
0
/ε
Question 2.
Short answer questions.
a.
Draw the state transition diagram for a 1DTM that runs forever on all inputs. Assume the input
alphabet is
{
0
,
1
}
.
Solution.
Here is one suitable answer:
q
0
0
/B
←
1
/B
←
B/B
←
b.
Consider the following language, which is not contextfree:
L
=
{
r
1
s
1
t
:
r,s,t
∈ {
0
,
1
}
*
,

r

=

s

=

t
}
.
If we were to prove that
L
is not contextfree using the Pumping Lemma for Context±ree Lan
guages, we might start like this:
Assume toward contradiction that
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.
This note was uploaded on 09/22/2011 for the course CS 360 taught by Professor Johnwatrous during the Spring '08 term at Waterloo.
 Spring '08
 JohnWatrous

Click to edit the document details