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
Answer: D. 6 — One rightmost derivation is S -> aAB -> aAA -> aAbBb -> aAbb -> abBbbb -> abbbb. This uses 6 production applications.
- A.
4
- B.
7
- C.
5
- D.
6
Attempted by 233 students.
Show answer & explanation
Correct answer: D
One rightmost derivation is S -> aAB -> aAA -> aAbBb -> aAbb -> abBbbb -> abbbb. This uses 6 production applications.
Loading lesson…