205 views
0 votes
0 votes

L1:{wwR∣w,x∈{a,b}∗ and |w|>0},wR is the reverse of string w

L2:{wxwR∣w,x∈{a,b}∗ and |w|,|x|>0},wR is the reverse of string w


  1. L1 is regular but not L2
  2. L2 is regular but not L1
  3. Both L1 and L2 are regular
  4. Neither L1 nor L2 is regular

1 Answer

1 votes
1 votes

Option B) L1 is not regular, because the string has to be saved to check if it's followed by its reversal. And there's no way to identify the end of the string. So this language is not even a DCFL and is a CFL

L2 is regular because both x and w belong to (a+b)*. Hence any part of the string can be taken a w,X,wr this grammer generates the set of all strings that atleast start and end with the same charachter.

Related questions

0 votes
0 votes
3 answers
1
moe12leb asked Nov 27, 2022
678 views
Write a regular expression for all strings of 0’s and 1’s in which there is an even number of 0’s between any two 1’s.
1 votes
1 votes
0 answers
2
0 votes
0 votes
1 answer
3
moe12leb asked Nov 27, 2022
237 views
Write a regular expression for all strings of 0’s and 1’s in which the total number of zeros to the right of each 1 is even.