GateAI
Regular Expressions and Finite Automata

GATE CSE 2011 · Q42

MCQ2 marksMedium

Time

Definition of a language LL with alphabet {a}\{a\} is given as following. L={ank∣k>0, and n is a positive integer constant}L = \{a^{nk} \mid k > 0, \text{ and } n \text{ is a positive integer constant}\} What is the minimum number of states needed in a DFA to recognize LL?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: B) n+1

Regular Expressions and Finite Automata

The language is defined as:

L={ank∣k>0}={an,a2n,a3n,… }L = \{a^{nk} \mid k > 0\} = \{a^n, a^{2n}, a^{3n}, \dots\}

Here, nn is a fixed positive integer constant, and k≥1k \ge 1.

  • The string ϵ\epsilon (length 00) is not in LL because k>0k > 0.

  • The initial state q0q_0 corresponds to length 00 and must be a non-accepting state.

  • From q0q_0, reading 1,2,…,n−11, 2, \dots, n-1 copies of 'aa' brings the DFA to non-accepting states q1,q2,…,qn−1q_1, q_2, \dots, q_{n-1}.

  • Reading the nn-th 'aa' leads to state qnq_n, which is an accepting state.

  • Subsequent transitions cycle through q1,q2,…,qnq_1, q_2, \dots, q_n because reading another 'aa' from qnq_n transitions to q1q_1.

Since q0q_0 cannot be merged with qnq_n (as ϵ∉L\epsilon \notin L), the states are:

  • q0q_0 (start state, non-accepting)

  • q1,q2,…,qn−1q_1, q_2, \dots, q_{n-1} (n−1n-1 non-accepting states)

  • qnq_n (accepting state)

Total number of states required in the minimal DFA = 1+(n−1)+1=n+11 + (n-1) + 1 = n + 1.

Hence, the correct option is (B).

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Regular Expressions and Finite Automata previous year question is Q42 of the GATE CSE 2011 paper. Find more GATE CSE PYQs on Regular Expressions and Finite Automata in Theory of Computation, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Regular Expressions and Finite Automata PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Regular Expressions and Finite Automata in GATE CSE

Regular Expressions and Finite Automata has 41 GATE CSE PYQs across 24 papers from 2011 to 2026. 10 of them are 2-mark MCQs like this one, and GATE CSE 2011 has 2.

How GATE tests Regular Expressions and Finite Automata

More from GATE CSE 2011

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2011 · Q42 · MCQ

Definition of a language L with alphabet {a} is given as following. L = {ank k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L?

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.