pumping lemma for regular languages:
1)assume given language is regular and there exist a finite automata with 2k states.
2)take a valid string z from L.
z=001010
3)divide the string z into 3 parts,U,V,W in such a way that |V|>=1 and |UV|<=2k
U=0010
V=1
W=0
4)if for any value of i, UVIW belongs to L then L is regular otherwise L is not regular.
say i=2 then UViW becomes 0010110 this is not belongs to L
this is contradiction to given statement.
therefore L is not regular.
6. [5 points] Let Lo be the language over { = {0,1} consisting of strings having...
1(a)Draw the state diagram for a DFA for accepting the following language over alphabet {0,1}: {w | the length of w is at least 2 and has the same symbol in its 2nd and last positions} (b)Draw the state diagram for an NFA for accepting the following language over alphabet {0,1} (Use as few states as possible): {w | w is of the form 1*(01 ∪ 10*)*} (c)If A is a language with alphabet Σ, the complement of A is...
John Doe claims that the language L, of all strings over the alphabet Σ = { a, b } that contain an even number of occurrences of the letter ‘a’, is not a regular language. He offers the following “pumping lemma proof”. Explain what is wrong with the “proof” given below. “Pumping Lemma Proof” We assume that L is regular. Then, according to the pumping lemma, every long string in L (of length m or more) must be “pumpable”. We...
4. Let = {0,1} and let A denote a language of strings that consist solely of zeroes, or ones. For example, strings 000 and 11 belong to A, whereas 11101 is not. a) Draw a state diagram of an NFA that recognizes A. b) How many states you need with an DFA to the same task?
(d) Let L be any regular language. Use the Pumping Lemma to show that In > 1 such that for all w E L such that|> n, there is another string ve L such that lvl <n. (4 marks) (e) Let L be a regular language over {0,1}. Show how we can use the previous result to show that in order to determine whether or not L is empty, we need only test at most 2" – 1 strings. (2...
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...
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:...
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(a"b'am I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown...
Problem 3.3: For a string x € {0,1}*, let af denote the string obtained by changing all 0's to l's and all l's to O's in x. Given a language L over the alphabet {0,1}, define FLIP-SUBSTR(L) = {uvFw: Uvw E L, U, V, w € {0, 1}*}. Prove that if L is regular, then FLIP-SUBSTR(L) is regular. (For example, (1011)F = 0100. If 1011011 e L, then 1000111 = 10(110) F11 € FLIP-SUBSTR(L). For another example, FLIP-SUBSTR(0*1*) = 0*1*0*1*.)...
1. Construct a DFSM to accept the language: L w E ab): w contains at least 3 as and no more than 3 bs) 2. Let E (acgt and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg. ge. Construct both a DFSM to accept the language and a regular expression that represents the language. 3. Let ab. For a string w E , let w denote the string w with the...
For a string s ∈ {0, 1} let denote the number represented by in the binary * s2 s numeral system. For example 1110 in binary has a value of 14 . Consider the language: L = {u#w | u,w ∈ {0, 1} , u } , * 2 + 1 = w2 meaning it contains all strings u#w such that u + 1 = w holds true in the binary system. For example, 1010#1011 ∈ L and 0011#100 ∈...