in Theory of Computation recategorized by
414 views
1 vote
1 vote

Consider the following language given below:

I. L1= { $p^xq^y$ |; x,y >0 }

II. L2 = {$p^xq^yp^z$ |$ x>y$ , $y\geq 0$ and $z>0$}

Which of the following is true about L1 intersection L2 ?

A)It is CSL                                                 B)It is CFL

C)It is regular                                            D)It is non regular

in Theory of Computation recategorized by
414 views

4 Comments

edited by

@Abhrajyoti00 

it should be depend upon the type of question if it is  MCQ then  right ans should be C 

and if it is MSQ then ABC all are correct

0
0

@Chandrabhan Vishwa 1 If the question is MCQ then cannot the language L={} is not CFL or not CSL ? Does the property of a language depend of the question is MCQ or MSQ ?

A correct answer is always correct answer wheather it is a MCQ or MSQ and if the answers varry depending on the question is MCQ or MSQ then hat's off to the question setter.

1
1
edited by
right
0
0

1 Answer

2 votes
2 votes
Best answer
Here ,

$L1$=$\left \{ P^{x}Q^{y}| x>0,y>0\right \}$

So, $L1$ =$\left\{PQ, P^2Q,PQ^2,P^2Q^2,......\right\}$

Simply it's any number of $P$ followed by any number of $Q$ and smallest string possible is $PQ$ . The end of every string should be $ 'Q'$ .

$L2$=$\left \{ P^{x}Q^{y}P^z| x>0,y\geq 0,z>0\right \}$

So, $L2$=$\left \{ PP,PQP,PPQQP,PPQQP,......\right \}$

Here smallest possible string is $PP$.Here every string end with P.

So if we make the intersection of $L1\cap L2=\left \{ \right \}$.

As L1 end with $Q$ and L2 end with $P$. So Intersection would be empty set.

So it is regular, CSL and CFL all the above.
selected by

Related questions