• edited by
4,126 views
10 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

2 Answers

2 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
Position:
Show:

Related questions

2 2 votes
1 1 answer
1.0k
1.0k views
Tuhin Dutta asked Dec 4, 2017
1,041 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 compa...
0 0 votes
0 0 answers
572
572 views
h4kr asked Dec 23, 2022
572 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 this language require more than...
2 2 votes
1 1 answer
2.4k
2.4k views
rahuljai asked Dec 13, 2018
2,415 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...
0 0 votes
1 1 answer
2.1k
2.1k views
Xylene asked Jun 15, 2017
2,096 views
Can anyone give me an example of a language which is not a CSL but can be accepted using a Halting TM?