subject
Computers and Technology, 03.04.2020 20:06 fatty18

Consider the language L = {w |w ∈ {0, 1} ∗ , 2 × #0 (w) = #1 (w)} , here #0(w) and #1(w) means the numbers of 0s and 1s in w respectively. That is, this is the language consisting of all strings with exactly twice as many 1s as 0s: for example, 101 ∈ L, 010 ∈/ L. In this problem we will show how to construct a context-free grammar for it. (a) (2 points) For a length n word x, we define a function f (i) = (2 × number of 0s in locations [1 . . . i]) − (number of 1s in locations [1 . . . i]). Show that we have f(i) = f(j) for some i < j if and only if the substring in indices [i + 1, . . . j] has exactly twice as many 1s as 0s (i. e. xi+1,i+2,...,j ∈ L). (b) (2 points) Show that if x ∈ L starts with 0, then it can be written as x = 0w1y1z where w, y, and z are each strings with twice as many 1s as 0s (aka. w, y, z ∈ L).

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
question
Computers and Technology, 24.06.2019 13:00
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
question
Computers and Technology, 24.06.2019 17:40
File i/o activity objective: the objective of this activity is to practice working with text files in c#. for this activity, you may do all code in the main class. instructions: create an app that will read integers from an input file name numbers.txt that will consist of one integer per record. example: 4 8 25 101 determine which numbers are even and which are odd. write the even numbers to a file named even.txt and the odd numbers to a file named odd.txt.
Answers: 3
question
Computers and Technology, 24.06.2019 20:20
Write python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
Answers: 1
You know the right answer?
Consider the language L = {w |w ∈ {0, 1} ∗ , 2 × #0 (w) = #1 (w)} , here #0(w) and #1(w) means the n...
Questions
question
Mathematics, 07.03.2021 16:10
question
Health, 07.03.2021 16:10
question
Mathematics, 07.03.2021 16:10
question
English, 07.03.2021 16:20
question
Chemistry, 07.03.2021 16:20
question
Biology, 07.03.2021 16:20
Questions on the website: 13722360