
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

22C:185 — Fall 2004
Homework I
1. [15 points]
Taking S = {0,1} and start = S in the BNF
show derivation trees for each of the following
(a) 001011
(b) 10111001
(c) 10011100
2. [10 points]
Taking S = {a,b} and start = S in the BNF below, show two distinct derivation trees for the
string aab.
S ::= aSB | e
B ::= bB | e
3. [10 points]
Consider the two grammars G 1
(start=W) and G 2
(start=Y) below with S = {a,b,c}. Determine
whether or not they are equivalent (i.e., L(G 1
2
) and prove your answer.
1
2
W ::= Wc | X Y ::= aY | Z
X ::= aXb | e Z ::= bZc | e
4. [20 points]
Determine whether each of the following identities is true for all languages L 1
2
, and
justify your answers.
(a) (L 1
2
(b) (L 1
2
(c) ∅
(d) (L 1
2