Consider the grammar S → ABCc ∣ Abc BA → AB Bb → bb Ab → ab Aa → aa Which of…
2008
Consider the grammar
S → ABCc ∣ Abc
BA → AB
Bb → bb
Ab → ab
Aa → aa
Which of the following sentences can be derived by this grammar?
- A.
abc
- B.
aab
- C.
abcc
- D.
abbc
Attempted by 42 students.
Show answer & explanation
Correct answer: A
The corrected first line of the grammar is S → ABCc ∣ Abc. For the listed options, use the branch S → Abc. Applying Ab → ab gives S ⇒ Abc ⇒ abc. Therefore, abc can be derived, so Option A is correct.