To Prove a language is not Context Free we use Pumping Lemma for CFL.
If L is any CFL and z
L
such that |z|
n, if z
= uvwxy
L (
|uvx|
|z| ,
|vx| != 0)
then uviwxiy
L ,
i
0.
Every CFL satisfies pumping lemma.
Now consider z = abbbbaabbbaaaaaa
take u = a, v = bbbb, w = aa, x = bbb, y = aaaaaa
Here in uviwxiy take i = 2 now it will bw uv2wx2y
Hence uv2wx2y = a(bbbb)2aa(bbb)2aaaaaa = abbbbbbbbaabbbbbbaaaaaa
Now in this string it is saying that longest run of a's in w is shorter than any run of b's in w.
This is a contradiction, Hence this Language is not CFL.
Consider the language L _ {w E {a,b)' : the longest run of a's in u,...
1. Construct a DFSM to accept the language: L = {w € {a,b}*: w contains at least 3 a's and no more than 3 b's} 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 ', let W denote the string w with the...
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...
Show L = { w | w is an element of {a, b, c, d, e, f}* such that the number of a's + number of b's = number of c's + number of d's = number of e's + number of f's } is not context-free
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:...
Question 1. Let S = {a,b}, and consider the language L = {w E E* : w contains at least one b and an even number of a's}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a”62m : n > 0} = {1, abb, aabbbb, aaabbbbbb, ...} Find production rules for a grammar that generates L.
Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...
Could you please help me with this question? Consider the language C = { w ∈ {a, b} ∗| w contains at least as many as as bs } For example, ǫ, aaa, aba, and bbaababaa are all in C, but bbb and bbaaabb are not. a. Construct a 3-state push-down automaton to recognise C. Provide the solution as a transition diagram. b. Prove formally that the following context-free grammar G generates C S → ǫ | a | a...
AUTOMATA Given the language L, L = {w | w ∈ {a, b}* and w starts and ends with the same symbol} (a) Define the context free grammar G that generates the formal language L. (b) Define the deterministic pushdown automaton A that recognize the formal language L.
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 ∈...