Computers and Technology
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).

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, keviongardner
The next button in the review section shows the next available comment. next slide with no comment. previous comment. edited comment.
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, brainbean
Select all that apply. which of the following are proofreading options included in microsoft word? spell check find replace grammar check formatting check
Answers: 1
image
Computers and Technology, 23.06.2019 20:00, shadow6728g
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
image
Computers and Technology, 24.06.2019 09:00, king514
Technician a says that a new replacement part is always good. technician b says that sometimes recent repair work will be the cause of a complaint. who is correct? a. both technicians a and b b. technician a c. technician b d. neither technician a nor b
Answers: 3
Do you know the correct answer?
Consider the language L = {w |w ∈ {0, 1} βˆ— , 2 Γ— #0 (w) = #1 (w)} , here #0(w) and #1(w) means the n...

Questions in other subjects:

Konu
Computers and Technology, 27.10.2020 21:50
Konu
Mathematics, 27.10.2020 21:50
Konu
Social Studies, 27.10.2020 21:50
Konu
Mathematics, 27.10.2020 21:50