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.
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=00111
3)divide the string z into 3 parts,U,V,W in such a way that |V|>=1 and |UV|<=2k
U=0
V=0
W=111
4)if for any value of i, UVIW belongs to L then L is regular otherwise L is not regular.
say i=3 then UViW becomes 0000111 this is not belongs to L
this is contradiction to given statement.
therefore L is not regular.
The given language is context free because we can able to write context free grammar for this:
cfg is
S-.>0S11 | A
A->0A1 | ϵ
consider the language L = { a^m b^n : m>2n}, give context free grammar and Nondeteministc pUSH DOWN AUTOMATON
Let L be the language given below. L = { a n b 2n : n ≥ 0 } = { λ, abb, aabbbb, aaabbbbbb, . . . } Find production rules for a grammar that generates L.
The languages L1 = {anbm | m = n or m = 2n } and L2 = {a n b m | n <= m <= 2n } are context free. a. Choose one of the languages and write a CFG for it. b. Write the PDA that comes from your grammar (part a). Show the first 4 moves it would make on some string in your language (of length at least 4). Be sure to show state, input, and...
Question 2. Let L be the language given below. L = {a n b 2n : n ≥ 0} = {λ, abb, aabbbb, aaabbbbbb, . . .} Find production rules for a grammar that generates L.
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.
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...
(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 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:...
determine if the language is regular, context-free, Turing-decidable, or undecidable. For languages that are regular, give a DFA that accepts the language, a regular expression that generates the language, and a maximal list of strings that are pairwise distinguishable with respect to the language. For languages that are context-free but not regular, prove that the language is not regular and either give a context- free grammar that generates the language or a pushdown automaton that accepts the language. You need...