2
$\begingroup$

When converting NFA to DFA, do I always get the minimal DFA or not?

$\endgroup$
10
  • 1
    $\begingroup$ Generally, no.$\,$ $\endgroup$ Jan 23, 2018 at 17:34
  • $\begingroup$ We discourage posts that simply state a problem out of context, and expect the community to solve it. Assuming you tried to solve it yourself and got stuck, it may be helpful if you wrote your thoughts and what you could not figure out. It will definitely draw more answers to your post. Until then, the question will be voted to be closed / downvoted. You may also want to check out these hints, or use the search engine of this site to find similar questions that were already answered. $\endgroup$
    – Raphael
    Jan 23, 2018 at 18:06
  • $\begingroup$ @Raphael but it's not a problem out of context... I simply asked a question about NFA to DFA conversion $\endgroup$
    – Sepfins
    Jan 23, 2018 at 18:12
  • $\begingroup$ Before asking, we want you to exhaust all reasonable resources to try to answer it on your own, and then show us in the question what you've tried and what progress you've made. For instance, a reasonable thing to try would be to work through a few examples by hand (executing the algorithm manually), to see what seems to happen. This helps you ask better questions, helps us see what level you are at and formulate our answers accordingly, and helps us repeat work you've already done. $\endgroup$
    – D.W.
    Jan 23, 2018 at 18:14
  • $\begingroup$ Of course @RickDecker gave the answer, not in general. But curiously, if you determinize, then reverse the language, determinize and repeat, you will have the minimal automaton. See Brzozowski's algorithm for DFA minimization. $\endgroup$ Jan 23, 2018 at 18:59

1 Answer 1

2
$\begingroup$

No, it is not in general minimal. The standard determinization procedure, the subset construction, always converts an NFA with $n$ states to a DFA with $2^n$ states and there is no reason that this should be minimal.

In practical terms, if you convert an NFA, you'll often find that there are unreachable states in the resulting DFA, which immediately shows that the result is not minimal. For a more extreme example, take any DFA with $n$ states, call it an NFA and determinize it. You now have a DFA with $2^n>n$ states that accepts the same language as it did before, so it's certainly not minimal. (This is a particularly strong example of the first case I mentioned. All states except subsets of size $1$ will be disconnected from the start state, and the states of size $1$ are a copy of the original DFA.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.