Consider the following languages: \(L_1 = \{a^n w a^n \mid w \in \{a,…

PYQ GATE 2022

Consider the following languages:

L1={anwan∣w∈{a,b}∗}L_1 = \{a^n w a^n \mid w \in \{a, b\}^*\}

L2={wxwR∣w,x∈{a,b}∗,∣w∣,∣x∣>0}L_2 = \{w x w^R \mid w,x \in \{a, b\}^*, |w|, |x| > 0\}

Note that wRw^R is the reversal of the string ww. Which of the following is/are TRUE?

  1. A.

    L1L_1 and L2L_2 are regular.

  2. B.

    L1L_1 and L2L_2 are context-free.

  3. C.

    L1L_1 is regular and L2L_2  is context-free.

  4. D.

    L1L_1 and L2L_2  are context-free but not regular.

Attempted by 167 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…