You are on page 1of 1

Workout Problems Date: 18-09-2014

1. Let G=(V,T,P,S) be a CFG where P are:

S→S(E)|E

E→(S)E|0|1|ϵ

Now consider a string w ϵ L (G). Check whether this G is ambiguous or not.

2. Give me an example production for L (G) should be inherently ambiguous.


(Def: A CFL is inherently ambiguous if every CFG for L is ambiguous.)

3. Construct PDAs that accept each of the following languages.


a) {aibj | 0 ≤ i ≤ j}
b) {aicjbi | i, j ≥ 0}
c) {aibjck | i + k = j}
d) {w | w ∈ {a, b}* and w has twice as many a’s as b’s}
e) {aibi | i ≥ 0} ∪ a* ∪ b*
f) {aibjck | i = j or j = k}
g) {aibj | i ≠ j}
h) {aibj | 0 ≤ i ≤ j ≤ 2i}

You might also like