Consider the language L = {w|w {0, 1}*, #0 (w) = #1 (w)}, here #30(w) and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the language L = {w|w {0, 1}*, #0 (w) = #1 (w)}, here #30(w) and #1(w) means the numbers of Os and 1s in w respectively. That is, this is the language consisting of all strings with as many 1s as 0s: for example, 1010 L, 01101 & L. In this problem we will show how to construct a context-free grammar for it. 1. (8 points) For a length n word x, we define a function f (i) = (number of Os in locations [1...i]) (number of 1s in locations [1...]). Show that we have f(i) = f(j) for some i < j if and only if the substring in indices [i + 1, . . . j] has as many 1s as Os (i.e. Xi+1,i+2,... EL). 2. (8 points) Show that if x E L starts with 0, then it can be written as x = Owly where w, and y are each strings with as many 1s as Os (aka. w, y L). 3. (8 points) Give a context free grammar for this language L. Consider the language L = {w|w {0, 1}*, #0 (w) = #1 (w)}, here #30(w) and #1(w) means the numbers of Os and 1s in w respectively. That is, this is the language consisting of all strings with as many 1s as 0s: for example, 1010 L, 01101 & L. In this problem we will show how to construct a context-free grammar for it. 1. (8 points) For a length n word x, we define a function f (i) = (number of Os in locations [1...i]) (number of 1s in locations [1...]). Show that we have f(i) = f(j) for some i < j if and only if the substring in indices [i + 1, . . . j] has as many 1s as Os (i.e. Xi+1,i+2,... EL). 2. (8 points) Show that if x E L starts with 0, then it can be written as x = Owly where w, and y are each strings with as many 1s as Os (aka. w, y L). 3. (8 points) Give a context free grammar for this language L.
Expert 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
-
Developments in Technology Light is incident from air on the end face of a multimode optical fibre at angle of incidence as shown below. n n 1 2 The refractive indices of the core and cladding are...
-
Write an alternative definition that is tail-recursive (iterative) and makes use of accumulator variables. [10 marks] Explain why your alternative definition executes more efficiently. [3 marks] 1...
-
What is true of a balance sheet? Question 6Answer a. The equation used in a balance sheet is Assets = Liabilities + Net Assets b. The equation used in a balance sheet is Assets = Net Assets =...
-
The drawing shows box 1 resting on a table, with box 2 resting on top of box 1. A massless rope passes over a massless, frictionless pulley. One end of the rope is connected to box 2, and the other...
-
Reread the Management Focus on Vizio and answer the following questions: a. Why is the manufacturing of flat-panel TVs migrating to different locations around the world? b. Who benefits from the...
-
For a binary system comprising two miscible non-reacting components in vapour-liquid equilibrium forming an azeotrope, the number of degrees of freedom is (a) 0 (b) 1 (c) 2 (d) 3 .
-
For each engagement described below, indicate whether the engagement is likely to be conducted under international auditing standards, U.S. generally accepted auditing standards, or PCAOB auditing...
-
4)The boom as shown is held by a cord which is attached 3/4 of the way up the boom. If the tension in the cord is 720 N, what is the weight of the boom? cord 5) What is the tension in the cord? cord...
-
Ryan Ross (111-11-1112), Oscar Omega (222-22-2222), Clark Carey (333-33-3333), and Kim Kardigan (444-44-4444) are equal active members in ROCK the Ages LLC. ROCK serves as agents and managers for...
-
What are some opportunities for IT projects under the project organizational structure? Describe the matrix organizational structure. What are some challenges for IT projects under the matrix...
-
If the engine fails, a typical single - prop airplane will descend at an angle of - 4 . 7 5 \ deg below horizontal. If the engine fails at an altitude of 1 0 0 0 . 0 ft . , how far can the plane...
-
Consider a long, cylindrical charge distribution of radius R with a uniform charge density p. Find the electric field at distance r from the axis, where r < R. (Use any variable or symbol stated...
-
when Judy adds 1 . 0 kg of unknown liquid at a temperature of 2 5 \ deg c to 2 . 0 kg of water at a temperature of 4 5 \ deg c , the final temperature of the mixture is 4 0 \ deg c , assuming no loss...
-
A 1500 kg car goes from 20.0 m/s to 8.33 m/s in 5.0 s. Calculate the acceleration and the force on the car? (i). (ii). How long does it take for the car to come to a complete stop
-
Ivanhoe Inc. made a $23000 sale on account with the following terms: 1/15, n/30. If the company uses the net method to record sales made on credit, how much should be recorded as revenue?
-
What is the difference between objective and subjective claims Give real life examples of each dealing directly with recent legislation that is being covered in the news media. Assignment: 1. Define...
-
Determine the center and radius of each circle. Sketch each circle. 4x 2 + 4y 2 9 = 16y
-
On February 2, 2012, Alexandra purchases a personal computer for her home. The computer cost $3,000. Alexandra uses the computer 80 percent of the time in her accounting business, 10 percent of the...
-
Carol Harris, Ph.D, CPA, is a single taxpayer and she lives at 674 Yankee Street, Durham, NC 27409. Her Social Security number is 793-52-4335. Carol is an Associate Professor of Accounting at a local...
-
Ken (age 31) and Amy (age 28) Booth have brought you the following information regarding their income, expenses, and withholding for the year. They are unsure which of these items must be used to...
-
A system consisting of a gas confined in a cylinder undergoes a series of processes shown in Fig. 2.4. During the process A-1-B, \(60 \mathrm{~kJ}\) of heat is added while it does \(35 \mathrm{~kJ}\)...
-
What is internal energy? Prove that internal energy is a state function.
-
\mathrm{~kg}\) of water is vaporized in a container at the constant temperature of \(373 \mathrm{~K}\) and the constant pressure of \(1,01,325.0 \mathrm{~N} / \mathrm{m}^{2}\). The specific volume of...
Study smarter with the SolutionInn App