2,669 views
4 4 votes
Let A and B be two languages over alphabet  ∑ . which of the following are true ?  (more than one options may be correct)

(a) if A is regular and B is CFL then A∩B is also CFL.

(b) if A is regular and B is CFL then A∪B is also CFL.

(c) if A is not CFL  and B is CFL then A∩B will not be a CFL.

(d) if A is not CFL  and B is CFL then A∪B will not be a CFL.

2 Answers

1 1 vote

1. True

A trivial example is that A∗ is regular, and if L is context-free but not regular then

 L∩A∗=L

is context-free but not regular.

So L ∩A is CFL.

https://cs.stackexchange.com/questions/18642/intersection-of-context-free-with-regular-languages

2. True. We cannot get non cfl by this intersection.

3. Neednt be non cfl. Phi intersection any non cfl = phi, which is CFL.

4. False.

Phi union non cfl is phi which is CFL.

 

0 0 votes
For D:-

 if A is not CFL  and B is CFL then A∪B will not be a CFL.

A= $a^nb^nc^n$:- Its not CFL

B= Sigma*

A union B=Sigma* which is regular hence CFL

So it can be CFL

For C:-

A= $a^nb^nc^n$ :- Its not CFL

B= phi

A intersection B is phi,which is regular hence CFL,

These are just counter examples to prove c and d are false.

A and b are true
Position:
Show:

Related questions

5 5 votes
1 1 answer
1.7k
1.7k views
Parshu gate asked Nov 16, 2017
1,673 views
Let L={ai bj ck ┤|if j is odd then i=k} where i,j,k>0. Which of the following option is true about L? L is CSL but not CFL L is CFL but not DCFL L is regular L is DCF...
1 1 vote
1 1 answer
1.4k
1.4k views
0 0 votes
0 0 answers
813
813 views
saptarshiDey asked Jan 22, 2019
813 views
L = {a^(p+q) b^(p+q) a^p , p,q>=0}Which one of the following is true about L?L is a regularL is CFL but not regularL is not a CFL
0 0 votes
0 0 answers
163
163 views
lambodar_pal asked Jul 27
163 views
The intersection of a context free language and a regular languagea)need not be regularb)need not be context freec) is always regulard) is always context free