Question

What is the language L(G) generated by the context-free grammar G given below? S -> A...

What is the language L(G) generated by the context-free grammar G given below?

S -> A | aB | bA | ε

A -> aS | bAA

B ->bS | aBB

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The language accepted by given cfg is :
L(G) = {set of all strings where number of a's is greater than or equal to number of b's}
Explanation:
prodution A generates a's 1 greater than b's//consider we use S as empty string
production B generates b's 1 greater than a's
now, from S, we can call B only through S->aB, which makes, a's and b's length equal
now, from S, we can call A using A, bA,
S->bA makes a's and b's length equal
S->A makes a's greater than b's// because, in productions of A, a's are greater than B
hence overall number of a's is greater than or equal to number of b's

Add a comment
Know the answer?
Add Answer to:
What is the language L(G) generated by the context-free grammar G given below? S -> A...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT