Let Ξ£ = {π‘Ž, 𝑏, 𝑐}. For π‘₯ ∈ Ξ£βˆ— , and 𝛼 ∈ Ξ£, let #𝛼(π‘₯) denote the number…

2025

Let Ξ£ = {π‘Ž, 𝑏, 𝑐}. For π‘₯ ∈ Ξ£βˆ— , and 𝛼 ∈ Ξ£, let #𝛼(π‘₯) denote the number of occurrences of 𝛼 in π‘₯. Which one or more of the following option(s) define(s) regular language(s)?

  1. A.

    {π‘Žπ‘šπ‘π‘› | π‘š, 𝑛 β‰₯ 0}

  2. B.

    {π‘Ž, 𝑏}βˆ— ∩ {π‘Žπ‘šπ‘π‘› π‘π‘šβˆ’π‘› | π‘š β‰₯ 𝑛 β‰₯ 0}

  3. C.

    {𝑀 | 𝑀 ∈ {π‘Ž, 𝑏}βˆ— , #π‘Ž (𝑀) ≑ 2 (mod 7), and #𝑏 (𝑀) ≑ 3 (mod 9)}

  4. D.

    {𝑀 | 𝑀 ∈ {π‘Ž, 𝑏}βˆ— , #π‘Ž (𝑀) ≑ 2 (mod 7), and #π‘Ž (𝑀) = #𝑏(𝑀)}

Attempted by 82 students.

Show answer & explanation

Correct answer: A, C

Answer: The regular languages among the choices are {a^m b^n | m, n β‰₯ 0} and { w ∈ {a,b}* | #a(w) ≑ 2 (mod 7) and #b(w) ≑ 3 (mod 9) }.

  • {a^m b^n | m, n β‰₯ 0} is regular because it equals the regular expression a*b*. A DFA can be built with a start/accepting state that loops on a, transitions on the first b to a second accepting state that loops on b; any string of a's followed by b's is accepted.

  • The set of strings where #a ≑ 2 (mod 7) and #b ≑ 3 (mod 9) is regular because only residues modulo fixed integers are constrained. A finite automaton can track (#a mod 7, #b mod 9) with at most 7Γ—9 = 63 states and accept precisely the states with residues (2,3).

  • Intersecting {a,b}* with {a^m b^n c^{mβˆ’n} | m β‰₯ n β‰₯ 0} removes any strings containing c, forcing mβˆ’n = 0 and yielding {a^m b^m | m β‰₯ 0}. This language is a classic non-regular language (can be shown by the pumping lemma), so the intersection is not regular.

  • The language requiring #a ≑ 2 (mod 7) together with #a = #b remains non-regular because equality of the number of a's and b's is a non-regular property. Adding a modular constraint on #a does not remove the need for unbounded counting, so the language is non-regular (again, the pumping lemma can be used to prove this).

A video solution is available for this question β€” log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…