Skip to content
Official PYQ · 2015

GATE CS 2015 Set 3 Q18 — Regular Expressions and Finite Automata

Explain with AI

Let LL be the language represented by the regular expression Σ∗0011Σ∗\Sigma^*0011\Sigma^* where Σ={0,1}\Sigma = \{0, 1\}. What is the minimum number of states in a DFA that recognizes Lˉ\bar{L} (complement of LL)?

Choose one option
View worked solution

Answer: B

The language L=Σ∗0011Σ∗L = \Sigma^*0011\Sigma^* represents the set of all strings over Σ={0,1}\Sigma = \{0, 1\} that contain the substring 0011.

Step 1: Construct the Minimal DFA for LL

To recognize the substring 0011, we track the longest prefix of 0011 matched so far. The states can be defined as follows:

  • q0q_0: Start state (no progress towards 0011)
  • q1q_1: Matched 0
  • q2q_2: Matched 00
  • q3q_3: Matched 001
  • q4q_4: Matched 0011 (Accepting state / Dead-end trap state)

The transition table for this DFA is:

Current State Input 0 Input 1
→q0\rightarrow q_0 q1q_1 q0q_0
q1q_1 q2q_2 q0q_0
q2q_2 q2q_2 q3q_3
q3q_3 q1q_1 q4q_4 (Accepting)
∗q4* q_4 q4q_4 q4q_4

This minimal DFA for LL has exactly 55 states.

Step 2: Find the Minimal DFA for Lˉ\bar{L}

By the properties of regular languages, the complement of a regular language Lˉ\bar{L} is recognized by a DFA obtained by swapping the accepting and non-accepting states of the minimal DFA for LL:

  • The set of states and transitions remains identical.
  • The new accepting states are {q0,q1,q2,q3}\{q_0, q_1, q_2, q_3\}.
  • The new non-accepting state is {q4}\{q_4\}.

According to the Myhill-Nerode theorem, the equivalence relations ≡L\equiv_L and ≡Lˉ\equiv_{\bar{L}} are identical. Thus, the minimal DFA for Lˉ\bar{L} has the exact same number of states as the minimal DFA for LL.

Therefore, the minimum number of states in a DFA that recognizes Lˉ\bar{L} is 55.

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

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