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

  1. A.

    4

  2. B.

    7

  3. C.

    5

  4. 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.

Explore the full course: Niacl Ao It Specialist