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 =...
-
A block is pressed against a vertical wall by a force , as the drawing shows. This force can either push the block upward at a constant velocity or allow it to slide downward at a constant velocity....
-
Tater Tot Ltd.'s adjusted trial balance amounts appear in alphabetical order as follows on December 31, 2012, the end of its fiscal year: Additional information: 1. Tater Tot uses a periodic...
-
Plaintiff purchases a new car that has defects in its paint job. Three times the dealership repaints the care, but to no avail. The plaintiff continues to drive the car as he has no other option in...
-
Padre, Inc., buys 80 percent of the outstanding common stock of Sierra Corporation on January 1, 2015, for $802,720 cash. At the acquisition date, Sierras total fair value, including the...
-
Using less human effort, less manufacturing space, less investment in tools, and less engineering time is the basic premise of Blank______. Multiple choice question. flexible manufacturing mass...
-
John Parsons (123-45-6781) and George Smith (123-45-6782) are 70% and 30% owners, respectively, of Premium, Inc. (11-1111111), a candy company located at 1005 16th Street, Cut and Shoot, TX 77303....
-
A cylinder of internal radius a and external radius b = 1.3a is subjected to an internal pressure p. Determine for stress state (MPa) (or, de, tre) at inner surface. Take p = 20 MPa. (A) 20.0, 61.7,0...
-
ABC Corporation, a leading multinational company, has embraced sustainability as a core value and is committed to integrating sustainability practices into its business operations. As part of this...
-
ASSESSMENT TASKS EXERCISE 3 Page 8 6. Using information from Unit 10 or your own research, please answer a), b), and c) below. [3 Marks] a) Outline how you would undertake cold calling successfully....
-
Discuss the various types of communication styles you have seen in your field placement. How does your field placement agency effectively communicate at the various levels of service and why?
-
The Regulatory Framework Quiz Interpreting financial services compliance legislation, professionalism, the Code and good conduct Question: You are a financial adviser at Aotearoa Bank. You meet with...
-
BRAND EQUITY Ariel Research, a market research company, had just collected a large dataset from a random sample of Canadian consumers. This data set contained 125,000 entries on different brands of...
-
How asymmetric information and moral hazard affect the Good Friday Agreement (Ireland Border Treaty) and the UK- Europe negotiations over Brexit?
-
For Problem estimate the change in y for the given change in x. y = f(x), f'(12) = 30, x increases from 12 to 12.2
-
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...
-
To what extent are the arguments for countries specialising and then trading with each other the same as those for individuals specialising in doing the jobs to which they are relatively well suited?
-
The following are four items that are traded internationally: wheat; computers; textiles; insurance. In which one of the four is each of the following most likely to have a comparative advantage:...
-
What is the relationship between the balance of payments and the rate of exchange?
Study smarter with the SolutionInn App