Question

Design a non-ambiguous grammar generating the language consisting of all binary strings, which contain an odd...

Design a non-ambiguous grammar generating the language consisting of all binary strings, which contain an odd number of 0’s and an odd number of 1’s. Justify correctness of your construction.

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

Answer :

C → 0B | 1A

P → 0A | 1B | ε

A → 0P | 1C

B → 1P | 0C

Explanation :

Example string to parse the grammar : 010101

C -> 0B

-> 01P

-> 010A

-> 0101C

-> 01010B

-> 010101P

-> 010101

Add a comment
Know the answer?
Add Answer to:
Design a non-ambiguous grammar generating the language consisting of all binary strings, which contain an odd...
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