StreakPeaked· Practice

ExamsGATETechnical

Consider the following two languages over the alphabet \(\{a,b\}\): \[ L_1=\{\alpha\beta\alpha \mid \alpha\in\{a,b\}^* \text{ and } \beta\in\{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?

  1. Both \(L_1\) and \(L_2\) are regular languages.
  2. \(L_1\) is a regular language but \(L_2\) is not a regular language.
  3. \(L_1\) is not a regular language but \(L_2\) is a regular language.
  4. Neither \(L_1\) nor \(L_2\) is a regular language.

Correct answer: Neither \(L_1\) nor \(L_2\) is a regular language.

Solution

For \(L_1\), taking \(\alpha=\epsilon\) gives all nonempty strings, but taking nonempty \(\alpha\) forces a mirrored structure that is not regular. For \(L_2\), strings of the form \(a^n b a^n\) are included, and this classic language is not regular. Hence neither language is regular.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →