This preview shows pages 1–2. Sign up to view the full content.
Assignment 6 Answer Key
2.4b
A > 0B0  1B1  є
B > 0B  1B  є
2.4c
A > 0B  1B
B > 00B  01B  10B  11B  є
2.4e
A > 0A0  1A1  B
B > 0  1  є
2.9
S > TU  VW
T > aTb  є
U > Uc  є
V > Va  є
W > bWc  є
It is ambiguous because there are multiple ways to generate certain grammars, such as those
where i=j=k.
Consider aabbcc:
S>TU> aTbU > aaTbbU > aabbU > aabbUc > aabbUcc > aabbcc
S>VW> VbWc > VbbWcc > Vbbcc > Vabbcc > Vaabbcc > aabbcc
Diagram Problem
2.13 a
It is a string with either a string with a single # which has
n
0s on the left and
2n
0s on the
right or a string with
two
#s and
any
number of 0s before, between and after the
two
#s.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document 2.13 b
Suppose L were regular. Let p be the pumping length given by the pumping lemma.
Consider the string w
p
= 0
p
#0
2p
Clearly, w
p
 >= p and w
p
is in L. So, by the pumping lemma, there must be some choice of
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 02/07/2011 for the course CS 501 taught by Professor Sm during the Spring '11 term at Indiana.
 Spring '11
 sm

Click to edit the document details