Minimal deterministic finite automaton for the language \(L=\{0^n \mid n \geq…

2015

Minimal deterministic finite automaton for the language \(L=\{0^n \mid n \geq 0, n \neq 4 \}\) will have :

  1. A.

    1 final state among 5 states

  2. B.

    4 final states among 5 states

  3. C.

    1 final state among 6 states

  4. D.

    5 final state among 6 states

Attempted by 110 students.

Show answer & explanation

Correct answer: D

Answer: The minimal DFA has 6 states with 5 accepting (final) states.

Reasoning:

  • Distinguishability for lengths 0–4: For each n in {0,1,2,3,4}, the string of length n can be turned into length 4 by appending the appropriate number of zeros, so these five lengths are pairwise distinguishable and require distinct states.

  • All lengths ≥5 are equivalent: Appending any number of zeros to a string already of length at least 5 never produces length 4, so all such strings behave the same with respect to future input and form a single equivalence class.

  • Equivalence classes and states: The classes are length 0, 1, 2, 3, 4, and ≥5, giving 6 Myhill–Nerode classes, hence a minimal DFA with 6 states.

  • Accepting states: All classes except the class for length 4 are accepted (the language excludes length 4 only), so there are 5 accepting states.

  • Brief transition description: From the start state (length 0) each input 0 moves to the next length state 1,2,3,4, then to the ≥5 state which loops on 0.

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

Explore the full course: Mppsc Assistant Professor