cs164 hw1

Let Σ={a, b} be the alphabet for the language L={waR | ur, w^R ∈{a,b}, and w has even length), where is the reverse of u. Write a context free grammar for the language L.

Consider the following grammar: $s \to|s s|$ $S \to a$ $S \to \infty$. Show that this grammar is ambiguous by finding a string that can be parsed in at least three different ways. Draw three different parse trees for this string, and write down the left-most derivation for each of the three trees.