All Exams Test series for 1 year @ ₹349 only
Question

Let $\Sigma = \{a, b, c\}$. For $x \in \Sigma^*$, and $a \in \Sigma$, let $\#_a(x)$ denote the number of occurrences of $a$ in $x$.
Which one or more of the following option(s) define(s) regular language(s)?

To determine which of the given options define regular languages, we analyze each option using the properties of regular languages.

  1. \(\{a^m b^n \mid m,n > 0\}\):
    • This language consists of strings comprising of 'a's followed by 'b's with both \(m\) and \(n\) greater than zero.
    • It can be expressed by the regular expression \(a^+b^+\), which is a regular language since it can be accepted by a finite automaton.
  2. \(\{a,b\}^* \cap \{a^m b^n c^{m-n} \mid m > n > 0\}\):
    • This language describes strings containing 'a's, 'b's, and 'c's such that the number of 'c's is the difference between the number of 'a's and 'b's.
    • Non-equal counting constraints and arithmetic conditions like \(c^{m-n}\) imply the language is context-free or even more complex, but not regular.
  3. \(\{w \mid w \in \{a,b\}^*, \#_a(w) = 2 \pmod 7, \text{ and } \#_b(w) = 3 \pmod 9\}\):
    • This language imposes modular arithmetic conditions on the count of 'a's and 'b's in the strings.
    • It is possible to construct a finite automaton with states representing remainders when the count of 'a' and 'b' is divided by 7 and 9, respectively.
  4. \(\{w \mid w \in \{a,b\}^*, \#_a(w) = 2 \pmod 7, \text{ and } \#_a(w) = \#_b(w)\}\):
    • While modular arithmetic condition alone can be handled by finite automata, equating counts of symbols generally cannot, especially mixed with modulus constraints.
    • Such a condition usually requires more computational power than that of finite automata, indicating it's not regular.

In conclusion, the correct regular languages are:

  • \(\{a^m b^n \mid m,n > 0\}\)
  • \(\{w \mid w \in \{a,b\}^*, \#_a(w) = 2 \pmod 7, \text{ and } \#_b(w) = 3 \pmod 9\}\)
Was this answer helpful?

Important Questions from Regular Languages

  1. Which of the following are correct on regular expressions?

    A. φ + L = L + φ = L

    B. εL = Lε = L

    C. φL = Lφ = φ

    D. φL = Lφ = L

    Choose the correct answer from the options given below: 

  2. Let $L_1$ and $L_2$ be two languages over a finite alphabet, such that $L_1 \cap L_2$ and $L_2$ are regular languages.
    Which of the following statements is/are always true?
  3. The Kleene Star operation accepts the following string of finite length over set A = {0,1} | where string s contains even number of 0 and 1.

  4. Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R

     Assertion A: If L is regular, then its compliment L' is necessarily regular.

     Reason R: Complement of a language can be obtained by swapping final and non-final states in a DFA. 

    In the light of the above statements, choose the most appropriate answer from the options given below

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App