. Any string of terminals that can be generated by the following CFG- S -> XY X -> aX | bX | a Y -> Ya | Yb | a
For example : S -> XY S -> aXYb //by replacing X -> aX and Y -> Yb, you can replace any one you want. S -> aaab //by replacing X -> a and Y-> a, you can also here replace with any one you want. And you see I didn't replace 'a' and 'b' (I mean the small letters) because they are terminals, and you can't replace them. Good luck.
@ktobah Thanks for your excellent answer here. In the future, if you get the opportunity, try to engage the asker and have them work through it with you. We're trying to push people towards that type of "tutoring" interaction instead of just getting their answer. Thanks. :)
Granted, I'm aware that not all CS questions lend themselves to that, but I think this would could because it's a CFG question that has multiple steps instead of a simple "what is this" question.
Ah ok, well I thought the comments that I wrote are to explain well to the asker, and I didn't give him the complete answer, I just gave an example (the asker need to do another example then try to conclude with language is described by this grammar), but anyway I will take your remark in consideration, Thank you.
Hm, ok, fair enough. And yes, you did an excellent job of explaining what you did. I was pleased with that. Just making a friendly note where I can. Cheers. :)
Haha it's okay, I don't mind you are welcome, and thanks.
Join our real-time social learning platform and learn together with your friends!