Question

Question 10 Construct a Regular grammar G = (V, T, S, P) such that L(G) = L(r) wherer is the regular expression (a+b)a(a+b).Construct a regular grammar G = {V,T,S,P} such that L(G)= L(r) where r is a regular expression (a+b)a(a+b)*.

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

Answer ----

A -> aB / bB

B -> aC

C -> aC / bC / ε

A grammar is regular if we have productions of form P->aQ or P->a or P->ε . So here in this problem we have to create regular grammar for (a+b)a(a+b)* . It means initially there can be either 'a' or 'b' then second symbol will be 'a' and then any number of a's or b's. So we first generate first symbol by A->aB / bB it means firs symbol is either 'a' or 'b' followed by non terminal B . Now this B generates aC it means second symbol is 'a'. Now C generates aC , bC or ε . It means C can generate any number of a's and b's. So above is regular expression for this given grammar.

Add a comment
Know the answer?
Add Answer to:
Construct a regular grammar G = {V,T,S,P} such that L(G)= L(r) where r is a regular...
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
ADVERTISEMENT