Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following simple language L. It consists of all sequences that have at least one 0, then at least one 1, and again

Consider the following simple language L. It consists of all sequences that have at least one 0, then at-> ->00 11 | 01 ->11 00|10 -> ->0 |0 ->14|1 -> ->0 1|01 ->1 0 | 10 a) Does the grammar you selected ambiguous

Consider the following simple language L. It consists of all sequences that have at least one 0, then at least one 1, and again at least one 0, and the total number of zeroes and ones is the same. For example: 001111110000 is in L 00111111000 is not in L: too few zeroes 00110110 is not in L: there is a zero inside ones Now consider three grammars, one of which defines this language correctly. Each grammar has two terminal symbols, 0 and 1, and the start/goal symbol is . The language is correctly defined by: -> ->00 11 | 01 ->11 00|10 -> ->0 |0 ->14|1 -> ->0 1|01 ->1 0 | 10 a) Does the grammar you selected ambiguous or not? Explain A B b) Give the top down derivation for the following sentence: 011100 Consider the following simple language L. It consists of all sequences that have at least one 0, then at least one 1, and again at least one 0, and the total number of zeroes and ones is the same. For example: 001111110000 is in L 00111111000 is not in L: too few zeroes 00110110 is not in L: there is a zero inside ones Now consider three grammars, one of which defines this language correctly. Each grammar has two terminal symbols, 0 and 1, and the start/goal symbol is . The language is correctly defined by: -> ->00 11 | 01 ->11 00|10 -> ->0 |0 ->14|1 -> ->0 1|01 ->1 0 | 10 a) Does the grammar you selected ambiguous or not? Explain A B b) Give the top down derivation for the following sentence: 011100

Step by Step Solution

3.36 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

The images youve provided describe a language L and present three different grammars labeled A B and C Language L consists of all sequences that have ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Industrial Relations in Canada

Authors: Fiona McQuarrie

4th Edition

978-1-118-8783, 1118878396, 9781119050599 , 978-1118878392

More Books

Students also viewed these Programming questions

Question

Why is the CLC called the union of unions?

Answered: 1 week ago