Skip to content
Official PYQ · 1999

GATE CS 1999 Q1.4 — Regular Expressions and Finite Automata

Explain with AI

Consider the regular expression (0+1)(0+1)…N(0 + 1) (0+1) \dots N times. The minimum state finite automaton that recognizes the language represented by this regular expression contains

Choose one option
View worked solution

Answer: B

The regular expression (0+1)(0+1)…n times(0 + 1)(0 + 1) \dots n \text{ times} represents the language LL consisting of all binary strings of length exactly nn:

L={w∈{0,1}∗∣∣w∣=n}L = \{ w \in \{0, 1\}^* \mid |w| = n \}

To recognize this language with a finite automaton, we need to track the length of the input string processed so far:

  • State q0q_0 represents length 00 (start state).
  • State q1q_1 represents length 11.
  • State q2q_2 represents length 22.
  • …\dots
  • State qnq_n represents length nn (the only accepting state).

This transition sequence q0→0,1q1→0,1⋯→0,1qnq_0 \xrightarrow{0,1} q_1 \xrightarrow{0,1} \dots \xrightarrow{0,1} q_n requires exactly n+1n + 1 states. Any input of length greater than nn cannot transition further (or leads to rejection), making n+1n + 1 states sufficient for the automaton (as an NFA or incomplete DFA).

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Regular Expressions and Finite Automata questions