Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (12 points) Consider the following context-free grammar G and answer the following questions. S A1B A 0A | B B1 | (a) What

1. (12 points) Consider the following context-free grammar G and answer the following questions. S  A1B A  0A

1. (12 points) Consider the following context-free grammar G and answer the following questions. S A1B A 0A | B B1 | (a) What are the variables, terminals, and the start variable of G? (b) For each of the following, answer True or False i. S 00011 ii. S=> 10101 (c) For the string 00111, give both the leftmost derivation and the parse tree. (d) What language does this grammar generate? 2. (12 points) Consider the following grammar SaS aSbS This grammar is ambiguous. Show in particular that the string aab has two: (a) Leftmost derivations. (b) Parse trees. 3. (12 points) Design CFGs for the following languages. (a) {amn | n 0,m 1}. (b) {w | w * and w=w, where w is the reverse of w}. Here = {a,b}. For example, abba, bab, and baab are all in the language, but bbaa is not. Note that e is also in the language. (c) {abek |i=jor i = k, where i, j, k 0}.

Step by Step Solution

3.29 Rating (152 Votes )

There are 3 Steps involved in it

Step: 1

1 Consider the following contextfree grammar G G V R S where Variables V S A B Terminals 0 1 c Start ... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions

Question

What is the equation of a straight line?

Answered: 1 week ago

Question

In Exercises 32-37, find the values of x and y. 43 75

Answered: 1 week ago

Question

BPR always involves automation. Group of answer choices True False

Answered: 1 week ago