Skip to content
Official PYQ · 2006

GATE CS 2006 Q34 — Regular Expressions and Finite Automata

Explain with AI

Consider the regular language L=(111+11111)∗.L=(111+11111)^{*}. The minimum number of  states in any DFA accepting this languages is:

Choose one option
View worked solution

Answer: D

The regular language is defined over the alphabet Σ={1}\Sigma = \{1\} as L=(111+11111)∗L = (111 + 11111)^*. The lengths of the strings in LL are of the form 3a+5b3a + 5b for non-negative integers a,b≥0a, b \ge 0.

Using the Frobenius coin problem, the largest integer that cannot be expressed as 3a+5b3a + 5b is: 3×5−3−5=73 \times 5 - 3 - 5 = 7 Thus, all strings of length n≥8n \ge 8 belong to LL. Let us list the membership of 1n1^n in LL for n≥0n \ge 0:

  • n∈Ln \in L: {0,3,5,6,8,9,10,11,… }\{0, 3, 5, 6, 8, 9, 10, 11, \dots\}
  • n∉Ln \notin L: {1,2,4,7}\{1, 2, 4, 7\}

To find the minimum number of states in the DFA, we determine the equivalence classes of the Myhill-Nerode relation. Let qiq_i represent the state reached after reading a string of length ii for 0≤i≤80 \le i \le 8:

  • q0,q3,q5,q6,q8q_0, q_3, q_5, q_6, q_8 are accepting states.
  • q1,q2,q4,q7q_1, q_2, q_4, q_7 are non-accepting states.
All states q0,q1,q2,q3,q4,q5,q6,q7,q_0, q_1, q_2, q_3, q_4, q_5, q_6, q_7, and q8q_8 (which acts as a dead-end accepting state for all n≥8n \ge 8) are pairwise distinguishable. For example, q7q_7 accepts 111^1 but q4q_4 does not; q6q_6 accepts 121^2 but q5q_5 does not, and so on.

Thus, there are exactly 99 states in the minimal DFA.

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

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