Show that L= {a^nb^n | n>= 0, n is not a multiple of 5} is context free.
The language is a context free.
L= {a^nb^n | n>= 0, n is not a multiple of 5}
= {anbn, n!=3p where p is an integer}
The strings correspond to the above language L = {,ab,aabb,aaabbb,aaaabbbb,aaaaaabbbbbb................}
Since the language is context free grammar we can write the CFG where the CFG must satisfy all valid strings of the language.
Context Free Grammar:
S -> aAb | aaAbb | aaaAbbb | aaaaAbbbb | ε
A ---> aaaaaAbbbbb | ε
Where
If A is epsilon it derive n = 1,2,3 and 4 are true otherwise 5p+1 or 5p+2 or 5p+3 or 5p+4 where p is any integer. If n=0 it derive S -> ε
A ---> aaaaaAbbbbb | ε
It derve ε or multiples of 5 a's and b's.
Hence proved
Show that L= {a^nb^n | n>= 0, n is not a multiple of 5} is context...
Problem 8 You can assume that L = {a"be": n > 0} is not context free. Prove the following: Show that L-ab: n20 is not context free Show that L = {w E {a,b,c,d)* : na(w) = nb(w)-ne(w) = nd(w)) is not context free Note that na(w) means the number of a's in w .
Question 3 (5 Points) Find context free grammars L = a"b",n is a multiple of three Find context-free grammars for the following languages (with n 2 0, m 2 0) ** L = {a"bm : n < m+3}. (a) (b) L= {a"bm : n = m - 1}. L = {a"bm 2m}. L {a"b" 2n < m < 3n}. (c) (d)
2. (6 pts) Use the pumping lemma for context-free languages and the string s = ap + 1 bpcP+1 to show that L (amb"cm | 0 < n < m} is not context-free. 2. (6 pts) Use the pumping lemma for context-free languages and the string s = ap + 1 bpcP+1 to show that L (amb"cm | 0
1. Show that the following languages are context-free. You can do this by writing a context free grammar or a PDA, or you can use the closure theorems for context-free languages. For example, you could show that L is the union of two simpler context-free languages. (b) L {0, 1}* - {0"1" :n z 0}
1. Show that the following languages are context-free. You can do this by writing a context free grammar or a PDA, or you can use the closure theorems for context-free languages. For example, you could show that L is the union of two simpler context-free languages. (d) L = {0, 1}* - L1, where L1 is the language {1010010001…10n-110n1 : n n ≥ 1}.
construct a context free grammar for the language l {a^nc^mb^n: n,m Greaterthanorequalto 0}
show wirk pleaee Balance the following equation: Nb + HNO, ----> Nb(NO3)+ N,0 + H20 9. Write the correct chemical formulas and balance the following equations: A. Potassium iodide plus calcium arsenate yields calcium iodide plus potassium arsenate.
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...