Question

2. To find a Chomsky normal form for the following grammar (10 points) STR T - aTbab R RIA first note that we dont need to a
Tb We then remove the unit production S - T. From S - T and T - aTb we get S - and from S - T and T - ab we get S - ab. So th
0 0
Add a comment Improve this question Transcribed image text
Answer #1

After removing empty production the grammar becomes:

S -> T | TR

T -> aTb | ab

R -> bR | b

After removing unit production the grammar become:

S -> aTb | ab | TR

T -> aTb | ab

R -> bR | b

For each production whose right hand side has two or more symbols we replace each terminal with new production. The grammar becomes:

S -> ATB | TR | AB

T -> ATB | AB

R -> BR | b

A -> a

B -> b

After performing the final step the CNF becomes:

S -> AU | TR | AB

T -> AU | AB

B -> BR | b

U -> TB

A -> a

B -> b

Add a comment
Know the answer?
Add Answer to:
2. To find a Chomsky normal form for the following grammar (10 points) STR T -...
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