Skip to main content

GATE CSE 2025Theory of Computation › Finite Automata & Regular LanguagesVerified

GATE CSE 2025 PYQ: Consider the following two languages over the alphabet { a , b } \{a, b\} { a , b } : L 1 = { α β α ∣ α ∈ {…

Consider the following two languages over the alphabet {a,b}\{a, b\}:

L1={αβα∣α∈{a,b}+AND β∈{a,b}+}L2={αβα∣α∈{a}+AND β∈{a,b}+}\begin{array}{l} L_{1}=\left\{\alpha \beta \alpha \mid \alpha \in\{a, b\}^{+} \text {AND } \beta \in\{a, b\}^{+}\right\} \\ L_{2}=\left\{\alpha \beta \alpha \mid \alpha \in\{a\}^{+} \text {AND } \beta \in\{a, b\}^{+}\right\} \end{array}

Which ONE of the following statements is CORRECT?

  1. A
    Both L1L_{1} and L2L_{2} are regular languages.
  2. B
    L1L_{1} is a regular language but L2L_{2} is not a regular language.
  3. C
    L1L_{1} is not a regular language but L2L_{2} is a regular language.
    Correct answer
  4. D
    Neither L1L_{1} nor L2L_{2} is a regular language.

Answer

(C) L 1 L_{1} L 1 ​ is not a regular language but L 2 L_{2} L 2 ​ is a regular language.

Approach

Determine regularity of $L_1$ and $L_2$ separately. $L_1$ requires matching an arbitrary nonempty prefix $\alpha$ with an identical suffix $\alpha$, which needs unbounded memory; use the pumping lemma to prove non-regularity. $L_2$ restricts $\alpha$ to $a^+$, so the condition collapses to \"starts with $a$ and ends with $a$ with at least one middle symbol\", which is regular.

$L_1$ is not regular because it needs to compare an arbitrary-length prefix and suffix. $L_2$ is regular because restricting $\alpha$ to $a^+$ reduces it to the regular language $a(a+b)^+a$. Hence option C is correct.

Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.