StreakPeaked· Practice

ExamsGATETechnical

Which one of the following is TRUE ?

  1. The language L = {aⁿ bⁿ | n ≥ 0} is regular.
  2. The language L = {aⁿ | n is prime} is regular.
  3. The language L = {w | w has 3k + 1 b's for some k ∈ N with Σ = {a, b}} is regular.
  4. The language L = {ww | w ∈ Σ* with Σ = {0,1}} is regular.

Correct answer: The language L = {w | w has 3k + 1 b's for some k ∈ N with Σ = {a, b}} is regular.

Solution

This language can be recognized by a finite automaton because it only requires counting the number of 'b's modulo 3, which is a finite condition. Regular languages can be defined by such finite counting, making this language regular.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →