Context free lang10

0. Following context free grammar
S —> aB | bA
A —>b | aS | bAA
B —> b | bS | aBB
generates strings of terminals that have

  • Option : A
  • Explanation :
    S → aB → aaBB → aabB → aabb
    So (b) is wrong. We have
    S → aB → ab So
    (c) is wrong.
    A careful observation of the productions will reveal a similarity. Change A to B, B to A, a to b and b to a. The new set of productions will be the same as the original set. So (D) is false and (A) is the correct answer.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *