Question

Question 1 Consider CFG: A => OA1A01 epsilon, Which of these strings can be generated with this grammar? 001100 0011 00100 01
0 0
Add a comment Improve this question Transcribed image text
Answer #1

All the options are correct we can derive each option using the grammar given.

Option 1-

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 0A 0A 00A
A → 1A 00A 001A
A → 1A 001A 0011A
A → 0A 0011A 00110A
A → 0 00110A 001100

OR

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 0A 0A 00A
A → 1A 00A 001A
A → 1A 001A 0011A
A → 0A 0011A 00110A
A → 0A 00110A 001100A
A → ɛ 001100A 001100

Option 2-

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 0A 0A 00A
A → 1A 00A 001A
A → 1 001A 0011

Or

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 0A 0A 00A
A → 1A 00A 001A
A → 1A 001A 0011A
A → ɛ 0011A 0011

Option3-

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 0A 0A 00A
A → 1A 00A 001A
A → 0A 001A 0010A
A → 0 0010A 00100

Or

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 0A 0A 00A
A → 1A 00A 001A
A → 0A 001A 0010A
A → 0A 0010A 00100A
A → ɛ 00100A 00100

Option 4-

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 1A 0A 01A
A → 1A 01A 011A
A → 0 011A 0110

Or

Rule Application Result
Start → A Start A
A → 0A A 0A
A → 1A 0A 01A
A → 1A 01A 011A
A → 0A 011A 0110A
A → ɛ 0110A 0110

Note: In each case, ambiguity arises as we can derive each option in two ways.

Add a comment
Know the answer?
Add Answer to:
Question 1 Consider CFG: A => OA1A01 epsilon, Which of these strings can be generated with...
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