1. (12 points) Consider the following context-free grammar G and answer the following questions. S A1B...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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}. 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}.
Expert Answer:
Answer rating: 100% (QA)
1 Consider the following contextfree grammar G G V R S where Variables V S A B Terminals 0 1 c Start ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A client of yours has decided to take their CPP retirement pension early at the age of 60. Assuming they are entitled to a CPP Pension of $1,306.58 at normal retirement age, what will their pension...
-
North Mountain's currrent ratio is 148 It is considering issuing $ 31 million in bonds to purchase a new manufacturing facility Its current liabilities are $ 34 million but the new debt would...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Consider a static (one-period), closed economy with one representative consumer, one rep- resentative firm, and a government. The level of capital K and government expenditures G in the economy are...
-
The work function for metallic cesium is 2.14 eV. Calculate the kinetic energy and the speed of the electrons ejected by light of wavelength (a) 700 nm, (b) 300 nm.
-
Suppose that desirable producer's risk is 3% and consumer's risk is 6%. Which of the plans described in Exercises 10-15 and 10-16 are preferable? Discuss your choice.
-
Two of the pumps in Fig. P12.24 are operated in series to supply water through the piping system. Determine the flow rate through the piping system for \(10^{\circ} \mathrm{C}\) water and screwed...
-
What types of mechanisms can be used to help increase collaboration across business and IS leaders?
-
Jamie Lee Jackson, age 27, full-time student and part-time bakery employee, has just moved into a bungalow-style, unfurnished home of her own. The house is only a one-bedroom, but the rent is...
-
The Scottie Sweater Company produces sweaters under the "Scottie" label. The company buys raw wool and processes it into wool yarn from which the sweaters are woven. One spindle of wool yarn is...
-
The following information was extracted from the accounting records of Mobifone Limited on 31 December 2021, the end of the financial year: MOBIFONE LIMITED STATEMENT OF FINANCIAL POSITION AS AT 31...
-
a. Active Auto Inc. manufactures electronic components in the Vietnam. Active Auto Inc. sells 300 of Z-model electronic devices to a company in Malaysia. The total price for these devices is...
-
3. Given the matrix S= = [ = 11 36 -3 -10 6] a) Compute for its eigenvalues and their corresponding eigenvectors. (Select eigenvectors with the smallest possible whole number entries). [6pts] b) Let...
-
On January 1, 2023, GADI Inc. sold a large piece of equipment to a client for $1,363,000. Rather than pay cash, the client issued a 4 year, zero-interest bearing promisory note with a face value of...
-
One year ago, a stock was selling for $ 1 1 . 5 6 per share. Assume that you sold short 1 0 0 shares at that time using a 6 0 % margin account. Based on the current price of $ 9 . 4 9 5 , what would...
-
With all of the choices customers have today when they dine out, it is important to understand the market that you are pursuing as your customer base. Ask yourself the questions listed below and...
-
Precarious Lunch A uniform steel beam of length I and mass m is attached via a hinge to the side of a building. The beam is supported by a steel cable attached to the end of the beam at an angle 0,...
-
You are a Loan Officer with an Investment Bank. Today you need to set your lending parameters. They are: LTV: 55% 10 Year T-Bill: TBD Rate Markup: 300 Basis Points Term: 30 Years Amortization: 30...
-
Mallory Corporation has a calendar year-end. The corporation has paid estimated payments of $10,000 during 2012 but still owes an additional $5,000 for its 2012 tax year. a. When is the 2012 tax...
-
During 2012, Tom sold Sears stock for $10,000. The stock was purchased 4 years ago for $13,000. Tom also sold Ford Motor Company bonds for $35,000. The bonds were purchased 2 months ago for $30,000....
-
Kathy Kennedy (age 44) is a single taxpayer and she lives at 212 North Pine Way, Payson, AZ 85541. Her Social Security number is 467-98-9784. Kathy's earnings and income tax withholding as the...
-
Scores for the California Peace Officer Standards and Training test are normally distributed, with a mean of 50 and a standard deviation of 10. An agency will only hire applicants with scores in the...
-
1. Find the z-score that corresponds to a cumulative area of 0.3632. 2. Find the z-score that has 10.75% of the distributions area to its right.
-
Find the z-score that corresponds to each percentile. 1. P 5 2. P 50 3. P 90
Study smarter with the SolutionInn App