Question

Which one of the following is TRUE?

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

Solution

Evaluate each language against standard closure properties and automaton models for regularity.

Let us evaluate the four languages:

  • (A) L={anbn∣n≥0}L = \{a^n b^n \mid n \ge 0\}: This requires counting and matching the number of aa's and bb's. A finite automaton cannot store arbitrarily large counts, so this is not regular (it is deterministic context-free).

  • (B) L={an∣n is prime}L = \{a^n \mid n \text{ is prime}\}: The set of primes does not form an arithmetic progression. By the pumping lemma, this unary language is non-regular.

  • (C) L={w∣w has 3k+1 b’s for some k∈N with Σ={a,b}}L = \{w \mid w \text{ has } 3k + 1\text{ } b\text{'s for some } k \in \mathbb{N} \text{ with } \Sigma = \{a, b\}\}: This condition requires the number of bb's to be congruent to 1(mod3)1 \pmod 3. A DFA with 3 states {q0,q1,q2}\{q_0, q_1, q_2\} representing (Nb(w) mod 3)(N_b(w) \bmod 3), with q0q_0 as start state and q1q_1 as the only accepting state, precisely recognizes this language. Therefore, this language is regular.

  • (D) L={ww∣w∈Σ∗}L = \{ww \mid w \in \Sigma^*\}: Recognizing the duplication of an arbitrary string requires unbounded memory to store ww, so this is not regular (in fact, not even context-free).

Thus, only statement C is TRUE.

Final answer

C

Common trap

Confusing counting modulo a constant kk (which is regular) with unbounded equality matching (which is not regular).

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

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 1
Question
25 of 65, printed as CS Q.15
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.