1.
|
(a) Describe L(G1), the language generated by this grammar. That is, provide a precise characterization of the terminal strings that can be derived from S. (You need not use mathematical notation; it suffices to state a simple condition, using natural language, that is met by all, and only, the strings derivable from S.)
(b) Demonstrate that G1 is ambiguous (by showing two non-identical derivation trees that have the same "yield").
2.
|
Describe L(G2), the language generated by this grammar. That is, provide a precise characterization of the terminal strings that can be derived from S. (You need not use mathematical notation; it suffices to state a simple condition, using natural language, that is met by all, and only, the strings derivable from S.)
Following Linz's notation, nc(x) is the number of occurrences of symbol c in string x.
In other words, L5 contains precisely those bit strings in which the number of occurrences of 0 is odd and the number of occurrences of 1 is not divisible by 3.