retagged by
3,816 views
3 votes
3 votes

Let

  • $l1 =\{ 0^{n+m} 1^n 0^m \mid n,m>= 0 \}$,
  • $l2 = \{ 0^{n+m} 1^{n+m} 0^m \mid n,m>=0 \}$ ,
  • $l3 = \{ 0^{n+m} 1^{n+m} 0^{n+m} \mid n,m>=0 \}$

Which of these languages are NOT context free? Solve this question with explanation Thank you

retagged by

1 Answer

Best answer
9 votes
9 votes

l1 : This language is context free as we can push all the zeros on the stack and when 1 comes we can pop a 1, after that when 0 comes we can again pop the zeros from the stack. If stack is empty the string is accepted else can't.
l2 : This is not context free language as if we push all the initial zeros on the stack and start to pop for each 1, we can't compare the m number of zeros at the last.
l3 : This is not context free language. (same reason as for l2).

selected by

Related questions

2 votes
2 votes
0 answers
3
shekhar chauhan asked Jul 5, 2016
743 views
Among these languages which is/are Context free Language and has Context Free Grammar ? please Explain the reason a little bit .1 .LISP2 .C-Language3 .C++ Language4 .Cobo...