Question

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

L1={αβα∣α∈{a,b}+ AND β∈{a,b}+}L_1 = \{ \alpha \beta \alpha \mid \alpha \in \{a, b\}^+ \text{ AND } \beta \in \{a, b\}^+ \}
L2={αβα∣α∈{a}+ AND β∈{a,b}+}L_2 = \{ \alpha \beta \alpha \mid \alpha \in \{a\}^+ \text{ AND } \beta \in \{a, b\}^+ \}

Which ONE of the following statements is CORRECT?

Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2025 answer key

Solution

Simplify L2L_2 by choosing the minimal prefix/suffix α=a\alpha = a, and test L1L_1 using the pumping lemma.

  1. Analysis of L2L_2:
    • Every string in L2L_2 starts with aa, ends with aa, and has length at least 33.
    • Conversely, if any string w∈{a,b}∗w \in \{a, b\}^* starts with aa, ends with aa, and has ∣w∣≥3|w| \ge 3, we can write w=aβaw = a \beta a by choosing α=a∈{a}+\alpha = a \in \{a\}^+ and β∈{a,b}+\beta \in \{a, b\}^+.
    • Therefore, L2=a(a+b)+aL_2 = a(a + b)^+a, which is a regular language.
  2. Analysis of L1L_1:
    • In L1L_1, α\alpha can be any string in {a,b}+\{a, b\}^+. Consider strings of the form w=apbaapbw = a^p b a a^p b, where pp is the pumping length: the only way to decompose w=αβαw = \alpha \beta \alpha is α=apb\alpha = a^p b and β=a\beta = a, which requires matching the arbitrary count pp of aa's at both ends. By the pumping lemma, L1L_1 is not a regular language.

Hence L1L_1 is not regular, whereas L2L_2 is regular.

Final answer

Option (C)

Common trap

Assuming L2L_2 requires matching arbitrary equal powers aka^k at both ends without noticing that akβak=a(ak−1βak−1)aa^k \beta a^k = a(a^{k-1}\beta a^{k-1})a already has α=a\alpha = a.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 1 (CS1)
Question
44 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.