Skip to content
Official PYQ · 2021

GATE CS 2021 Set 2 Q17 — Regular Expressions and Finite Automata

Explain with AI

Consider the following deterministic finite automaton (DFA)\text{(DFA)}

The number of strings of length 88 accepted by the above automaton is  ___________

View worked solution

Answer: 256 : 256

By analyzing the given DFA, we can observe the reachability of its states from the start state q0q_0:

  • The start state q0q_0 is a final (accepting) state.
  • From q0q_0, on input aa we transition to q1q_1 (which is also a final state), and on input bb we remain in q0q_0.
  • From q1q_1, on input aa we remain in q1q_1, and on input bb we transition back to q0q_0.
  • The state q2q_2 is a non-final state, but there is no path from the start state q0q_0 to q2q_2. Thus, q2q_2 is unreachable.

Since all reachable states (q0q_0 and q1q_1) are final states, every possible sequence of transitions starting from q0q_0 will always end in an accepting state. Therefore, the DFA accepts all strings over the alphabet Σ={a,b}\Sigma = \{a, b\}.

The number of strings of length 88 over the binary alphabet {a,b}\{a, b\} is:

28=2562^8 = 256

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

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