A deterministic finite automaton (DFA) \(D\) with alphabet \(Σ=\{a,b\}\) is…

2011

A deterministic finite automaton (DFA) \(D\) with alphabet \(Σ=\{a,b\}\) is given below.

Which of the following finite state machines is a valid minimal DFA which accepts the same languages as \(D\)?

Attempted by 177 students.

Show answer & explanation

Solution overview: derive the minimal DFA and explain why it is minimal.

Language recognised by the given DFA: all strings over {a,b} that either contain at least one 'a' or contain the substring "bb".

  • Start state (call it p): no a has been seen and the last symbol is not a single b that could lead to "bb". This state is non-accepting.

  • State 'one-b-seen' (call it q): the previous input symbol was a single b, but no a has yet been seen and "bb" has not yet occurred. This state is non-accepting.

  • Accepting sink (call it r): an a has been seen somewhere, or the substring "bb" has been seen. From here all continuations remain accepting (loop on both a and b).

Transitions summary (minimal DFA):

  1. From start p: on a -> r (accept); on b -> q (seen one b).

  2. From q (one-b-seen): on a -> r (accept); on b -> r (because "bb" has been seen).

  3. From r (accepting sink): on a -> r; on b -> r.

Why this DFA is minimal:

  • There are three distinguishable equivalence classes (Myhill–Nerode):

    1) Strings that have not seen an a and do not end with a single b (start).

    2) Strings whose last symbol is a single b and that have not yet seen an a or "bb" (one-b-seen).

    3) Strings that already contain an a or contain "bb" (accepting).

  • The two non-accepting classes are distinguishable: feeding an extra b to the start class yields a non-accepting string, while feeding an extra b to the one-b-seen class yields acceptance ("bb"). Therefore these two cannot be merged.

  • All accepting behaviour is identical and collapses to a single accepting sink. Hence the minimal DFA needs exactly three states: start, one-b-seen, and the accepting sink.

Conclusion: The minimal DFA that recognises the same language has three states with the transitions given above. Any depiction that either merges the two non-accepting states or duplicates equivalent accepting sinks is not minimal or not equivalent.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir