4,523 views
1 votes
1 votes
Let L = {0n1n | n≥0} be a context free language.
Which of the following is correct?
(A) L’ is context free and Lk is not context free for any k≥1
(B) L’ is not context free and Lk is context free for any k≥1
(C) Both L’ and Lk is for any k≥1 are context free.
(D) Both L’ and Lk is for any k≥1 are not context free.

Official answer given by UGC is C . according to me answer is B 

2 Answers

Best answer
1 votes
1 votes

option 3 is correct complement of L1  will also have strings like  L = 1n0n                                          in general we can make a CFG of complement of  L = {0n1n | n≥0} as below

S → T | aU | V b

T → aT | T a | bT | T b | ba

U → aU | W

V → V b | W

W → aW b | λ

and  L = {0n1n | n≥0} is also context free (push 0 and pop 1 into stackand at last we have empty string)

so both L1 and L2  are context free

selected by
0 votes
0 votes
given L={0^n 1^n | n≥0}
complement of L = L1 U L2
where L1={not of form 0^i 1^j } and L2={0^i 1^j , i≠j } for i>0,j>0.

now complement of L1 = {of the form 0^i 1^j  } so it will be regular as automata can read all 0's and then all 1's in next state. L1 will also be regular as L1' is regular(regular lang closed under complement).so if L1 is regular it is also CFL.

L2 = L3 U L4
where L3 = {0^i 1^j , i>j } and L4= {0^i 1^j , i<j }

grammar for L3(more 0's then 1's) will be S → AS1 , A → aA|a , S1→ aS1b|λ
similarly can be done for L4

so L3,L4 are CFL then under union L2 will also be CFL.

so L' = L1 U L2 will be CFL

https://www.youtube.com/watch?v=9pDdSxxJJ-k&list=PLbMVogVj5nJSd25WnSU144ZyGmsqjuKr3&index=28
watch from 28 : 00
edited by

Related questions

2 votes
2 votes
2 answers
3
admin asked Apr 2, 2020
871 views
The average search time of hashing, with linear probing will be less if the load factoris far less than oneequals oneis far greater than onenone of these
1 votes
1 votes
2 answers
4
admin asked Mar 31, 2020
2,706 views
The degree of multi programming is controlled by:CPU SchedulerLong-term SchedulerContext SwitchingMedium term Scheduler