How many steps are required to construct a string abbbb from the grammar given…
2023
How many steps are required to construct a string abbbb from the grammar given by using right most derivation?
S -> aAB A -> bBb B -> A/E
- A.
4
- B.
7
- C.
5
- D.
6
Attempted by 68 students.
Show answer & explanation
Correct answer: D
One rightmost derivation is S -> aAB -> aAA -> aAbBb -> aAbb -> abBbbb -> abbbb. This uses 6 production applications.