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, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
What is the biggest difference between section breaks and regular page breaks
Answers: 1
question
Computers and Technology, 24.06.2019 06:00
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
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, 10.12.2021 01:40
question
German, 10.12.2021 01:40
question
Mathematics, 10.12.2021 01:40
Questions on the website: 13722361