Let L be the language of binary strings of odd length such that the middle bit is 0.
Show that L is not regular, and show that L is context-free.
Let L be the language pf binary strings odd length such that the middle bit it 0.
Let w = (0+1)n 0 (0+1)n
We note that |w| ≥ n.
Let x,y,z ∈ Σ* w = xyz such that
x = (0+1)n-2
y = (0+1)
z = (0+1) 0 (0+1)n
Checking the conditions of Pumping Lemma for Regular expressions,
1. |xy| ≤ n
2. y ≠ ∈ (or y ≥ 1)
3. for all k ≥ 0, the string xykz ∈ L.
Let k =0
xy0z = (0+1)n-2 (0+1)0 (0+1) 0 (0+1)n
xy0z = (0+1)n-2 (0+1) 0 (0+1)
xy0z = (0+1)n-1 0 (0+1)n ∉ L
Therefore, L is not regular.
We have 2 condition to be checked here :
(a) The String is of odd length
(b) The middle element is 0
If we can find mid-point in the expression even in a non-deterministic way, then it is context free language
Therefore, L is a Context Free Language.
Let L be the language of binary strings of odd length such that the middle bit...
1. Let £ = {0,1} and consider the language L of all binary strings of odd length with a 0 in the middle. Give a Turing machine that decide L.
DO NUMBER 4 AND 5
2. Let {acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E X", let W denote the string w with the a's and b's flipped. For example, for w aabbab: w bbaaba wR babbaa abaabb {wwR Construct a PDA to accept...
Write a context-free grammar for the language where all strings are of even length and the first half of the string is all 0’s, but it must be an odd number of 0’s
DO NUMBER 3
2. Let {acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E X", let W denote the string w with the a's and b's flipped. For example, for w aabbab: w bbaaba wR babbaa abaabb {wwR Construct a PDA to accept the language:...
Design a non-ambiguous grammar generating the language consisting of all binary strings, which contain an odd number of 0’s and an odd number of 1’s. Justify correctness of your construction.
Let L be the language {0n 1m : n ≤ m ≤ 2n}. Is L regular? contextfree but not regular? or not context-free? Show that your answer is correct.
Let L be a regular language on sigma = {a, b, d, e}. Let L' be the set of strings in L that contain the substring aab. Show that L' is a regular language.
Let A be the set of all bit strings of length 10. 1. How many bit strings of length 10 are there? How many bit strings of length 10 begin with 1101? How many bit strings of length 10 have exactly six 0's? How many bit strings of length 10 have equal numbers of O's and 1's? How many bit strings of length 10 have more O's than 1's? a. b. c. d. e.
Automata Theory Construct a regular expression for the set of bit strings in which every odd bit is 1. For example, these are in the language: 10 (OK: 1 in position 1) 111 (OK: 1 in positions 1 and 3) 10101 (OK: 1 in positions 1, 3, and 5) 101111 (OK: 1 in positions 1, 3, and 5) ϵ (OK: There are no odd positions) And these are not in the language: 0111 (BAD: position 1 is not a 1)...
Submit a DFA whose language is the set of strings over {a, b} of odd length in which every symbol is the same.