281 views

1 Answer

0 votes
0 votes

What I did is,

Take S->aA;

then for A->aAA;

and from now on, to have minimum length string, put appropriate productions,

for 1st A, A->b and for 2nd A, A->bS;

and then S->bB; B->a; (here to have min string, I just use B ->a rather than bBB | aS, which led to longer string)

All the bold letters denote string, which is "aabbba".

Please correct me if I'm wrong and share your approach too!

 

No related questions found