edited by
558 views
4 votes
4 votes

Let $L$ be a given context-free language over the alphabet $\{a, b\}$. Construct $L1, L2$ as follows.
Let $L1 = L − \{xyx \mid x, y \in \{a, b\}^*\}$,
and $L2 = L·L$. Then,

  1. Both $L1$ and $L2$ are regular.
  2. Both $L1$ and $L2$ are context-free but not necessarily regular.
  3. $L1$ is regular and $L2$ is context-free.
  4. $L1$ and $L2$ both may not be context-free.
edited by

2 Answers

Best answer
4 votes
4 votes
I am getting $L_1$  regular and $L_2$ CFL.

$\Rightarrow M=\left \{ xyx |x,y\epsilon \left ( a,b \right )^*\right \}=(a+b)^*$

$L_1=L-M=L\cap M^{'}=L \cap \phi=\phi$ which is regular

$L_2$is CFL as CFL are closed under concatenation and nothing is given about $L$
selected by
Answer:

Related questions

1 votes
1 votes
2 answers
1
aditi19 asked Mar 24, 2019
621 views
If $L = \Bigl \{ x \mid x \in \{ a, b, c \}^*, \text{The length of $x$ is a square } \Bigr \}$ then $L$ isRegularRecursive but not context freeContext Free but not regula...