subject

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: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Awell-diversified portfolio needs about 20-25 stocks from different categories is this true or false?
Answers: 2
question
Computers and Technology, 22.06.2019 14:10
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
question
Computers and Technology, 24.06.2019 12:40
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
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, 13.02.2021 19:50
question
Mathematics, 13.02.2021 19:50
question
Mathematics, 13.02.2021 19:50
Questions on the website: 13722359