recategorized by
418 views
1 votes
1 votes

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

recategorized by

1 Answer

Best answer
2 votes
2 votes
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

0 votes
0 votes
0 answers
1
0 votes
0 votes
0 answers
2
Pranavpurkar asked Nov 16, 2022
412 views
Consider the language given below:$L$ $=$ { $p$ $|$ $p$ $\neq$ $w$ $and$ $p$ $is$ $the$ $prefix$ $of$ $w$ $and$ $w$ $\epsilon$ {$0,1$}*}Which of following is true about ...