1. Engineering
  2. Computer Science
  3. 3 consider the contextfree grammar s p a b c...

Question: 3 consider the contextfree grammar s p a b c...

Question details

3. Consider the context-free grammar (S, P), a, b, c), R, S) where R is this set of rules: SaPa (a) Write down a derivation tree for the string ccaabab (b) Argue that there cannot be a derivation tree for any string starting with b (c) (A little harder.) Argue that the length of any derivable string (of terminals only) must be of the form 3n + 1 (i.e., 1, 4, 7, 10 etc.).

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution