edited by
3,010 views
10 votes
10 votes

Consider the following statements:

$L_1=\left\{\text{wxw$^R$|w$\in$(a,b)$^*$, x$\in$c }\right\}$

$L_2=\left\{\text{wy|w, y $\in$ (a,b)$^*$}\right\} $

$L_3=\left\{\text{zwz|w$\in$(a,b)$^*$,Z$\in$}\left\{a\right\} \right\}$

$L_4=\left\{\text{wxw|w $\in$ (a,b)$^*$, x$\in$} \left\{c\right\}^* \right\}$

Which of the following statements are $\text{CORRECT}$?

  1. All languages $L_1, L_2, L_3, L_4$ are context free languages
  2. Languages $L_1, L_3$ are context free language and $L_2, L_4$ are regular
  3. $L_1$ is context free, $L_2$ and $L_3$ are regular and $L_4$ is context sensitive languages
  4. $L_1, L_4$ are context free, $L_2$ and $L_3$ is context sensitive languages
edited by

2 Answers

2 votes
2 votes

L1= this can be easily achived by PDA ,more specifically by a DPDA .so it is a CFL

L2=it is regular language ,w.y can be anything in (a,b)* here

L3=it is nothing but the set of all languages that starts and ends with a ..so Regular

L4=it is CSL , if it was given like WxWR,then we could make it with stack but here it is WxW.. so not CFL but CSL

so C is the correct answer here

edited by

Related questions

736
views
1 answers
2 votes
Tuhin Dutta asked Dec 4, 2017
736 views
$a) \{\ 0^i\ 1^j\ 2^k\ \ | where\ i\ \neq j\ or\ j\ \neq k\ \}$b) \{\ 0^i\ 1^j\ 2^k\ \ | where\ i\ \neq j\ and\ j\ \neq k\ \}$a) CFL(union of two OR-ed comparisons )b) CSL( Double comaprison )Am I correct?
304
views
0 answers
2 votes
h4kr asked Dec 23, 2022
304 views
Is {$a^nb^nc^n$ | $n>=0$} CSL? After comparing both a and b, stack would be empty. So it can't be CFL. So it is CSL or recursive. And does ... ? Please tell how would check for the grammer of this language even if it is in CSL.Thank you
1.2k
views
1 answers
2 votes
rahuljai asked Dec 13, 2018
1,171 views
Which of the following languages is regular? L = { bba (ba)* a^n-1 | n> 0 }L = {a^nb^n | n < 1000 }L = {a^nb^k | n is odd or k is even }L = {wxw^R | w,x ∈(0+1)* }1, 3 and 42, 3, 42, 31, 2, 3, 4
1.7k
views
1 answers
0 votes
Xylene asked Jun 15, 2017
1,675 views
Can anyone give me an example of a language which is not a CSL but can be accepted using a Halting TM?