934 views
4 votes
4 votes

Which of the following is not Context free language?

  1.  L={(ab)2n b3m│n>0,m>0}
  2.  L={an bm cn d2n│n≥0,m>0}
  3.  L={an bm│0≤n≤m≤2n}
  4.   L={an b2n cm│0≤n≤m}

3 Answers

0 votes
0 votes

Explanation:
i) L={(ab)2n b3m│n,m>0}is a Regular language
⇒It is a Context free language
∵L_1=(ab)2n is a Regular language
L_2=b3mis a Regular language
Concatenation of L1∙L2 is a Regular language.
(ii) L={an bm cn d2n│n≥0,m>0}
is a Context free language.
∵ S→aSdd|A
A→bAc|bcis the Context free grammar that generates the given language.
(iii) L={an bm│0≤n≤m≤2n}
is a Context free language.
∵S→aSb|aSbb|ϵ is the context free grammar that generates the language L.
(iv)L={an b2n cm│0≤n≤m}
is a Context Sensitive language.

0 votes
0 votes
  1. L={(ab)2n b3m│n>0,m>0}  is REGULAR & CFL(DFA is possible)
  2.  L={an bm cn d2n│n≥0,m>0} is CFL(in PDA push 3a's for 1a)
  3.  L={an bm│0≤n≤m≤2n} is not CFL
  4.   L={an b2n cm│0≤n≤m} is CFL (in PDA push 3a's for 1a)

No related questions found